/// <summary> /// Добавление в объек колекции переменных /// </summary> /// <param name="name">Название коллекции</param> /// <param name="parentCollection">Владелец коллекции</param> private CollectionVariable AddCollection(string name, CollectionVariable parentCollection, bool isReadOnly = false) { CollectionVariable item = new CollectionVariable(name, isReadOnly); parentCollection.Add(item); return(item); }
/// <summary> /// Конструктор класса /// </summary> public DashboardData( ) { _variables = new Dictionary <string, Variable>( ); Compiler = new Compiler(_variables); MasterCollectionVariable = new CollectionVariable(rootVariable); CurrentCollectionVariable = new CollectionVariable(rootVariable); InitializeVariables( ); }
private void GetVariable(CollectionVariable variable, XElement element) { foreach (XElement xElement in element.Elements()) { if (xElement.Name == "Variable") { variable.Add(((Document)Object).Dashboard[xElement.Value]); } else if (xElement.Name == "GroupVariable") { CollectionVariable collection = new CollectionVariable(xElement.Attribute("name").Value); variable.Add(collection); GetVariable(collection, xElement); } } }
private void getCollectionVariable(CollectionVariable collection, TreeNodeCollection nodes) { foreach (TreeNode node in nodes) { if (node.Tag is CollectionVariable) { CollectionVariable variable = new CollectionVariable(node.Text); collection.Add(variable); getCollectionVariable(variable, node.Nodes); } else { collection.Add(node.Tag as VariableBase); } } }
/// <summary> /// Инициализирует коллекцию переменных /// </summary> private void InitializeCollection(CollectionVariable collection) { AddCollection("Acquisition", collection); AddCollection("Frequency", collection); AddCollection("Hardware", collection); CollectionVariable temp = AddCollection("Multi Rec.", collection); for (int i = 1; i <= 16; i++) { AddCollection(string.Format("Channel {0:D2}", i), temp); } AddCollection("Processing", collection); AddCollection("Grad. Preemph.", collection); AddCollection("B0 Compensation", collection); AddCollection("Misc", collection); }
public DashboardCustomizeForm(Document document) : base(document) { _storeCurrent = Document.Dashboard.CurrentCollectionVariable; Document.Dashboard.CurrentCollectionVariable = _storeCurrent.Clone() as CollectionVariable; InitializeComponent(); _imageList = new ImageList(); _imageList.ColorDepth = ColorDepth.Depth24Bit; _imageList.Images.Add(Local.GetImage("CustomizeDashboard.Group")); _imageList.Images.Add(Local.GetImage("CustomizeDashboard.Variable")); masterTree.ImageList = _imageList; currentTree.ImageList = _imageList; setFilesComboBox(); setTreeView(masterTree.Nodes, Document.Dashboard.MasterCollectionVariable); setTreeView(currentTree.Nodes, Document.Dashboard.CurrentCollectionVariable); }
protected override void Execute(NativeActivityContext context) { try { ICollection <string> collect = CollectionVariable.Get(context); string colname = ColumnName.Get(context); DataTable dt = new DataTable(); dt.Columns.Add(colname, System.Type.GetType("System.String")); foreach (var item in collect) { DataRow dr = dt.NewRow(); dr[0] = item; dt.Rows.Add(dr); } DataTableVariable.Set(context, dt); } catch (Exception ex) { Logger.Log.Logger.LogData("CollectionToDataTable Activity failed with Exception : " + ex, Logger.LogLevel.Error); } }
private void setTreeView(TreeNodeCollection nodes, VariableBase variable) { TreeNode node; if (variable is Variable) { node = nodes.Add(variable.Name, variable.Name, 1, 1); node.Tag = variable; } if (variable is CollectionVariable) { CollectionVariable collectionVariable = variable as CollectionVariable; if (collectionVariable.Name != DashboardData.rootVariable && !collectionVariable.IsReadOnly) { node = nodes.Add(variable.Name, variable.Name, 0, 0); node.Tag = variable; nodes = node.Nodes; } foreach (VariableBase var in collectionVariable.VariableChilds) { setTreeView(nodes, var); } } }
public ComponentIconCollectionPointer(ILimnorDesigner designer, CollectionVariable pointer, MethodClass method) : base(designer, pointer, method) { }
public CollectionData(Fungus.Collection v) { collectionVal = v; collectionRef = null; }