Expand() public method

public Expand ( ) : void
return void
Beispiel #1
1
        /// <summary>
        /// Build up the Tree for the current piece of Cyberware and all of its children.
        /// </summary>
        /// <param name="objCyberware">Cyberware to iterate through.</param>
        /// <param name="objParentNode">TreeNode to append to.</param>
        /// <param name="objMenu">ContextMenuStrip that the new Cyberware TreeNodes should use.</param>
        /// <param name="objGearMenu">ContextMenuStrip that the new Gear TreeNodes should use.</param>
        public void BuildCyberwareTree(Cyberware objCyberware, TreeNode objParentNode, ContextMenuStrip objMenu, ContextMenuStrip objGearMenu)
        {
            TreeNode objNode = new TreeNode();
                objNode.Text = objCyberware.DisplayName;
                objNode.Tag = objCyberware.InternalId;
                if (objCyberware.Notes != string.Empty)
                    objNode.ForeColor = Color.SaddleBrown;
                objNode.ToolTipText = objCyberware.Notes;
                objNode.ContextMenuStrip = objMenu;

                objParentNode.Nodes.Add(objNode);
                objParentNode.Expand();

                foreach (Cyberware objChild in objCyberware.Children)
                    BuildCyberwareTree(objChild, objNode, objMenu, objGearMenu);

                foreach (Gear objGear in objCyberware.Gear)
                {
                    TreeNode objGearNode = new TreeNode();
                    objGearNode.Text = objGear.DisplayName;
                    objGearNode.Tag = objGear.InternalId;
                    if (objGear.Notes != string.Empty)
                        objGearNode.ForeColor = Color.SaddleBrown;
                    objGearNode.ToolTipText = objGear.Notes;
                    objGearNode.ContextMenuStrip = objGearMenu;

                    BuildGearTree(objGear, objGearNode, objGearMenu);

                    objNode.Nodes.Add(objGearNode);
                    objNode.Expand();
                }
        }
        /// <summary>
        /// Adds a new node to the selected node.
        /// </summary>
        public void AddNewNode()
        {
            if (SelectedNode == null)
            {
                MessageBox.Show("Please select a node first.");
                return;
            }

            if (!SelectedNode.Text.Equals("Attributes", StringComparison.OrdinalIgnoreCase) && !SelectedNode.Text.Equals("Elements", StringComparison.OrdinalIgnoreCase))
            {
                MessageBox.Show("Please select either an 'attributes' or 'elements' node before attempting to add an item.");
                return;
            }

            String nodename = GetTextInput();

            if (nodename != "")
            {
                foreach (TreeNode node in SelectedNode.Nodes)
                {
                    if (node.Text == nodename)
                    {
                        MessageBox.Show("Node already exists.");
                        return;
                    }
                }

                if (nodename.Equals("attributes", StringComparison.OrdinalIgnoreCase) || nodename.Equals("elements", StringComparison.OrdinalIgnoreCase))
                {
                    MessageBox.Show("Name is invalid.");
                    return;
                }

                var newnode = new TreeNode(nodename);
                SelectedNode.Nodes.Add(newnode);
                SelectedNode.Expand();

                if (SelectedNode.Text.Equals("Attributes", StringComparison.OrdinalIgnoreCase))
                {
                    var valuenode = new TreeNode(GetTextInput("Please enter the value of the new attribute."));
                    newnode.Nodes.Add(valuenode);
                    newnode.Expand();
                }

                if (SelectedNode.Text.Equals("Elements", StringComparison.OrdinalIgnoreCase))
                {
                    var attribnode = new TreeNode("Attributes");
                    var elenode = new TreeNode("Elements");

                    newnode.Nodes.Add(attribnode);
                    newnode.Nodes.Add(elenode);

                    newnode.Expand();
                }
            }
        }
        private void mLoadMonthTree(string pYear)
        {
            string   strMonthType = "";
            string   strDate      = "";
            DateTime dteDate;

            System.Windows.Forms.TreeNode oNodex = null;
            int i = 0;
            //string strSelection;
            ////strSelection = tvNode.SelectedNode.Text;
            List <ManuProcess> oogrp;

            this.tvNode.Nodes.Clear();
            tvNode.ImageList = imageList1;
            for (int intNode = 1; intNode <= 12; intNode++)
            {
                string strMonthName = GetMonth(intNode);
                oNodex            = tvNode.Nodes.Add(mcGROUP_PREFIX + strMonthName, strMonthName, "");
                oNodex.ImageIndex = 0;
                oNodex.Expand();
            }
            if (intConvertFg == 0)
            {
                oogrp = invms.mLoadProduction(strComID, pYear, intConvertFg).ToList();
            }
            else
            {
                oogrp = invms.mLoadFgProcessFG(strComID, pYear).ToList();
            }
            foreach (ManuProcess inv in oogrp)
            {
                int intMonth = Convert.ToDateTime(inv.strEntryDate).Month;
                strMonthType = GetMonth(intMonth);
                if (strDate != inv.strEntryDate)
                {
                    //if (strDate != "")
                    //{
                    oNodex  = tvNode.Nodes.Find(mcGROUP_PREFIX + strMonthType, true)[0].Nodes.Add(mcGROUP_PREFIX + inv.strEntryDate, inv.strEntryDate, "closed");
                    dteDate = Convert.ToDateTime(inv.strEntryDate);
                    //}
                    strDate = inv.strEntryDate;

                    oNodex.ImageIndex = 0;
                }
                oNodex.Expand();
            }

            foreach (ManuProcess inv in oogrp)
            {
                oNodex                    = tvNode.Nodes.Find(mcGROUP_PREFIX + inv.strEntryDate, true)[0].Nodes.Add(mcGROUP_PREFIX + inv.strProcessName, inv.strProcessName, "closed");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.Expand();
            }
        }
Beispiel #4
0
 public void Browse(System.Windows.Forms.TreeNode node)
 {
     try
     {
         Opc.Da.Server  server = this.FindServer(node);
         ItemIdentifier itemID = null;
         if (node.Tag != null && node.Tag.GetType() == typeof(BrowseElement))
         {
             BrowseElement browseElement = (BrowseElement)node.Tag;
             itemID = new ItemIdentifier(browseElement.ItemPath, browseElement.ItemName);
         }
         node.Nodes.Clear();
         BrowsePosition  browsePosition = null;
         BrowseElement[] array          = server.Browse(itemID, this.m_filters, out browsePosition);
         if (array != null)
         {
             BrowseElement[] array2 = array;
             for (int i = 0; i < array2.Length; i++)
             {
                 BrowseElement browseElement2 = array2[i];
                 if (!browseElement2.ItemName.Contains("alrosa_w") && !browseElement2.ItemName.Contains("List of"))
                 {
                     if (!browseElement2.IsItem)
                     {
                         this.AddBrowseElement(node, browseElement2);
                     }
                 }
             }
             node.Expand();
         }
         while (browsePosition != null)
         {
             System.Windows.Forms.DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("More items meeting search criteria exist. Continue browse?", "Browse Items", System.Windows.Forms.MessageBoxButtons.YesNo);
             if (dialogResult == System.Windows.Forms.DialogResult.No)
             {
                 break;
             }
             array = server.BrowseNext(ref browsePosition);
             if (array != null)
             {
                 BrowseElement[] array2 = array;
                 for (int i = 0; i < array2.Length; i++)
                 {
                     BrowseElement browseElement2 = array2[i];
                     this.AddBrowseElement(node, browseElement2);
                 }
                 node.Expand();
             }
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
 private void Add(TreeNode parent)
 {
     TreeNode node = null;
     string str = System.Design.SR.GetString("BaseNodeName");
     if (parent == null)
     {
         int num;
         this.NextNode = (num = this.NextNode) + 1;
         int num2 = num;
         node = this.treeView1.Nodes.Add(str + num2.ToString(CultureInfo.InvariantCulture));
         node.Name = node.Text;
     }
     else
     {
         int num3;
         this.NextNode = (num3 = this.NextNode) + 1;
         int num4 = num3;
         node = parent.Nodes.Add(str + num4.ToString(CultureInfo.InvariantCulture));
         node.Name = node.Text;
         parent.Expand();
     }
     if (parent != null)
     {
         this.treeView1.SelectedNode = parent;
     }
     else
     {
         this.treeView1.SelectedNode = node;
         this.SetNodeProps(node);
     }
 }
Beispiel #6
0
 private void BindTree()
 {
     var mf = Utils.GetMainForm();
     if (mf != null)
     {
         var nodes = new List<TreeNode>();
         var ms = mf.Menus.OrderBy(m => m.OrderNum);
         foreach (var tm in ms)
         {
             if (tm.ParentId != Guid.Empty)
             {
                 continue;
             }
             var tn = new TreeNode();
             tn.Text = tm.MenuName;
             tn.Tag = tm;
             foreach (var sm in ms)
             {
                 if (tm.Id != sm.ParentId)
                 {
                     continue;
                 }
                 var sn = new TreeNode();
                 sn.Text = sm.MenuName;
                 sn.Tag = sm;
                 tn.Nodes.Add(sn);
             }
             tn.Expand();
             nodes.Add(tn);
         }
         treeView1.Nodes.AddRange(nodes.ToArray());
     }
 }
Beispiel #7
0
        public void AddNode(TreeNode parentNode)
        {
            DataRow[] foundRows;
            TreeNode newNode;
            foundRows = MainForm.theUserpermission.Tables[0].Select("Parent_Menu_code = '" + parentNode.Tag.ToString() + "'");
            if (foundRows.Length > 0)
            {
                for (int i = 0; i < foundRows.Length; i++)
                {
                    newNode = new TreeNode();
                    newNode.Text = foundRows[i]["Permission_name"].ToString();
                    newNode.Tag = foundRows[i]["Permission_code"].ToString();
                    if (foundRows[i]["If_form"].ToString() != "True")
                    {
                        newNode.ImageIndex = 0;
                        newNode.SelectedImageIndex = 0;

                    }
                    else
                    {
                        newNode.ImageIndex = 1;
                        newNode.SelectedImageIndex = 1;
                    }
                    parentNode.Nodes.Add(newNode);
                    newNode.Expand();
                }
                treeView1.ExpandAll();
            }
        }
        /// <summary>
        /// Loads the tree of document samples
        /// </summary>
        private void LoadSamples()
        {
            TreeNode root = new TreeNode("Sample Documents"); tv.Nodes.Add(root);
            string[] names = Assembly.GetExecutingAssembly().GetManifestResourceNames();
            string extensionFilter = ".htm";

            Array.Sort(names);

            foreach (string name in names)
            {
                int extPos = name.LastIndexOf('.');
                int namePos = extPos > 0 && name.Length > 1 ? name.LastIndexOf('.', extPos - 1) : 0;
                string ext = name.Substring(extPos >= 0 ? extPos : 0);
                string shortName = namePos > 0 && name.Length > 2 ? name.Substring(namePos + 1, name.Length - namePos - ext.Length - 1) : name;

                if (string.IsNullOrEmpty(extensionFilter)
                    || extensionFilter.IndexOf(ext) >= 0)
                {
                    TreeNode node = new TreeNode(shortName);
                    root.Nodes.Add(node);
                    node.Tag = name;
                }
            }
           
            root.Expand();

            if (root.Nodes.Count > 0)
            {
                tv.SelectedNode = root.Nodes[0];
                tv_NodeMouseClick(this, new TreeNodeMouseClickEventArgs(root.Nodes[0], MouseButtons.None, 0, 0, 0));
            }
        }
Beispiel #9
0
        private void WhereUsedMenuItem_Click(object sender, EventArgs e)
        {
            TreeNode node;
            TreeNode newNode = new TreeNode();
            Urn[] urns = new Urn[1];
            Scripter scripter;

            // Get selected node
            node = this.DependenciesTreeView.SelectedNode;

            // Only do this once
            if (node.Nodes.ContainsKey(Properties.Resources.UsedBy) == true
                | node.Name == Properties.Resources.UsedBy)
            {
                return;
            }

            // Get the urn from the node
            urns[0] = (Urn)(node.Tag);

            // Add a "where used" node
            newNode = new TreeNode(Properties.Resources.UsedBy);
            newNode.Name = Properties.Resources.UsedBy;
            node.Nodes.Add(newNode);

            // And add the tree to the current node
            scripter = new Scripter(server);
            AddChildren(newNode, scripter.DiscoverDependencies(urns, DependencyType.Children).FirstChild);
            node.Expand();
            newNode.Expand();
        }
        private void BtnAddNewClick(object sender, EventArgs e)
        {
            if (treeXML.SelectedNode != null)
            {
                if (treeXML.SelectedNode.Text == "Attributes" || treeXML.SelectedNode.Text == "Elements")
                {
                    String nodename = Microsoft.VisualBasic.Interaction.InputBox("Please enter the name of the new node.", "New Node Creation");

                    if (nodename != "")
                    {
                        foreach (TreeNode node in treeXML.SelectedNode.Nodes)
                        {
                            if (node.Text == nodename)
                            {
                                MessageBox.Show("Node already exists.");

                                return;
                            }
                        }

                        if (nodename.ToLower() == "attributes" || nodename.ToLower() == "elements")
                        {
                            MessageBox.Show("Name is invalid.");
                        }
                        else
                        {
                            var newnode = new TreeNode(nodename);
                            treeXML.SelectedNode.Nodes.Add(newnode);
                            treeXML.SelectedNode.Expand();

                            if (treeXML.SelectedNode.Text == "Attributes")
                            {
                                var valuenode = new TreeNode("value");
                                newnode.Nodes.Add(valuenode);
                                newnode.Expand();
                            }

                            if (treeXML.SelectedNode.Text == "Elements")
                            {
                                var attribnode = new TreeNode("Attributes");
                                var elenode = new TreeNode("Elements");

                                newnode.Nodes.Add(attribnode);
                                newnode.Nodes.Add(elenode);

                                newnode.Expand();
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Please select either an 'attributes' or 'elements' node before attempting to add an item.");
                }
            }
            else
            {
                MessageBox.Show("Please select a node first.");
            }
        }
        public FormSelectSchema(DocProject project) : this()
        {
            this.m_project = project;

            foreach (DocSection docSection in project.Sections)
            {
                if (docSection.Schemas.Count > 0)
                {
                    TreeNode tnSection = new TreeNode();
                    tnSection.Tag = docSection;
                    tnSection.Text = docSection.Name;
                    tnSection.ImageIndex = 1;
                    this.treeView.Nodes.Add(tnSection);

                    foreach (DocSchema docSchema in docSection.Schemas)
                    {
                        TreeNode tnSchema = new TreeNode();
                        tnSchema.Tag = docSchema;
                        tnSchema.Text = docSchema.Name;
                        tnSchema.ImageIndex = 0;
                        tnSection.Nodes.Add(tnSchema);
                    }

                    tnSection.Expand();
                }
            }
        }
Beispiel #12
0
        private void ParseIntoTree(DemoFile.DemoMessage msg)
        {
            var node = new TreeNode(String.Format("{0}, tick {1}, {2} bytes", msg.Type, msg.Tick, msg.Data.Length));
            node.Expand();
            node.BackColor = DemoMessageItem.GetTypeColor(msg.Type);

            switch (msg.Type)
            {
                case DemoFile.MessageType.ConsoleCmd:
                    node.Nodes.Add(Encoding.ASCII.GetString(msg.Data));
                    break;
                case DemoFile.MessageType.UserCmd:
                    UserCmd.ParseIntoTreeNode(msg.Data, node);
                    break;
                case DemoFile.MessageType.Signon:
                case DemoFile.MessageType.Packet:
                    Packet.Parse(msg.Data, node);
                    break;
                case DemoFile.MessageType.DataTables:
                    DataTables.Parse(msg.Data, node);
                    break;
                default:
                    node.Nodes.Add("Unhandled demo message type.");
                    break;
            }

            messageTree.Nodes.Add(node);
        }
Beispiel #13
0
        public void Add(MartialArt input, ContextMenuStrip strip)
        {
            TreeNode newNode = new TreeNode();
            newNode.Text = input.DisplayName;
            newNode.Tag = input.Name;
            newNode.ContextMenuStrip = strip;
            if (input.Notes != string.Empty)
                newNode.ForeColor = Color.SaddleBrown;
            newNode.ToolTipText = CommonFunctions.WordWrap(input.Notes, 100);

            foreach (MartialArtAdvantage objAdvantage in input.Advantages)
            {
                TreeNode objAdvantageNode = new TreeNode();
                objAdvantageNode.Text = objAdvantage.DisplayName;
                objAdvantageNode.Tag = objAdvantage.InternalId;
                newNode.Nodes.Add(objAdvantageNode);
                newNode.Expand();
            }

            if (input.IsQuality)
            {
                this.Nodes[1].Nodes.Add(newNode);
                this.Nodes[1].Expand();
            }
            else
            {
                this.Nodes[0].Nodes.Add(newNode);
                this.Nodes[0].Expand();
            }
        }
Beispiel #14
0
        private void RefreshDevices()
        {
            tv_dirs.Nodes.Clear();
            lv_files.Clear();

            if ( devices != null )
            {
                foreach ( Device dev in devices ) dev.Close();
            }

            devices = Device.GetPhysicalDevices();

            foreach ( Device dev in devices )
            {
                TreeNode root_node = new TreeNode( dev.DeviceName );
                root_node.ImageIndex = 0;
                root_node.SelectedImageIndex = 0;
                tv_dirs.Nodes.Add( root_node );
                List< FileSystem > filesystems = dev.GetFileSystems();

                foreach ( FileSystem fs in filesystems )
                {
                    FileNode node = new FileNode( fs.GetRootDir(), true );
                    root_node.Nodes.Add( node );
                }

                root_node.Expand();
            }
        }
Beispiel #15
0
        public void RebuildTreeNode()
        {
            //we have to construct this in a tree search fashion.

            //first step, let's save any stragglers with missing parents.
            //really, this should never happen. but we don't want the maps to become inaccessible but
            //still existant if it does.
            ReparentLostMapsToZero();

            //scan for all maps with a parent of zero, then do a scan for each one recursively to create the tree
            foreach (MapInfo info in Maps)
            {
                if (info.ParentId == 0)
                {
                    //link it to the root node
                    TreeNode.Nodes.Add(info.TreeNode);
                }
                else
                {
                    //link it to its parent's node
                    GetMapById(info.ParentId).TreeNode.Nodes.Add(info.TreeNode);
                }
            }

            //always expand the root node on load/change
            TreeNode.Expand();
        }
Beispiel #16
0
        private void AddNode(TreeNodeCollection parentTreeNodes, XElement element)
        {
            StringBuilder sb = new StringBuilder();

            string attrstring = string.Join(" ", element.Attributes().Select(a => a.Name + "=\"" + a.Value + "\""));
            if (attrstring != string.Empty)
            {
                sb.Append(" " + attrstring);
            }

            string innertext = element.Value;
            if (innertext != string.Empty)
            {
                sb.Append(" Value=\"" + innertext + "\"");
            }

            TreeNode treenode = new TreeNode();
            treenode.Text = element.Name.LocalName + sb.ToString();
            parentTreeNodes.Add(treenode);

            foreach (XElement child in element.Descendants())
            {
                AddNode(treenode.Nodes, child);
            }

            treenode.Expand();
        }
Beispiel #17
0
        /// <summary>
        /// Loads the root TreeView nodes.
        /// </summary>
        private void LoadRootNodes()
        {
            // Create the root shell item.
            ShellItem m_shDesktop = new ShellItem();

            // Create the root node.
            TreeNode tvwRoot = new TreeNode();
            tvwRoot.Text = m_shDesktop.DisplayName;
            tvwRoot.ImageIndex = m_shDesktop.IconIndex;
            tvwRoot.SelectedImageIndex = m_shDesktop.IconIndex;
            tvwRoot.Tag = m_shDesktop;

            // Now we need to add any children to the root node.
            ArrayList arrChildren = m_shDesktop.GetSubFolders();
            foreach (ShellItem shChild in arrChildren)
            {
                TreeNode tvwChild = new TreeNode();
                tvwChild.Text = shChild.DisplayName;
                tvwChild.ImageIndex = shChild.IconIndex;
                tvwChild.SelectedImageIndex = shChild.IconIndex;
                tvwChild.Tag = shChild;

                // If this is a folder item and has children then add a place holder node.
                if (shChild.IsFolder && shChild.HasSubFolder)
                    tvwChild.Nodes.Add("PH");
                tvwRoot.Nodes.Add(tvwChild);
            }

            // Add the root node to the tree.
            treeWnd.Nodes.Clear();
            treeWnd.Nodes.Add(tvwRoot);
            tvwRoot.Expand();
        }
Beispiel #18
0
        /// <summary>
        /// Displays the available areas in a tree view.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <returns></returns>
        public NodeId ShowDialog(Session session)
        {
            m_session = session;

            TreeNode root = new TreeNode(BrowseNames.Server);
            root.Nodes.Add(new TreeNode());
            BrowseTV.Nodes.Add(root);
            root.Expand();

            // display the dialog.
            if (ShowDialog() != DialogResult.OK)
            {
                return null;
            }

            // ensure selection is valid.
            if (BrowseTV.SelectedNode == null)
            {
                return null;
            }

            // get the selection.
            ReferenceDescription reference = (ReferenceDescription)BrowseTV.SelectedNode.Tag;

            if (reference == null)
            {
                return ObjectIds.Server;
            }

            // return the result.
            return (NodeId)reference.NodeId;
        }
Beispiel #19
0
        private static void GroupByHierarchy(IMetadataProvider provider, ConnectionInfo connection, TreeNode baseNode)
        {
            Entity baseEntity = baseNode != null ? baseNode.Tag as Entity : null;

            var entities = provider.Tables.Where(e => baseEntity == null ? e.BaseEntity == null : e.BaseEntity == baseEntity);

            if (entities.Any())
            {
                TreeNode[] childNodes = MakeEntityTreeNodes(provider, connection, entities.OrderBy(e => e.FullName));

                baseNode.Nodes.AddRange(childNodes);

                if (baseEntity != null)
                {
                    int countChilds = childNodes.Length;
                    baseNode.Text = string.Format("{0} ({1} derived entit{2})", baseNode.Text, countChilds, countChilds > 1 ? "ies" : "y");
                }

                foreach (var node in childNodes)
                {
                    GroupByHierarchy(provider, connection, node);
                }

                if (baseEntity == null)
                {
                    foreach (var node in childNodes)
                    {
                        node.Expand();
                    }
                    baseNode.Expand();
                }
            }
        }
 private TreeNode BindToSettings(object root)
 {
     TreeNode[] childNodes = this.GetChildNodes(root, "Options.");
     TreeNode node = new TreeNode(Loc.Get("<LOC>Options"), childNodes);
     node.Expand();
     return node;
 }
        public void CreateTreeViewRecursiveNew(TreeNode nodes, DataTable dataSource, DataTable dataAct, string parentId)
        {
            DataView dv = new DataView(dataSource);
            if (parentId == "0")
                dv.RowFilter = "parent_sub_project_id='0'";
            else
                dv.RowFilter = "parent_sub_project_id='" + parentId + "'";
            foreach (DataRowView dr in dv)
            {
                TreeNode node = new TreeNode();
                node.Text = dr["sub_project_id"].ToString() + " " + dr["description"].ToString();
                node.Tag = dr["sub_project_id"].ToString();
                node.Name = dr["description"].ToString();
                node.ImageIndex = 2;
                node.SelectedImageIndex = 2;
                nodes.Nodes.Add(node);
                DataView dv1 = new DataView(dataAct);
                dv1.RowFilter = "sub_project_id='" + dr["sub_project_id"].ToString() + "'";
                foreach (DataRowView act in dv1)
                {
                    TreeNode tn_act = new TreeNode();
                    tn_act.Name = "activity";
                    tn_act.Tag = act["activity_seq"].ToString();
                    tn_act.Text = act["activity_no"].ToString() + " " + act["description"].ToString();
                    tn_act.SelectedImageIndex = 4;
                    tn_act.ImageIndex = 4;
                    node.Nodes.Add(tn_act);
                }
                CreateTreeViewRecursiveNew(node, dataSource, dataAct, dr["sub_project_id"].ToString());

            }
            if (parentId == "0")
                nodes.Expand();
        }
Beispiel #22
0
        //绑定员工树
        private void BindEmployeeTree()
        {
            tvEmployee.Nodes.Clear();
            Organization rootOrg = oBll.GetOrganization(1);
            TreeNode root=new TreeNode();
            root.Text=rootOrg.OName;
            root.Tag=rootOrg.OId;
            root.ImageKey = "folder";
            root.SelectedImageKey = "folder";

            IList<Employee> lstEmployee = eBll.GetEmployeeByOrgId(rootOrg.OId);
            foreach (Employee e in lstEmployee)
            {
                TreeNode eNode = new TreeNode();
                eNode.Text = e.EName + "(" + e.Code + ")";
                eNode.Tag = "E_" + e.EId;
                eNode.ImageKey = "person";
                eNode.SelectedImageKey = "person";

                root.Nodes.Add(eNode);
            }

            root.Expand();
            CreateChildNode(ref root, rootOrg.OId);

            tvEmployee.Nodes.Add(root);
        }
Beispiel #23
0
            private System.Windows.Forms.TreeNode Add(System.Windows.Forms.TreeNode parent)
            {
                string strText = "Node" + NextNode++.ToString();

                System.Windows.Forms.TreeNode newnode;
                Microsoft.Web.UI.WebControls.TreeNodeCollection col;
                Microsoft.Web.UI.WebControls.TreeNode           webNode;

                if (parent == null)
                {
                    newnode = tvNodes.Nodes.Add(strText);
                    col     = tvWebNodes.Nodes;
                }
                else
                {
                    newnode = parent.Nodes.Add(strText);
                    parent.Expand();
                    col = ((Microsoft.Web.UI.WebControls.TreeNode)parent.Tag).Nodes;
                }

                webNode      = new Microsoft.Web.UI.WebControls.TreeNode();
                webNode.Text = strText;
                col.Add(webNode);
                newnode.Tag = webNode;

                btnApply.Enabled = true;

                return(newnode);
            }
        private void InitializeOutlookbar()
        {
            this.treeViewTask.Nodes.Clear();

            TreeNode nodeRoot = new TreeNode();
            nodeRoot.Text = "CSharpGoWinFormWinForm";
            nodeRoot.Tag = -1;
            this.treeViewTask.Nodes.Add(nodeRoot);

            foreach (string strModule in Frm_Main.m_dicFormText2FormTypeName.Keys)
            {
                TreeNode node = new TreeNode();
                node.Text = strModule;

                node.Tag = 0;
                node.ImageIndex = 0;
                nodeRoot.Nodes.Add(node);
                foreach (string strItem in Frm_Main.m_dicFormText2FormTypeName[strModule].Keys)
                {
                    TreeNode nodeChild = new TreeNode();
                    nodeChild.Text = strItem;

                    nodeChild.Tag = 1;
                    nodeChild.ImageIndex = 1;
                    node.Nodes.Add(nodeChild);

                }

            }

            this.treeViewTask.SelectedNode = this.treeViewTask.TopNode;
            nodeRoot.Expand();
        }
Beispiel #25
0
        public override void FillNodes()
        {
            base.FillNodes();
            AutoEventsEnabled = false;

            if (tree.Nodes.Count > 0)
            {
                if (tree.Nodes[0].Tag == null)
                {
                    return;
                }
            }
            System.Windows.Forms.TreeNode newroot = new System.Windows.Forms.TreeNode("E/P");

            while (tree.Nodes.Count > 0)
            {
                System.Windows.Forms.TreeNode X = tree.Nodes[0];
                //					TreeNode temp = new TreeNode("temporary");
                //					X.Nodes.Add(temp);
                //
                tree.Nodes.RemoveAt(0);
                if (X.Tag == null)
                {
                    continue;
                }
                newroot.Nodes.Add(X);
            }
            tree.Nodes.Add(newroot);
            newroot.Expand();
            AutoEventsEnabled = true;
        }
        public static void FillLinkNode(TreeNode linkNode)
        {
            linkNode.Nodes.Clear();

            KeyValuePair<string, int> pair = (KeyValuePair<string, int>)linkNode.Tag;

            ORM.DB_University.connection = DbProvider.GetConnection(pair.Key);

            if (ORM.DB_University.connection.State != ConnectionState.Open)
            {
                ORM.DB_University.connection.Open();
            }

            TreeNode linkedObject = FormNavigator.UObjectTotreeNode(ORM.DB_University.GetObjectById(pair.Value));

            linkNode.Nodes.Add(linkedObject);

            FormNavigator.FillNode(linkedObject);

            linkNode.Expand();

            ORM.DB_University.connection.Close();

            ORM.DB_University.RestorePrimaryConnection();
        }
Beispiel #27
0
 private void InitilizeTreeView()
 {
     TreeNode node3 = new TreeNode();
     node3.Name = "frameConfiguration";
     node3.Text ="pluginConfiguration";
     node3.Tag = new UCPluginConfig();
     this.treeView1.Nodes.Add(node3);
     //foreach (Plugin plugin in FrameContext.Instance.Plugins)
     //{
     //    try
     //    {
     //        if (plugin.IDTExtensibility is IOption)
     //        {
     //            if (!plugin.Enable)
     //            {
     //                continue;
     //            }
     //            IOption iDTExtensibility = plugin.IDTExtensibility as IOption;
     //            node3.Nodes.Add(iDTExtensibility.GetNode());
     //        }
     //    }
     //    catch
     //    {
     //    }
     //}
     node3.Expand();
 }
 public static TreeNode GetNextLeafNode(TreeNode n)
 {
     if (n == null)
     {
         return null;
     }
     if (n.FirstNode == null)
     {
         if (n.NextNode == null)
         {
             while (n.NextNode == null)
             {
                 n = n.Parent;
                 if (n == null)
                 {
                     return null;
                 }
             }
             n = n.NextNode;
         }
         else
         {
             return n.NextNode;
         }
     }
     while (n.FirstNode != null)
     {
         n.Expand();
         n = n.FirstNode;
     }
     return n;
 }
        private void cbConnectionStrings_SelectedIndexChanged(object sender, EventArgs e)
        {
            tvDatabase.Nodes.Clear();

            ConnectionStringSettings css = ConfigurationManager.ConnectionStrings[cbConnectionStrings.SelectedItem.ToString()];
            dbSchema = DbSchemaFactory.Create(css.Name);
            DbSchemaHelper.Instance.CurrentSchema = dbSchema;

            TreeNode root = new TreeNode(css.Name, 0, 0);
            root.ToolTipText = css.ConnectionString;
            tvDatabase.Nodes.Add(root);

            Main m = this.ParentForm as Main;
            m.ClearDbList();

            this.Cursor = Cursors.WaitCursor;
            IList<SODatabase> dbList = dbSchema.GetDatabaseList();
            this.Cursor = Cursors.Default;

            foreach (SODatabase db in dbList)
            {
                TreeNode dbNode = new TreeNode(db.Name, 1, 1);
                dbNode.Tag = db;
                dbNode.ToolTipText = string.IsNullOrEmpty(db.Comment) ? db.Name : db.Comment;
                dbNode.ContextMenuStrip = cmsDatabase;
                root.Nodes.Add(dbNode);

                MainForm.AddDbListItem(db);
            }

            root.Expand();
        }
Beispiel #30
0
        void PerformPopulateNodes(System.Windows.Forms.TreeNodeCollection nodes, ITreeStore item)
        {
            nodes.Clear();
            var count = item.Count;

            for (int i = 0; i < count; i++)
            {
                var child = item[i];
                var node  = new swf.TreeNode
                {
                    Text = child.Text,
                    Name = child.Key,
                    Tag  = child,
                };
                SetImage(child, node);

                if (child.Expandable)
                {
                    if (child.Expanded)
                    {
                        PerformPopulateNodes(node.Nodes, child);
                        node.Expand();
                    }
                    else
                    {
                        node.Nodes.Add(EmptyName, string.Empty);
                    }
                }

                nodes.Add(node);
            }
        }
Beispiel #31
0
 private void BrowseServers(System.Windows.Forms.TreeNode node)
 {
     try
     {
         node.Nodes.Clear();
         string host = null;
         if (node != this.m_localServers)
         {
             host = node.Text;
         }
         ConnectData  connectData      = this.FindConnectData(node);
         Opc.Server[] availableServers = this.m_discovery.GetAvailableServers(this.m_specification, host, connectData);
         if (availableServers != null)
         {
             Opc.Server[] array = availableServers;
             for (int i = 0; i < array.Length; i++)
             {
                 Opc.Da.Server server = (Opc.Da.Server)array[i];
                 System.Windows.Forms.TreeNode treeNode = new System.Windows.Forms.TreeNode(server.Name);
                 treeNode.ImageIndex = (treeNode.SelectedImageIndex = Resources.IMAGE_LOCAL_SERVER);
                 treeNode.Tag        = server;
                 node.Nodes.Add(treeNode);
             }
             node.Expand();
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
 public void Show(TreeView treeView)
 {
     TreeNode rootNode = new TreeNode("Tags");
     ShowTreeView(rootNode, tagsStorage);
     rootNode.Expand();
     treeView.Nodes.Add(rootNode);
 }
Beispiel #33
0
 private void BrowseNetwork(System.Windows.Forms.TreeNode node)
 {
     try
     {
         node.Nodes.Clear();
         string[] array = this.m_discovery.EnumerateHosts();
         if (array != null)
         {
             string[] array2 = array;
             for (int i = 0; i < array2.Length; i++)
             {
                 string text = array2[i];
                 System.Windows.Forms.TreeNode treeNode = new System.Windows.Forms.TreeNode(text);
                 treeNode.ImageIndex = (treeNode.SelectedImageIndex = Resources.IMAGE_LOCAL_COMPUTER);
                 treeNode.Tag        = null;
                 treeNode.Nodes.Add(new System.Windows.Forms.TreeNode());
                 node.Nodes.Add(treeNode);
             }
             node.Expand();
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Beispiel #34
0
        public static void ProcessNormalizedTracesAndDisplayResults(TreeView tvProcessedNormalizedTraces,
                                                                    TreeView tvNormalizedTracesView)
        {
            tvProcessedNormalizedTraces.Nodes.Clear();
            var normalizedTracesView = new List<TreeNode>();
            foreach (TreeNode node in tvNormalizedTracesView.Nodes)
                normalizedTracesView.Add(node);
 
            // calculate all unique traces
            List<TreeNode> ltnTraces = analyzer.getListOfNormalizedTraces(normalizedTracesView);


            // and show them indexed by Source and by Sink
            // calculate Sources
            var tnSources = new TreeNode("Sources");
            foreach (TreeNode tnTrace in ltnTraces)
            {
                String sFunction = tnTrace.Text;
                if (sFunction != "")
                {
                    if (tnSources.Nodes[sFunction] == null)
                    {
                        TreeNode tnSourceNode = O2Forms.newTreeNode(sFunction, sFunction, 0, null);
                        tnSourceNode.ForeColor = Color.DarkRed; // Source
                        tnSources.Nodes.Add(tnSourceNode);
                    }
                    if (tnTrace.Nodes.Count > 0)
                        tnSources.Nodes[sFunction].Nodes.Add((TreeNode) tnTrace.Nodes[0].Clone());
                    else
                        tnSources.Nodes[sFunction].Nodes.Add((TreeNode) tnTrace.Clone());
                }
            }
            tnSources.Expand();
            tvProcessedNormalizedTraces.Nodes.Add(tnSources);
            // calculate Sinks
            var tnSinks = new TreeNode("Sinks");
            foreach (TreeNode tnTrace in ltnTraces)
            {
                String sFunction = getChildNode_AlwaysFollowingFirstChild(tnTrace).Text;
                if (sFunction != "")
                {
                    if (tnSinks.Nodes[sFunction] == null)
                    {
                        TreeNode tnSourceNode = O2Forms.newTreeNode(sFunction, sFunction, 0, null);
                        tnSourceNode.ForeColor = Color.Red; // Source
                        tnSinks.Nodes.Add(tnSourceNode);
                    }
                    //if (tnTrace.Nodes.Count > 0)
                    //    tnSinks.Nodes[sFunction].Nodes.Add((TreeNode)tnTrace.Nodes[0].Clone());
                    //else
                    tnSinks.Nodes[sFunction].Nodes.Add((TreeNode) tnTrace.Clone());
                }
            }
            tnSinks.Expand();
            tvProcessedNormalizedTraces.Nodes.Add(tnSinks);

            //tvProcessedNormalizedTraces.Nodes.AddRange(ltnTraces.ToArray());
            //tvProcessedNormalizedTraces.ExpandAll();
        }
 public void AddResults(SearchResults results)
 {
     TreeNode node = new TreeNode(results.ToString());
     AppendChildren(node, results.GetChildren());
     node.Tag = results;
     node.Expand();
     treeFiles.Nodes[0].Nodes.Add(node);
 }
Beispiel #36
0
        private void mLoadMonthTree(string pYear)
        {
            string   strMonthType = "";
            string   strDate      = "";
            DateTime dteDate;

            System.Windows.Forms.TreeNode oNodex = null;
            int i = 0;

            //string strSelection;
            ////strSelection = tvNode.SelectedNode.Text;
            this.tvNode.Nodes.Clear();
            tvNode.ImageList = imageList1;
            for (int intNode = 1; intNode <= 12; intNode++)
            {
                string strMonthName = GetMonth(intNode);
                oNodex            = tvNode.Nodes.Add(mcGROUP_PREFIX + strMonthName, strMonthName, "");
                oNodex.ImageIndex = 0;
                oNodex.Expand();
            }

            List <Batch> oogrp    = invms.mDisPlaybatch(strComID, 0, "", "", "", "", pYear, "").ToList();
            List <Batch> oogrpnew = invms.mDisPlaybatchYear(strComID, pYear).ToList();

            foreach (Batch inv in oogrpnew)
            {
                int intMonth = Convert.ToDateTime(inv.strStartDate).Month;
                strMonthType = GetMonth(intMonth);
                if (strDate != inv.strStartDate)
                {
                    oNodex            = tvNode.Nodes.Find(mcGROUP_PREFIX + strMonthType, true)[0].Nodes.Add(mcGROUP_PREFIX + inv.strStartDate, inv.strStartDate, "closed");
                    dteDate           = Convert.ToDateTime(inv.strStartDate);
                    strDate           = inv.strStartDate;
                    oNodex.ImageIndex = 0;
                }
                oNodex.Expand();
            }

            foreach (Batch inv in oogrp)
            {
                oNodex                    = tvNode.Nodes.Find(mcGROUP_PREFIX + inv.strStartDate, true)[0].Nodes.Add(mcGROUP_PREFIX + inv.strLogNo, inv.strLogNo, "closed");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.Expand();
            }
        }
Beispiel #37
0
 private void PdmExplorer_Load(object sender, EventArgs e)
 {
     TreeNode root = new TreeNode("PDM文件列表", 0, 0);
     root.ContextMenuStrip = cms;
     tv.Nodes.Add(root);
     root.Expand();
     LoadFileNodes();
 }
Beispiel #38
0
 public void MakeTextureTree()
 {
     treeView5.Nodes.Clear();
     TreeNode t = new TreeNode("Textures");
     foreach (DBAccess.TextureInformation ti in ttlist)
         t = AddPath(t, ti.name);
     t.Expand();
     treeView5.Nodes.Add(t);
 }
Beispiel #39
0
 private void ExpandAllNamespaces(TreeNode node)
 {
     if (IsNamespace(node))
     {
         node.Expand();
         foreach(TreeNode n in node.Nodes)
             ExpandAllNamespaces(n);
     }
 }
Beispiel #40
0
 public void MakeMeshTree()
 {
     treeView5.Nodes.Clear();
     TreeNode t = new TreeNode();
     foreach (DBAccess.RESInformation ti in ttlist)
         t = AddPath(t, ti.resname);
     t.Expand();
     treeView5.Nodes.Add(t);
 }
Beispiel #41
0
        /// <summary>
        /// Fills data points name tree.
        /// </summary>
        private void FillTree()
        {
            bool nodeSelected = false;

            this.BeginUpdate();

            // Add "None" option
            System.Windows.Forms.TreeNode noPoint = this.Nodes.Add(Constants.NotSetValue);

            // Get chart object
            if (this.annotation != null &&
                annotation.GetAnnotationGroup() == null &&
                this.annotation.Chart != null)
            {
                Chart chart = this.annotation.Chart;

                // Loop through all series
                foreach (Series series in chart.Series)
                {
                    System.Windows.Forms.TreeNode seriesNode = this.Nodes.Add(series.Name);
                    seriesNode.Tag = series;

                    // Indicate that there are no points in series
                    if (series.Points.Count == 0)
                    {
                        System.Windows.Forms.TreeNode noPointNode = seriesNode.Nodes.Add("(empty)");
                    }

                    // Loop through all points
                    int index = 1;
                    foreach (DataPoint point in series.Points)
                    {
                        System.Windows.Forms.TreeNode dataPointNode = seriesNode.Nodes.Add("DataPoint" + index.ToString(CultureInfo.InvariantCulture));
                        dataPointNode.Tag = point;
                        ++index;

                        // Check if this node should be selected
                        if (point == dataPoint)
                        {
                            seriesNode.Expand();
                            this.SelectedNode = dataPointNode;
                            nodeSelected      = true;
                        }
                    }
                }
            }

            // Select default node
            if (!nodeSelected)
            {
                this.SelectedNode = noPoint;
            }

            this.EndUpdate();
        }
Beispiel #42
0
 private System.Windows.Forms.TreeNode WebNodeToFormNode(Microsoft.Web.UI.WebControls.TreeNode webNode)
 {
     System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode();
     node.Text = webNode.Text;
     node.Tag  = webNode;
     node.Expand();
     for (int i = 0; i < webNode.Nodes.Count; i++)
     {
         node.Nodes.Add(WebNodeToFormNode(webNode.Nodes[i]));
     }
     return(node);
 }
Beispiel #43
0
        public bool ExpandANode(CShItem newItem)
        {
            bool returnValue;

            returnValue = false;             //assume failure
            System.Windows.Forms.TreeNode baseNode = Root;
            tv1.BeginUpdate();
            baseNode.Expand();             //Ensure base is filled in
            //do the drill down -- Node to expand must be included in tree
            TreeNode testNode;
            int      lim = CShItem.PidlCount(newItem.PIDL) - CShItem.PidlCount((baseNode.Tag as CShItem).PIDL);

            //TODO: Test ExpandARow again on XP to ensure that the CP problem ix fixed
            while (lim > 0)
            {
                foreach (TreeNode tempLoopVar_testNode in baseNode.Nodes)
                {
                    testNode = tempLoopVar_testNode;
                    if (CShItem.IsAncestorOf(testNode.Tag as CShItem, newItem, false))
                    {
                        baseNode = testNode;
                        RefreshNode(baseNode);                         //ensure up-to-date
                        baseNode.Expand();
                        lim--;
                        goto NEXLEV;
                    }
                }
                goto XIT;                 //on falling thru For, we can't find it, so get out
NEXLEV:
                1.GetHashCode();          //nop
            }
            //after falling thru here, we have found & expanded the node
            this.tv1.HideSelection = false;
            this.Select();
            this.tv1.SelectedNode = baseNode;
            returnValue           = true;
XIT:
            tv1.EndUpdate();
            return(returnValue);
        }
Beispiel #44
0
        private void CreateListView()
        {
            m_hMainTreeView.Nodes.Clear();

            // ---------------------- start: General node ----------------------
            General cPanleGeneral = new General(m_options.options);

            System.Windows.Forms.TreeNode hNodeLanguage = new System.Windows.Forms.TreeNode();
            hNodeLanguage.Name = "General";
            hNodeLanguage.Text = "General";
            hNodeLanguage.Tag  = cPanleGeneral;

            cPanleGeneral.Name    = hNodeLanguage.Name;
            cPanleGeneral.Tag     = hNodeLanguage;
            cPanleGeneral.Action += new EventHandler(IconState);
            IconState(cPanleGeneral, null);

            // ------------------------ end: General node ----------------------

            // ---------------------- start: Code beautiful parameter node ----------------------
            Applications hPanelCodeBeautiful = new Applications(m_options.options);

            if (m_infoPanel != null)
            {
                (hPanelCodeBeautiful.Controls["panelInfo"] as Panel).Controls.Add(m_infoPanel);
            }
            System.Windows.Forms.TreeNode hCodeBeatifulNode = new System.Windows.Forms.TreeNode();
            hCodeBeatifulNode.Name    = "CodeBeatiful";
            hCodeBeatifulNode.Text    = "CodeBeatiful";
            hCodeBeatifulNode.Checked = true;
            hCodeBeatifulNode.Tag     = hPanelCodeBeautiful;

            hPanelCodeBeautiful.Remove += new EventHandler(OnNodeRemove);
            hPanelCodeBeautiful.Add    += new EventHandler(OnNodeAdd);
            hPanelCodeBeautiful.Action += new EventHandler(IconState);
            hPanelCodeBeautiful.Tag     = hCodeBeatifulNode;
            IconState(hPanelCodeBeautiful, null);

            m_hMainTreeView.Nodes.Add(hNodeLanguage);
            m_hMainTreeView.Nodes.Add(hCodeBeatifulNode);

            foreach (AppOptions app in m_options.options.AppList)
            {
                OnNodeAdd(app, null);
            }

            // ------------------------ end: Code beautiful parameter node ----------------------
            hCodeBeatifulNode.Expand();
            m_hMainTreeView.Sort();
            m_hMainTreeView.ShowNodeToolTips = true;
            m_hMainTreeView.SelectedNode     = m_hMainTreeView.Nodes[0];
        }
Beispiel #45
0
        /// <summary>
        /// 展开到指定的节点
        /// </summary>
        /// <param name="node"></param>
        public static void ExpandToNode(System.Windows.Forms.TreeNode node)
        {
            if (node == null)
            {
                return;
            }
            node.Expand();
            var parent = node.Parent;

            while (parent != null)
            {
                parent.Expand();
                parent = parent.Parent;
            }
        }
Beispiel #46
0
 private void OnAddChildButtonClick()
 {
     this.ValidatePropertyGrid();
     System.Windows.Forms.TreeNode selectedNode = this._treeView.SelectedNode;
     if (selectedNode != null)
     {
         MenuItemContainer node = new MenuItemContainer();
         selectedNode.Nodes.Add(node);
         string str = System.Design.SR.GetString("MenuItemCollectionEditor_NewNodeText");
         node.Text             = str;
         node.WebMenuItem.Text = str;
         selectedNode.Expand();
         this._treeView.SelectedNode = node;
     }
 }
Beispiel #47
0
        public void LeftTree_Refresh(IList <string> ls)
        {
            LeftTree_Clear();

            foreach (var db in ls)
            {
                var nodeDB = rootNode.Nodes.Add(db);
                nodeDB.ImageIndex         = IMG_IND_DB;
                nodeDB.SelectedImageIndex = IMG_IND_CUR;
                var nodeTab = nodeDB.Nodes.Add(MyRes.TXT_ALL_TABLE);
                nodeTab.ImageIndex         = IMG_IND_TAB;
                nodeTab.SelectedImageIndex = IMG_IND_CUR;
                nodeTab.Nodes.Add(STR_QUERYING);
            }
            rootNode.Expand();
        }
Beispiel #48
0
 private void OnAddChildButtonClick()
 {
     System.Windows.Forms.TreeNode selectedNode = this._treeView.SelectedNode;
     if (selectedNode != null)
     {
         TreeNodeContainer node = new TreeNodeContainer();
         selectedNode.Nodes.Add(node);
         string str = System.Design.SR.GetString("TreeNodeCollectionEditor_NewNodeText");
         node.Text             = str;
         node.WebTreeNode.Text = str;
         if (!selectedNode.IsExpanded)
         {
             selectedNode.Expand();
         }
         this._treeView.SelectedNode = node;
     }
 }
Beispiel #49
0
        private void mAddItemSales(string vstrRoot)
        {
            string strChild = "";

            System.Windows.Forms.TreeNode oNodex  = null;
            List <AccountsLedger>         oaccLed = accms.GetSalesLedgerTreefromCustomer(strComID, vstrRoot).ToList();

            foreach (AccountsLedger oLed in oaccLed)
            {
                strChild                  = oLed.strLedgerName;
                oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + vstrRoot, true)[0].Nodes.Add(mcLEDGER_PREFIX + strChild, strChild, "leaf");
                oNodex.ImageIndex         = 1;
                oNodex.SelectedImageIndex = 1;
                oNodex.EnsureVisible();
                oNodex.ExpandAll();
                oNodex.Expand();
            }
        }
 private void ExpandNodes(string node_text)
 {
     foreach (object obj in nodelist)
     {
         System.Windows.Forms.TreeNode tn = (System.Windows.Forms.TreeNode)obj;
         if (tn.Text.ToUpper().Contains(node_text.ToUpper()))
         {
             tn.BackColor = System.Drawing.Color.Yellow;
             System.Windows.Forms.TreeNode ptn = tn.Parent;
             while (ptn.Text != "Top Node")
             {
                 ptn.Expand();
                 ptn = ptn.Parent;
             }
         }
     }
     treeView1.Nodes[0].Expand();
 }
        private void PopulateBlock(TreeNode Node, Block Block)
        {
            if (Block.Elements.Count == 0)
            {
                Node.Text += "<Empty block>";
            }
            else
            {
                TreeNodeCollection nds = Node.Nodes;

                foreach (Element el in Block.Elements)
                {
                    PopulateElement(el, nds);
                }

                Node.Expand();
            }
        }
Beispiel #52
0
 private void GetProperties(System.Windows.Forms.TreeNode node)
 {
     try
     {
         Opc.Da.Server server        = this.FindServer(node);
         BrowseElement browseElement = null;
         if (node.Tag != null && node.Tag.GetType() == typeof(BrowseElement))
         {
             browseElement = (BrowseElement)node.Tag;
         }
         if (browseElement.IsItem)
         {
             node.Nodes.Clear();
             ItemIdentifier           itemIdentifier = new ItemIdentifier(browseElement.ItemPath, browseElement.ItemName);
             ItemPropertyCollection[] properties     = server.GetProperties(new ItemIdentifier[]
             {
                 itemIdentifier
             }, this.m_filters.PropertyIDs, this.m_filters.ReturnPropertyValues);
             if (properties != null)
             {
                 ItemPropertyCollection[] array = properties;
                 for (int i = 0; i < array.Length; i++)
                 {
                     ItemPropertyCollection itemPropertyCollection = array[i];
                     foreach (ItemProperty property in itemPropertyCollection)
                     {
                         this.AddItemProperty(node, property);
                     }
                     browseElement.Properties = (ItemProperty[])itemPropertyCollection.ToArray(typeof(ItemProperty));
                 }
             }
             node.Expand();
             if (this.ElementSelected != null)
             {
                 this.ElementSelected(browseElement);
             }
         }
     }
     catch (System.Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Beispiel #53
0
        public static void ExpandNodes(System.Windows.Forms.TreeNode Nodes, TreeNode tn)
        {
            if (Nodes != null && Nodes.Nodes != null && Nodes.Nodes.Count > 0)
            {
                //Nodes = Nodes.Nodes[0];
                for (int i = 0; i < Nodes.Nodes.Count; i++)
                {
                    System.Windows.Forms.TreeNode checknode = Nodes.Nodes[i];

                    if (tn != null && tn.Expanded == true)
                    {
                        Nodes.Expand();                                     //checknode
                    }
                    //tn.GetChildNode(checknode.Text).Expanded = true;
                    if (tn != null && tn.GetChildNode(checknode.Text) != null)
                    {
                        ExpandNodes(checknode, tn.GetChildNode(checknode.Text));
                    }
                }
            }
        }
        public virtual void PerformChildSiblingButtonClickEventOperations()
        {
            var selectedIndex = TreeViewMenu.SelectedNode.Index;
            var selectedNode  = (WinForms.TreeNode)TreeViewMenu.SelectedNode.Clone();

            if (TreeViewMenu.SelectedNode.Parent == null)
            {
                WinForms.TreeNode previousNode = TreeViewMenu.Nodes[selectedIndex - 1];
                previousNode.Nodes.Add(selectedNode);
                previousNode.Expand();
                TreeViewMenu.Nodes.RemoveAt(selectedIndex);
            }
            else
            {
                WinForms.TreeNode previousNode = TreeViewMenu.SelectedNode.Parent.Nodes[selectedIndex - 1];
                previousNode.Nodes.Add(selectedNode);
                previousNode.Expand();
                TreeViewMenu.SelectedNode.Parent.Nodes.RemoveAt(selectedIndex);
            }

            TreeViewMenu.SelectedNode = selectedNode;
            TreeViewMenu.Focus();
        }
Beispiel #55
0
        ///<Summary>Given a CShItem, find the TreeNode that belongs to the
        /// equivalent (matching PIDL) CShItem's most immediate surviving ancestor.
        ///  Note: referential comparison might not work since there is no guarantee
        /// that the exact same CShItem is stored in the tree.</Summary>
        ///<returns> Me.Root if not found, otherwise the Treenode whose .Tag is
        /// equivalent to the input CShItem's most immediate surviving ancestor </returns>
        private TreeNode FindAncestorNode(CShItem CSI)
        {
            TreeNode returnValue;

            returnValue = null;
            if (!CSI.IsFolder)
            {
                return(returnValue);                //only folders in tree
            }
            System.Windows.Forms.TreeNode baseNode = Root;
            //Dim cp As cPidl = CSI.clsPidl     'the cPidl rep of the PIDL to be found
            TreeNode testNode;
            int      lim = ExpTreeLib.CShItem.PidlCount(CSI.PIDL) - ExpTreeLib.CShItem.PidlCount((baseNode.Tag as CShItem).PIDL);

            while (lim > 1)
            {
                foreach (TreeNode tempLoopVar_testNode in baseNode.Nodes)
                {
                    testNode = tempLoopVar_testNode;
                    if (CShItem.IsAncestorOf(testNode.Tag as CShItem, CSI, false))
                    {
                        baseNode = testNode;
                        baseNode.Expand();
                        lim--;
                        goto NEXTLEV;
                    }
                }
                //CSI's Ancestor may have moved or been deleted, return the last one
                // found (if none, will return Me.Root)
                return(baseNode);

NEXTLEV:
                1.GetHashCode();                  //nop
            }
            //on fall thru, we have it
            return(baseNode);
        }
Beispiel #56
0
        private void LoadBasicTree(string xml)
        {
            this.progressBar1.Value = 0;

            this.IncrementBar();
            treeView2.Nodes.Clear();
            Application.DoEvents();
            this.IncrementBar();
            Application.DoEvents();

            this.IncrementBar();
            Application.DoEvents();
            System.Xml.XmlDocument x = new System.Xml.XmlDocument();
            try
            {
                x.LoadXml(xml);
            }
            catch (Exception xexc)
            {
                Terminals.Logging.Error("Load Basic Tree Failed", xexc);
            }

            System.Xml.XmlNode            n    = x.SelectSingleNode("/tree");
            System.Windows.Forms.TreeNode root = new System.Windows.Forms.TreeNode();
            this.treeView2.Nodes.Add(root);
            Application.DoEvents();

            this.LoadNode(n, root);

            root.Expand();
            if (root.Nodes != null && root.Nodes.Count > 0)
            {
                root.Nodes[0].Expand();
            }

            this.progressBar1.Value = 0;
        }
Beispiel #57
0
        private void RefreshNodes()
        {
            treeProject.BeginUpdate();
            NodeRoot.Nodes.Clear();

            IList <Types.SymbolInfo> sortedTokens = null;

            // sort by line number
            if (Core.Settings.OutlineSortByIndex)
            {
                GR.Collections.MultiMap <int, Types.SymbolInfo> sortedTokensInner = new GR.Collections.MultiMap <int, C64Studio.Types.SymbolInfo>();
                foreach (KeyValuePair <string, Types.SymbolInfo> token in OutlineTokens)
                {
                    if (!string.IsNullOrEmpty(Core.Settings.OutlineFilter))
                    {
                        if (token.Key.ToUpper().Contains(Core.Settings.OutlineFilter.ToUpper()))
                        {
                            sortedTokensInner.Add(token.Value.LineIndex, token.Value);
                        }
                    }
                    else
                    {
                        sortedTokensInner.Add(token.Value.LineIndex, token.Value);
                    }
                }
                sortedTokens = sortedTokensInner.Values;
            }
            else
            {
                GR.Collections.MultiMap <string, Types.SymbolInfo> sortedTokensInner = new GR.Collections.MultiMap <string, C64Studio.Types.SymbolInfo>();
                foreach (KeyValuePair <string, Types.SymbolInfo> token in OutlineTokens)
                {
                    if (!string.IsNullOrEmpty(Core.Settings.OutlineFilter))
                    {
                        if (token.Key.ToUpper().Contains(Core.Settings.OutlineFilter.ToUpper()))
                        {
                            sortedTokensInner.Add(token.Key.ToUpper(), token.Value);
                        }
                    }
                    else
                    {
                        sortedTokensInner.Add(token.Key.ToUpper(), token.Value);
                    }
                }
                sortedTokens = sortedTokensInner.Values;
            }

            string curZone = "";

            System.Windows.Forms.TreeNode parentNode = new System.Windows.Forms.TreeNode();
            parentNode            = new System.Windows.Forms.TreeNode();
            parentNode.Text       = "Global Zone";
            parentNode.ImageIndex = parentNode.SelectedImageIndex = 0;
            NodeRoot.Nodes.Add(parentNode);
            System.Windows.Forms.TreeNode globalZone = parentNode;

            Dictionary <string, TreeNode> zoneNodes = new Dictionary <string, TreeNode>();

            zoneNodes.Add(parentNode.Text, globalZone);

            // add zone nodes first
            foreach (var token in sortedTokens)
            {
                if (token.Type == C64Studio.Types.SymbolInfo.Types.ZONE)
                {
                    System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode();

                    node.Text = token.Name;
                    node.Tag  = token;

                    parentNode            = new System.Windows.Forms.TreeNode();
                    parentNode.Text       = token.Zone;
                    parentNode.ImageIndex = parentNode.SelectedImageIndex = 0;
                    NodeRoot.Nodes.Add(parentNode);
                    parentNode.Tag = token;

                    zoneNodes.Add(parentNode.Text, parentNode);
                }
            }

            // now add child nodes
            parentNode = globalZone;
            foreach (var token in sortedTokens)
            {
                if (token.Type == C64Studio.Types.SymbolInfo.Types.ZONE)
                {
                    curZone    = token.Zone;
                    parentNode = zoneNodes[token.Zone];
                    continue;
                }

                System.Windows.Forms.TreeNode node = new System.Windows.Forms.TreeNode();
                bool addNode = true;

                node.Text = token.Name;
                node.Tag  = token;

                switch (token.Type)
                {
                case C64Studio.Types.SymbolInfo.Types.CONSTANT_1:
                case C64Studio.Types.SymbolInfo.Types.CONSTANT_2:
                    node.ImageIndex = node.SelectedImageIndex = 2;
                    node.Text      += " = $" + token.AddressOrValue.ToString("X4");
                    break;

                case C64Studio.Types.SymbolInfo.Types.LABEL:
                    if ((token.Name.Contains(".")) &&
                        (!Core.Settings.OutlineShowLocalLabels))
                    {
                        addNode = false;
                    }
                    if ((token.Name.StartsWith(C64Studio.Parser.ASMFileParser.InternalLabelPrefix)) &&
                        (!Core.Settings.OutlineShowShortCutLabels))
                    {
                        addNode = false;
                    }
                    node.ImageIndex = node.SelectedImageIndex = 1;
                    node.Text      += " = $" + token.AddressOrValue.ToString("X4");
                    break;

                case C64Studio.Types.SymbolInfo.Types.PREPROCESSOR_LABEL:
                case C64Studio.Types.SymbolInfo.Types.PREPROCESSOR_CONSTANT_1:
                case C64Studio.Types.SymbolInfo.Types.PREPROCESSOR_CONSTANT_2:
                    node.ImageIndex = node.SelectedImageIndex = 3;
                    node.Text      += " = $" + token.AddressOrValue.ToString("X4");
                    break;

                case C64Studio.Types.SymbolInfo.Types.UNKNOWN:
                    break;
                }

                if (!addNode)
                {
                    continue;
                }

                // cut off zone
                try
                {
                    // find parent node
                    if ((string.IsNullOrEmpty(token.Zone)) ||
                        (!zoneNodes.ContainsKey(token.Zone)))
                    {
                        globalZone.Nodes.Add(node);
                    }
                    else
                    //if ( curZone.Length > 0 )
                    {
                        var parentZoneNode = zoneNodes[token.Zone];

                        int    dotPos         = node.Text.IndexOf('.');
                        string nodeParentText = parentZoneNode.Text;
                        if (dotPos != -1)
                        {
                            node.Text = node.Text.Substring(dotPos);
                        }
                        parentZoneNode.Nodes.Add(node);

                        if ((_ExpandedNodes.ContainsKey(nodeParentText)) &&
                            (_ExpandedNodes[nodeParentText]))
                        {
                            parentZoneNode.Expand();
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.Log(ex.Message);
                }
            }
            NodeRoot.Expand();
            treeProject.EndUpdate();
        }
Beispiel #58
0
        private int ExpandNode(System.Windows.Forms.TreeNode objParent, FolderNode fNode)
        {
            int numSubfolders = 0;

            // Don't waste time expanding the same node twice...
            if (fNode.Expanded)
            {
                return(0);
            }

            // Properties to exclude in the query results
            string strFolderId = fNode.Id;

            string[] strExclude = new string[5];
            strExclude[0] = "DateCreated";
            strExclude[1] = "DateLastModified";

            // Comment out stuff that gets us in trouble when recursion is enabled
            strExclude[2] = "ObjectStore";
            strExclude[3] = "ClassDescription";
            strExclude[4] = "Parent";

            // Get the folder's Subfolders list object
            CEWSI.ObjectRequestType   objSubFoldersRequest = new CEWSI.ObjectRequestType();
            CEWSI.ObjectSpecification objSubFoldersSpec    = new CEWSI.ObjectSpecification();
            objSubFoldersSpec.classId                = "Folder";
            objSubFoldersSpec.objectId               = strFolderId;
            objSubFoldersSpec.objectStore            = MainForm.Library;
            objSubFoldersSpec.propertyId             = "SubFolders";
            objSubFoldersRequest.SourceSpecification = objSubFoldersSpec;
            objSubFoldersRequest.id             = "1";
            objSubFoldersRequest.PropertyFilter = new CEWSI.PropertyFilterType();
            objSubFoldersRequest.PropertyFilter.ExcludeProperties = strExclude;
            //objSubFoldersRequest.PropertyFilter.maxRecursion = 3;
            //objSubFoldersRequest.PropertyFilter.maxRecursionSpecified = true;
            //objSubFoldersRequest.maxElements = 2;
            //objSubFoldersRequest.maxElementsSpecified = true;

            // Get the folder itself
            //CEWSI.ObjectRequestType objFolderRequest = new CEWSI.ObjectRequestType();
            //CEWSI.ObjectSpecification objFolderSpec = new CEWSI.ObjectSpecification();
            //objFolderSpec.classId = "Folder";
            //objFolderSpec.objectId = strFolderId;
            //objFolderSpec.objectStore = MainForm.Library;
            //objFolderRequest.SourceSpecification = objFolderSpec;
            //objFolderRequest.id = "3";
            //objFolderRequest.PropertyFilter = new CEWSI.PropertyFilterType();
            //objFolderRequest.PropertyFilter.ExcludeProperties = strExclude;

            // Create the request array
            CEWSI.ObjectRequestType[] objRequestArray = new CEWSI.ObjectRequestType[1];
            objRequestArray[0] = objSubFoldersRequest;

            // Fill in the security headers...
            CEWSI.FNCEWS40PortTypeClient objBinding = WSIUtil.ConfigureBinding(MainForm.User,
                                                                               MainForm.Domain, MainForm.Password, MainForm.URL);

            // Send off the request
            CEWSI.ObjectResponseType[] objResponses = null;
            try
            {
                objResponses = objBinding.GetObjects(WSIUtil.GetLocalization(), objRequestArray);
            }
            catch (System.Net.WebException ex)
            {
                MessageBox.Show("An exception occurred while querying for a folder: [" + ex.Message + "]");
                return(0);
            }

            // Get the nodes below the parent
            if (objResponses.Length > 0 && objResponses[0].id == "1")
            {
                if (objResponses[0].GetType() == typeof(CEWSI.ErrorStackResponse))
                {
                    CEWSI.ErrorStackResponse objErrResponse = (CEWSI.ErrorStackResponse)objResponses[0];
                    CEWSI.ErrorStackType     objStack       = objErrResponse.ErrorStack;
                    CEWSI.ErrorRecordType    objErr         = objStack.ErrorRecord[0];
                    MessageBox.Show("Error [" + objErr.Description + "] occurred. " +
                                    " Err source is [" + objErr.Source + "]");
                    return(0);
                }

                CEWSI.ObjectSetResponse objSetResponse = (CEWSI.ObjectSetResponse)objResponses[0];
                CEWSI.ObjectSetType     objSet         = objSetResponse.ObjectSet;
                if (objSet.Object != null && objSet.Object.Length > 0)
                {
                    foreach (CEWSI.ObjectValue objValue in (CEWSI.ObjectValue[])objSet.Object)
                    {
                        numSubfolders += 1;
                        System.Windows.Forms.TreeNode objNode = new System.Windows.Forms.TreeNode();
                        FolderNode newNode = new FolderNode();
                        foreach (CEWSI.PropertyType objProp in objValue.Property)
                        {
                            if (objProp.propertyId == "FolderName")
                            {
                                string strName = ((CEWSI.SingletonString)objProp).Value;
                                objNode.Text = strName;
                                newNode.Name = strName;
                            }
                            if (objProp.propertyId == "Id")
                            {
                                string strId = ((CEWSI.SingletonId)objProp).Value;
                                newNode.Id = strId;
                            }
                        }
                        objNode.Tag = (object)newNode;
                        objParent.Nodes.Add(objNode);
                    }
                }
            }
            objParent.Expand();
            fNode.Expanded = true;
            return(numSubfolders);
        }
Beispiel #59
0
        private void mloadTreeView(int intSttsus)
        {
            string strGroup;


            if (strType != "S" && strType != "M" && strType != "C" & strType != "N")
            {
                frmLabel.Text = "     Chart of Accounts";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Assets", "Assets", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Liabilities", "Liabilities", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Income", "Income", "closed");
                oNodex.Expand();
                oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Expenses", "Expenses", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeview(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup                  = ogrp.GroupName.ToString();
                    oNodex                    = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.Expand();
                    oNodex.EnsureVisible();
                    mAddItem(strGroup, intSttsus);
                }
            }
            else if (strType == "N")
            {
                frmLabel.Text = "Chart of Cost Center";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Debtors", "Sundry Debtors", "closed");
                //oNodex.Expand();
                List <VectorCategory> oogrp = accms.mFillVectorCategory(strComID).ToList();
                foreach (VectorCategory ogrp in oogrp)
                {
                    strGroup                  = ogrp.strVectorcategory.ToString();
                    oNodex                    = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, ogrp.strVectorcategory, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemCostCenter(strGroup);
                }
            }
            else if (strType == "M")
            {
                frmLabel.Text = "Chart of Medical Representative";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Debtors", "Sundry Debtors", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeviewDR(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup = ogrp.GroupName.ToString();
                    oNodex   = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemMR(strGroup, intSttsus);
                }
            }
            else if (strType == "C")
            {
                frmLabel.Text = "Chart of Sundry Creditors";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                oNodex             = tvwGroup.Nodes.Add(mcGROUP_PREFIX + "Sundry Creditors", "Sundry Creditors", "closed");
                oNodex.Expand();
                List <AccountdGroup> oogrp = accms.GetAccountsTreeviewCR(strComID).ToList();
                foreach (AccountdGroup ogrp in oogrp)
                {
                    strGroup = ogrp.GroupName.ToString();
                    oNodex   = tvwGroup.Nodes.Find(mcGROUP_PREFIX + ogrp.ParentName.ToString(), true)[0].Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    //oNodex = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, strGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItem(strGroup, intSttsus);
                }
            }
            else
            {
                frmLabel.Text = "Doctor/Customer Treeview";
                System.Windows.Forms.TreeNode oNodex = null;
                tvwGroup.ImageList = imageList1;
                List <AccountsLedger> oogrp = accms.GetSalesLedgerTree(strComID).ToList();
                foreach (AccountsLedger ogrp in oogrp)
                {
                    strGroup                  = ogrp.strRepName.ToString();
                    oNodex                    = tvwGroup.Nodes.Add(mcGROUP_PREFIX + strGroup, ogrp.strParentGroup, "closed");
                    oNodex.ImageIndex         = 0;
                    oNodex.SelectedImageIndex = 0;
                    oNodex.ExpandAll();
                    oNodex.EnsureVisible();
                    mAddItemSales(strGroup);
                }
            }
        }
Beispiel #60
0
        /// <summary>
        /// Fills data points name tree.
        /// </summary>
        private void FillTree()
        {
            bool nodeSelected = false;

            this.BeginUpdate();

            // Add "None" option
            System.Windows.Forms.TreeNode noPoint = this.Nodes.Add(Constants.NotSetValue);

            // Get chart object
            if (this.annotation != null &&
                annotation.GetAnnotationGroup() == null &&
                this.annotation.Chart != null)
            {
                Chart chart = this.annotation.Chart;

                // Loop through all chart areas
                foreach (ChartArea chartArea in chart.ChartAreas)
                {
                    System.Windows.Forms.TreeNode areaNode = this.Nodes.Add(chartArea.Name);
                    areaNode.Tag = chartArea;

                    // Loop through all axes
                    foreach (Axis curAxis in chartArea.Axes)
                    {
                        // Hide X or Y axes
                        if (curAxis.Type == AxisName.Y || curAxis.Type == AxisName.Y2)
                        {
                            if (showXAxes)
                            {
                                continue;
                            }
                        }
                        if (curAxis.Type == AxisName.X || curAxis.Type == AxisName.X2)
                        {
                            if (!showXAxes)
                            {
                                continue;
                            }
                        }

                        // Create child node
                        System.Windows.Forms.TreeNode axisNode = areaNode.Nodes.Add(curAxis.Name);
                        axisNode.Tag = curAxis;

                        // Check if this node should be selected
                        if (axis == curAxis)
                        {
                            areaNode.Expand();
                            this.SelectedNode = axisNode;
                            nodeSelected      = true;
                        }
                    }
                }
            }

            // Select default node
            if (!nodeSelected)
            {
                this.SelectedNode = noPoint;
            }

            this.EndUpdate();
        }