Ejemplo n.º 1
0
 private void AddNodes(TreeNodeCollection collection)
 {
     if (_mainTool.InvokeRequired)
     {
         var s = new CreateRootNodeDel(AddNodes);
         _mainTool.Invoke(s, new object[] { collection });
     }
     else
     {
         DbConfigInfo dbConfigInfo = GetCurenctDbConfigInfo();
         if (dbConfigInfo != null)
         {
             for (int i = 0; i < _dsTable.Tables.Count; i++)
             {
                 if (_dsTable.Tables[i].TableName.Equals(dbConfigInfo.DbConfigName + Tables))
                 {
                     AddNodes(collection[0].Nodes, _dsTable.Tables[i]);
                 }
                 if (_dsTable.Tables[i].TableName.Equals(dbConfigInfo.DbConfigName + Views))
                 {
                     AddNodes(collection[1].Nodes, _dsTable.Tables[i]);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void CreateRootNode(TreeNodeCollection collection)
        {
            if (_mainTool.InvokeRequired)
            {
                var s = new CreateRootNodeDel(CreateRootNode);
                _mainTool.Invoke(s, new object[] { collection });
            }
            else
            {
                var tablesNode = new TreeNode {
                    Text = "Tables/Views", Tag = TagType.Tables
                };
                AddTreeNode(collection, tablesNode);

                //var viewsNode = new TreeNode { Text = TagType.Views.ToString(), Tag = TagType.Views };
                //AddTreeNode(collection, viewsNode);
            }
        }
Ejemplo n.º 3
0
        private void CreateRootNode(TreeNodeCollection collection)
        {
            if (_mainTool.InvokeRequired)
            {
                var s = new CreateRootNodeDel(CreateRootNode);
                _mainTool.Invoke(s, new object[] { collection });
            }
            else
            {
                var fixNode = new TreeNode {
                    Text = TagType.Fix.ToString() + fixM.Major + "." + fixM.Minor, Tag = TagType.Header
                };

                AddTreeNode(collection, fixNode);

                var headerNode = new TreeNode {
                    Text = TagType.Header.ToString(), Tag = TagType.Header
                };
                headerNode.Tag = new NodeTag(TagType.Header, fixM.Header);
                AddTreeNode(fixNode.Nodes, headerNode);



                var messagesNode = new TreeNode {
                    Text = TagType.Messages.ToString(), Tag = TagType.Messages
                };
                AddTreeNode(fixNode.Nodes, messagesNode);

                foreach (Fix.Common.Model.Message message in fixM.Messages)
                {
                    //新建一个结点 =
                    TreeNode node = new TreeNode {
                        Text = message.Name
                    };
                    node.Tag = new NodeTag(TagType.Message, message);
                    TreeNodeimageIndex(node, _isSelected);
                    AddTreeNode(messagesNode.Nodes, node); //加入到结点集合中
                }

                var componentNode = new TreeNode {
                    Text = TagType.Components.ToString(), Tag = TagType.Components
                };
                AddTreeNode(fixNode.Nodes, componentNode);
                foreach (Fix.Common.Model.Component component in fixM.Components)
                {
                    //新建一个结点 =
                    TreeNode node = new TreeNode {
                        Text = component.Name
                    };
                    node.Tag = new NodeTag(TagType.Component, component);
                    TreeNodeimageIndex(node, _isSelected);
                    AddTreeNode(componentNode.Nodes, node); //加入到结点集合中
                }
                var fieldsNode = new TreeNode {
                    Text = TagType.Fields.ToString(), Tag = TagType.Fields
                };
                AddTreeNode(fixNode.Nodes, fieldsNode);

                foreach (Fix.Common.Model.FieldDic fieldDic in fixM.Fields)
                {
                    //新建一个结点 =
                    TreeNode node = new TreeNode {
                        Text = fieldDic.Name
                    };
                    node.Tag = new NodeTag(TagType.Field, fieldDic);
                    TreeNodeimageIndex(node, _isSelected);
                    AddTreeNode(fieldsNode.Nodes, node); //加入到结点集合中
                }
                registerObject(PluginShareHelper.FixFieldDic, fixM.Fields);
                var trailerNode = new TreeNode {
                    Text = TagType.Trailer.ToString(), Tag = TagType.Trailer
                };
                AddTreeNode(fixNode.Nodes, trailerNode);
                trailerNode.Tag = new NodeTag(TagType.Trailer, fixM.Trailer);
                fixNode.Expand();
            }
        }