Commit f95bc944 by Pascal Bigot

--no commit message

parent 4bf74a6e
......@@ -32,6 +32,47 @@ namespace CommonLib
get { return m_ListDataBridge; }
}
public DataBridgeInfo CreateNewBridge()
{
string strNewBrdigeSymbol = string.Empty;
for (int i = 0; i < Int32.MaxValue; i++)
{
strNewBrdigeSymbol = string.Format("BRIDGE_{0}", i);
bool bNameExists = false;
foreach (DataBridgeInfo br in m_ListDataBridge)
{
if (strNewBrdigeSymbol == br.Symbol)
{
bNameExists = true;
break;
}
}
if (!bNameExists)
break;
}
DataBridgeInfo bgInfo = new DataBridgeInfo();
bgInfo.Symbol = strNewBrdigeSymbol;
m_ListDataBridge.Add(bgInfo);
return bgInfo;
}
public void DeleteBridge(string symbol)
{
DataBridgeInfo brInfo = null;
foreach (DataBridgeInfo br in m_ListDataBridge)
{
if (symbol == br.Symbol)
{
brInfo = br;
break;
}
}
if (brInfo != null)
{
m_ListDataBridge.Remove(brInfo);
}
}
/// <summary>
///
/// </summary>
......
......@@ -54,6 +54,7 @@ namespace CommonLib
m_IControl.SourceBTControl = this;
m_ScriptContainer["EvtScript"] = new string[1];
m_Document = document;
CleanScriptFromType();
}
/// <summary>
......@@ -68,6 +69,7 @@ namespace CommonLib
if (m_IControl != null)
m_IControl.SourceBTControl = this;
m_ScriptContainer["EvtScript"] = new string[1];
CleanScriptFromType();
}
/// <summary>
......@@ -315,12 +317,15 @@ namespace CommonLib
break;
case CONTROL_TYPE.SLIDER:
m_IControl.ControlType = InteractiveControlType.Slider;
this.m_ScriptContainer.ClearAll();
break;
case CONTROL_TYPE.STATIC:
m_IControl.ControlType = InteractiveControlType.Text;
this.m_ScriptContainer.ClearAll();
break;
case CONTROL_TYPE.UP_DOWN:
m_IControl.ControlType = InteractiveControlType.NumericUpDown;
this.m_ScriptContainer.ClearAll();
break;
case CONTROL_TYPE.SPECIFIC:
System.Diagnostics.Debug.Assert(false);
......@@ -332,9 +337,32 @@ namespace CommonLib
}
ReadInCommonBTControl(Node);
ReadScript(Node);
CleanScriptFromType();
return true;
}
// c'est très sale et j'aime pas mais faut le temps que je trouve mieux
public void CleanScriptFromType()
{
switch (m_IControl.ControlType)
{
case InteractiveControlType.Slider:
case InteractiveControlType.Text:
case InteractiveControlType.NumericUpDown:
this.m_ScriptContainer.ClearAll();
break;
case InteractiveControlType.Button:
case InteractiveControlType.CheckBox:
case InteractiveControlType.Combo:
case InteractiveControlType.SpecificControl:
case InteractiveControlType.DllControl:
break;
default:
System.Diagnostics.Debug.Assert(false);
break;
}
}
/// <summary>
/// lit les données communes à tout les BT Control
/// </summary>
......@@ -531,7 +559,6 @@ namespace CommonLib
&& Node.ChildNodes[ch].ChildNodes[i].FirstChild != null)
{
listScriptLines.Add(Node.ChildNodes[ch].ChildNodes[i].FirstChild.Value);
}
}
m_ScriptContainer["EvtScript"] = listScriptLines.ToArray();
......@@ -549,6 +576,8 @@ namespace CommonLib
protected void WriteScript(XmlDocument XmlDoc, XmlNode NodeControl)
{
XmlNode XmlEventScript = XmlDoc.CreateElement(XML_CF_TAG.EventScript.ToString());
if (m_ScriptContainer.Count == 0)
return;
for (int i = 0; i < m_ScriptContainer["EvtScript"].Length; i++)
{
if (!string.IsNullOrEmpty(m_ScriptContainer["EvtScript"][i]))
......
......@@ -15,6 +15,7 @@ using System.Text;
using System.Xml;
using System.Windows.Forms;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace CommonLib
{
......@@ -47,6 +48,11 @@ namespace CommonLib
{
get { return m_mapScripts.Keys; }
}
public void ClearAll()
{
m_mapScripts.Clear();
}
}
public interface IScriptable
......@@ -289,11 +295,12 @@ namespace CommonLib
string stritem = "";
stritem = ScriptParser.GetLineToken(Scripts[ScriptType][i], ScriptParser.INDEX_TOKEN_SYMBOL);
StringCollection allLineItems = ScriptParser.GetAllTokens(Scripts[ScriptType][i]);
if (stritem == MessParam.WantDeletetItemSymbol
||
(MessParam.TypeOfItem == typeof(Data)
&& Scripts[ScriptType][i].Contains(MessParam.WantDeletetItemSymbol))
&& allLineItems.Contains(MessParam.WantDeletetItemSymbol))
)
{
Type tp = Sender.GetType();
......@@ -350,7 +357,8 @@ namespace CommonLib
MessDeleted MessParam = (MessDeleted)obj;
for (int i = Scripts[ScriptType].Length - 1; i >= 0; i--)
{
if (!string.IsNullOrEmpty(Scripts[ScriptType][i]) && Scripts[ScriptType][i].Contains(MessParam.DeletetedItemSymbol))
StringCollection allLineItems = ScriptParser.GetAllTokens(Scripts[ScriptType][i]);
if (!string.IsNullOrEmpty(Scripts[ScriptType][i]) && allLineItems.Contains(MessParam.DeletetedItemSymbol))
{
Scripts[ScriptType][i] = string.Empty;
}
......@@ -375,7 +383,9 @@ namespace CommonLib
string stritem = ScriptParser.GetLineToken(Scripts[ScriptType][i], ScriptParser.INDEX_TOKEN_SYMBOL);
if (stritem == MessParam.OldItemSymbol)
{
Scripts[ScriptType][i] = Scripts[ScriptType][i].Replace(MessParam.OldItemSymbol, MessParam.NewItemSymbol);
string pattern = @"\b" + MessParam.OldItemSymbol + @"\b";
Scripts[ScriptType][i] = Regex.Replace(Scripts[ScriptType][i], pattern, MessParam.NewItemSymbol);
//Scripts[ScriptType][i] = Scripts[ScriptType][i].Replace(MessParam.OldItemSymbol, MessParam.NewItemSymbol);
}
}
}
......@@ -385,9 +395,12 @@ namespace CommonLib
MessItemRenamed MessParam = (MessItemRenamed)obj;
for (int i = 0; i < Scripts[ScriptType].Length; i++)
{
if (!string.IsNullOrEmpty(Scripts[ScriptType][i]) && Scripts[ScriptType][i].Contains(MessParam.OldItemSymbol))
StringCollection allLineItems = ScriptParser.GetAllTokens(Scripts[ScriptType][i]);
if (!string.IsNullOrEmpty(Scripts[ScriptType][i]) && allLineItems.Contains(MessParam.OldItemSymbol))
{
Scripts[ScriptType][i] = Scripts[ScriptType][i].Replace(MessParam.OldItemSymbol, MessParam.NewItemSymbol);
string pattern = @"\b" + MessParam.OldItemSymbol + @"\b";
Scripts[ScriptType][i] = Regex.Replace(Scripts[ScriptType][i], pattern, MessParam.NewItemSymbol);
//Scripts[ScriptType][i] = Scripts[ScriptType][i].Replace(MessParam.OldItemSymbol, MessParam.NewItemSymbol);
}
}
}
......
......@@ -467,6 +467,8 @@ namespace CommonLib
System.Diagnostics.Debug.Assert(false);
break;
}
if (this.m_SrcBTControl != null)
this.m_SrcBTControl.CleanScriptFromType();
UpdateResizeBtnsVisibility();
}
......
......@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.2.0.0")]
[assembly: AssemblyFileVersion("3.2.0.0")]
......@@ -373,12 +373,7 @@ namespace CommonLib
string strTemp = strTab[iTokenIndex];
strTemp = strTemp.Trim(')');
strTemp = strTemp.Trim('(');
strTemp = strTemp.Trim(' ');
string strTok = strTemp;
strTok = strTok.Trim();
return strTok;
return strTemp.Trim();
}
}
return "";
......@@ -386,6 +381,52 @@ namespace CommonLib
}
/// <summary>
/// renvoie la liste des token d'un ligne de script
/// </summary>
/// <param name="line">ligne à analyser</param>
/// <returns>liste des tokens de la ligne</returns>
static public StringCollection GetAllTokens(string line)
{
StringCollection result = null;
if (!string.IsNullOrEmpty(line) && !line.StartsWith("//"))
{
// on vire les espaces
line = CleanScriptLine(line);
// on remplace la parenthèse ouvrante par une virgule
line = line.Replace('(', ',');
// on remplace les point par une virgule
line = line.Replace('.', ',');
// on vire la parenthèse fermante
line = line.Replace(")","");
// normalement on se retrouve avec une suite de mot séparés par des virgules
// on fini par splitter sur les virgules
string[] strTab = line.Split(',');
result = new StringCollection();
result.AddRange(strTab);
}
return result;
}
/// <summary>
/// nettoie une ligne de script en supprimant tout ce qui se trouve après la parenthèse fermante
/// et en supprimant les espaces
/// </summary>
/// <param name="line">ligne de script à nettoyer</param>
/// <returns>ligne de script "propre"</returns>
public static string CleanScriptLine(string line)
{
if (!string.IsNullOrEmpty(line))
{
string res = line;
int posEndParenthese = res.LastIndexOf(')');
if (posEndParenthese != -1 && (posEndParenthese + 1) < res.Length)
res = res.Remove(posEndParenthese + 1);
return res.Replace(" ", "");
}
return string.Empty;
}
/// <summary>
/// renvoie le type du premier jeton de la ligne (jeton source)
/// </summary>
/// <param name="Line">Ligne de script</param>
......@@ -630,20 +671,6 @@ namespace CommonLib
{
return false;
}
/*
TrimEndParenthese(ref strTemp);
string strFunc = strTemp;
strFunc = strFunc.Trim();*/
/*
if (m_Document.GestFunction.GetFromSymbol(strFunc) == null)
{
string strErr = string.Format("Invalid Function symbol {0}", strFunc);
ScriptParserError Err = new ScriptParserError(strErr, m_iCurLine, ErrorType.ERROR);
ErrorList.Add(Err);
return false;
}*/
return true;
}
else
......
......@@ -269,8 +269,16 @@ namespace CommonLib
{
SelectedText = SelectedText.Split('(')[1];
if (SelectedText.Contains(","))
{
SelectedText = SelectedText.Split(',')[1];
if (SelectedText.Contains(")"))
{
SelectedText = SelectedText.Split(')')[0];
}
}
}
SelectedText = SelectedText.Trim();
m_EditScript.SelectionLength = 0;
m_EditScript.SelectionStart = posCarret;
......
......@@ -50,7 +50,7 @@
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.Location = new System.Drawing.Point(96, 290);
this.btnOK.Location = new System.Drawing.Point(78, 290);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(109, 22);
this.btnOK.TabIndex = 1;
......@@ -62,7 +62,7 @@
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnClose.Location = new System.Drawing.Point(326, 290);
this.btnClose.Location = new System.Drawing.Point(308, 290);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(109, 23);
this.btnClose.TabIndex = 1;
......@@ -73,7 +73,7 @@
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.Location = new System.Drawing.Point(211, 291);
this.btnCancel.Location = new System.Drawing.Point(193, 290);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(109, 22);
this.btnCancel.TabIndex = 1;
......@@ -97,6 +97,7 @@
this.Name = "BasePropertiesDialog";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "Properties";
this.Deactivate += new System.EventHandler(this.BasePropertiesDialog_Leave);
......
......@@ -22,6 +22,8 @@ namespace CommonLib
public event EventHandler ObjectPropertiesChanged;
BTScreen m_CurrentScreen;
int m_iPageIndexMemory = 0;
/// <summary>
///
/// </summary>
......@@ -71,6 +73,12 @@ namespace CommonLib
/// </summary>
public void Initialize()
{
// on fait la mémo que si on a plus d'une page
if (this.tabControl1.TabPages.Count > 1)
m_iPageIndexMemory = this.tabControl1.SelectedIndex;
else
m_iPageIndexMemory = -1;
m_listPropsPanels.Clear();
m_listTitle.Clear();
tabControl1.SuspendLayout();
......@@ -144,19 +152,10 @@ namespace CommonLib
{
m_listPropsPanels[i].ConfiguredItemGest = m_CurrentScreen.Controls;
}
//System.Diagnostics.Debug.Assert(false); // TODO
//m_listPropsPanels[i].ConfiguredItemGest = m_Document.GestScreen.GetFromsymbol(screenSymb).GestControl;
// ici il faut savoir dans quel écran on se trouve
}
AddPropertyTab(m_listTitle[i], m_listPropsPanels[i]);
m_listPropsPanels[i].ObjectToPanel();
}
//
if (this.tabControl1.TabPages.Count >= 2)
{
this.tabControl1.SelectedIndex = 1;
}
}
}
else
......@@ -169,6 +168,8 @@ namespace CommonLib
}
tabControl1.ResumeLayout();
tabControl1.Visible = true;
if (m_iPageIndexMemory != -1 && m_iPageIndexMemory < tabControl1.TabPages.Count)
tabControl1.SelectedIndex = m_iPageIndexMemory;
}
private void AddPropertyTab(string title, IObjectPropertyPanel panel)
......
......@@ -385,7 +385,7 @@ namespace CommonLib
ctrl.Location = this.m_panelPlaceSpec.Location;
m_CurrentSpecificControlPropPanel = ctrl;
m_CurrentSpecificControlPropPanel.Parent = this;
//m_CurrentSpecificControlPropPanel.Width = this.Width/2;
//m_CurrentSpecificControlPropPanel.Width = this.Width-20;
//m_CurrentSpecificControlPropPanel.Height = this.Height - ctrl.Location.X -10;
m_CurrentSpecificControlPropPanel.AutoScroll = true;
m_CurrentSpecificControlPropPanel.Visible = true;
......
......@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.2.0.0")]
[assembly: AssemblyFileVersion("3.2.0.0")]
......@@ -2,7 +2,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5A8BD31D-5E4E-4891-9351-DD3119CB6BC9}</ProjectGuid>
<OutputType>WinExe</OutputType>
......
......@@ -59,13 +59,16 @@
this.colDstDatas = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.cboPostFunc = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.txtSymbol = new CommonLib.SymbolTextBox();
((System.ComponentModel.ISupportInitialize)(this.numBridgePeriod)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridViewBridge)).BeginInit();
this.SuspendLayout();
//
// numBridgePeriod
//
this.numBridgePeriod.Location = new System.Drawing.Point(16, 19);
this.numBridgePeriod.Location = new System.Drawing.Point(701, 23);
this.numBridgePeriod.Maximum = new decimal(new int[] {
10000,
0,
......@@ -88,7 +91,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 3);
this.label1.Location = new System.Drawing.Point(698, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(69, 13);
this.label1.TabIndex = 1;
......@@ -365,6 +368,31 @@
this.label8.TabIndex = 14;
this.label8.Text = "Post bridge executed script";
//
// label9
//
this.label9.Location = new System.Drawing.Point(271, 25);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(385, 41);
this.label9.TabIndex = 15;
this.label9.Text = "At each bridge period, values from source datas are copied to targets datas. Note" +
" that it can trigger scripted events in target supervision.";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(12, 7);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(72, 13);
this.label10.TabIndex = 1;
this.label10.Text = "Bridge symbol";
//
// txtSymbol
//
this.txtSymbol.Location = new System.Drawing.Point(16, 24);
this.txtSymbol.Name = "txtSymbol";
this.txtSymbol.Size = new System.Drawing.Size(210, 20);
this.txtSymbol.TabIndex = 16;
//
// BridgeEditorForm
//
this.AcceptButton = this.btnOK;
......@@ -372,6 +400,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(928, 559);
this.Controls.Add(this.txtSymbol);
this.Controls.Add(this.label9);
this.Controls.Add(this.label8);
this.Controls.Add(this.cboPostFunc);
this.Controls.Add(this.gridViewBridge);
......@@ -395,6 +425,7 @@
this.Controls.Add(this.btnRemDstData);
this.Controls.Add(this.btnAddSrcData);
this.Controls.Add(this.btnAddDstData);
this.Controls.Add(this.label10);
this.Controls.Add(this.label1);
this.Controls.Add(this.numBridgePeriod);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
......@@ -441,5 +472,8 @@
private System.Windows.Forms.DataGridViewTextBoxColumn colDstDatas;
private System.Windows.Forms.ComboBox cboPostFunc;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label10;
private CommonLib.SymbolTextBox txtSymbol;
}
}
\ No newline at end of file
......@@ -78,6 +78,7 @@ namespace SmartApp
if (m_BridgeInfo == null)
return;
txtSymbol.Text = m_BridgeInfo.Symbol;
numBridgePeriod.Value = m_BridgeInfo.ExecTimerPeriod;
for (int i = 0; i< cboSourceProj.Items.Count; i++)
{
......@@ -122,6 +123,7 @@ namespace SmartApp
/// </summary>
protected void SaveToBridgeInfo()
{
m_BridgeInfo.Symbol = txtSymbol.Text;
CComboData objSrcProj = cboSourceProj.SelectedItem as CComboData;
CComboData objDstProj = cboTargetProj.SelectedItem as CComboData;
if (objSrcProj != null)
......
......@@ -123,10 +123,4 @@
<metadata name="colDstDatas.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSrcData.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDstDatas.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file
......@@ -115,11 +115,15 @@ namespace SmartApp
item = new ToolStripMenuItem(Program.LangSys.C("Remove bridge from solution"));
item.Click += new EventHandler(CtxMenuRemoveProj_Click);
m_CtxMenuBridge.Items.Add(item);
item = new ToolStripMenuItem(Program.LangSys.C("Configure Bridge"));
item = new ToolStripMenuItem(Program.LangSys.C("Add bridge"));
item.Click += new EventHandler(CtxMenuAddBridge_Click);
m_CtxMenuBridge.Items.Add(item);
item = new ToolStripMenuItem(Program.LangSys.C("Configure bridge"));
item.Click += new EventHandler(CtxMenuBridgeProperties_Click);
m_CtxMenuBridgeItem.Items.Add(item);
item = new ToolStripMenuItem(Program.LangSys.C("Delete"));
item.Click += new EventHandler(CtxMenuObjectDelete_Click);
item = new ToolStripMenuItem(Program.LangSys.C("Delete bridge"));
item.Click += new EventHandler(CtxMenuObjectDeleteBridge_Click);
m_CtxMenuBridgeItem.Items.Add(item);
// menu pour un gestionnaire de group
......@@ -361,11 +365,10 @@ namespace SmartApp
Solution = m_GestSolution,
BridgeInfo = bri,
};
brideDlg.ShowDialog();
//DocumentProprtiesDialog projectPropDialog = new DocumentProprtiesDialog();
//DocumentProprtiesDialog CfgPage = new DocumentProprtiesDialog();
//CfgPage.Document = elem.Document as BTDoc;
//CfgPage.ShowDialog();
if (brideDlg.ShowDialog() == DialogResult.OK)
{
selNode.Text = bri.Symbol;
}
}
/// <summary>
......@@ -438,6 +441,35 @@ namespace SmartApp
}
}
void CtxMenuAddBridge_Click(object sender, EventArgs e)
{
TreeNode selNode = this.SelectedNode;
if (selNode.Tag is DocumentElementNode)
{
DocumentElementNode docNode = selNode.Tag as DocumentElementNode;
if (docNode.Document is BridgeDoc)
{
BridgeDoc bridge = docNode.Document as BridgeDoc;
DataBridgeInfo bgInfo = bridge.CreateNewBridge();
this.AddBridgeElemNode(selNode, bgInfo, "IO");
}
}
}
void CtxMenuObjectDeleteBridge_Click(object sender, EventArgs e)
{
TreeNode selNode = this.SelectedNode;
if (selNode.Tag is DataBridgeInfo)
{
BaseDoc docNode = GetDocFromParentNode(selNode);
if (docNode is BridgeDoc)
{
((BridgeDoc)docNode).DeleteBridge(selNode.Text);
selNode.Remove();
}
}
}
void CtxMenuSplitJoinWizard_Click(object sender, EventArgs e)
{
TreeNode selNode = this.SelectedNode;
......@@ -473,8 +505,10 @@ namespace SmartApp
if (bobj != null && objGest != null)
{
selNode.Remove();
objGest.RemoveObj(bobj);
if (objGest.RemoveObj(bobj))
{
selNode.Remove();
}
}
}
......@@ -734,7 +768,7 @@ namespace SmartApp
if (docElem.Document is BridgeDoc)
{
BridgeDoc doc = docElem.Document as BridgeDoc;
this.AddBridgeNode(docName, Program.LangSys.C("Data bridge"), "IO");
this.AddBridgeNodes(docName, "IO");
}
}
......@@ -768,26 +802,29 @@ namespace SmartApp
AddBaseGestContent(GestNode, gest, imageKey);
}
public void AddBridgeNode(string docName, string Label, string imageKey)
public void AddBridgeNodes(string docName, string imageKey)
{
DocumentElementNode docElem = m_ListDocument[docName];
BridgeDoc doc = docElem.Document as BridgeDoc;
for (int i = 0; i < doc.DocumentBridges.Count; i++)
{
BaseObject item = doc.DocumentBridges[i];
if (item.IsUserVisible)
{
TreeNode ItemNode = new TreeNode(item.Symbol);
ItemNode.ImageKey = imageKey;
ItemNode.StateImageKey = imageKey;
ItemNode.SelectedImageKey = imageKey;
ItemNode.Tag = item;
ItemNode.ToolTipText = GetToolTipFromTag(item);
docElem.DocNode.Nodes.Add(ItemNode);
}
AddBridgeElemNode(docElem.DocNode, item as DataBridgeInfo, imageKey);
}
}
public void AddBridgeElemNode(TreeNode parentNode, DataBridgeInfo bridge, string imageKey)
{
TreeNode ItemNode = new TreeNode(bridge.Symbol);
ItemNode.ImageKey = imageKey;
ItemNode.StateImageKey = imageKey;
ItemNode.SelectedImageKey = imageKey;
ItemNode.Tag = bridge;
ItemNode.ToolTipText = GetToolTipFromTag(bridge);
parentNode.Nodes.Add(ItemNode);
}
/// <summary>
/// Ajoute le contenu d'un gestionnaire de groupe dans l'arbre
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment