Hashtable SelectedNGNodes(MWControlSuite.MWTreeView view) { Hashtable result = new Hashtable(); Hashtable selected = view.SelNodes; foreach (DictionaryEntry en in selected) { result.Add(((MWControlSuite.MWTreeNodeWrapper)en.Value).Node.Tag, null); } return(result); }
NGTreeNode[] SelectedNodes(MWControlSuite.MWTreeView tree) { Hashtable hash = tree.SelNodes; NGTreeNode[] result = new NGTreeNode[hash.Count]; int i = 0; foreach (DictionaryEntry dict in hash) { result[i++] = ((MWControlSuite.MWTreeNodeWrapper)dict.Value).Node.Tag as NGTreeNode; } NGTreeNode.SortByOrder(result); return(result); }
void Update(MWControlSuite.MWTreeView view, TreeNodeCollection tree, NGTreeNodeCollection coll, Hashtable selectedNGNodes) { if (tree.Count != 0) { throw new ApplicationException("Tree must be empty here"); } for (int i = 0; i < coll.Count; i++) { bool isExpanded = false; if (null != coll[i].GuiTag) { TreeNode node = (TreeNode)coll[i].GuiTag; isExpanded = node.IsExpanded; node.Remove(); node.Nodes.Clear(); tree.Add(node); } else { tree.Add(NewNode(coll[i])); } if (coll[i].Nodes.Count > 0) { Update(view, tree[i].Nodes, coll[i].Nodes, selectedNGNodes); } if (isExpanded) { tree[i].Expand(); } if (null != selectedNGNodes && selectedNGNodes.ContainsKey(coll[i])) { view.SelectNode(tree[i], false); if (tree[i].Parent != null && !(tree[i].Parent.IsExpanded)) { tree[i].Parent.Expand(); } } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LineScatterLayerContentsControl)); this.m_Contents_chkShowRange = new System.Windows.Forms.CheckBox(); this.m_Contents_btEditRange = new System.Windows.Forms.Button(); this.m_Contents_btUngroup = new System.Windows.Forms.Button(); this.m_Contents_btGroup = new System.Windows.Forms.Button(); this.m_Contents_btPlotAssociations = new System.Windows.Forms.Button(); this.m_Contents_btListSelDown = new System.Windows.Forms.Button(); this.m_Contents_btListSelUp = new System.Windows.Forms.Button(); this.m_Contents_lbContents = new MWControlSuite.MWTreeView(); this.m_Contents_btPullData = new System.Windows.Forms.Button(); this.m_Contents_btPutData = new System.Windows.Forms.Button(); this.label14 = new System.Windows.Forms.Label(); this.m_Content_tvDataAvail = new MWControlSuite.MWTreeView(); this.label13 = new System.Windows.Forms.Label(); this._splitContainer = new System.Windows.Forms.SplitContainer(); this._splitContainer.Panel1.SuspendLayout(); this._splitContainer.Panel2.SuspendLayout(); this._splitContainer.SuspendLayout(); this.SuspendLayout(); // // m_Contents_chkShowRange // this.m_Contents_chkShowRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_chkShowRange.Location = new System.Drawing.Point(147, 240); this.m_Contents_chkShowRange.Name = "m_Contents_chkShowRange"; this.m_Contents_chkShowRange.Size = new System.Drawing.Size(104, 24); this.m_Contents_chkShowRange.TabIndex = 25; this.m_Contents_chkShowRange.Text = "Show Range"; this.m_Contents_chkShowRange.CheckedChanged += new System.EventHandler(this.EhShowRange_CheckedChanged); // // m_Contents_btEditRange // this.m_Contents_btEditRange.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btEditRange.Location = new System.Drawing.Point(147, 208); this.m_Contents_btEditRange.Name = "m_Contents_btEditRange"; this.m_Contents_btEditRange.Size = new System.Drawing.Size(104, 24); this.m_Contents_btEditRange.TabIndex = 24; this.m_Contents_btEditRange.Text = "Edit Range..."; this.m_Contents_btEditRange.Click += new System.EventHandler(this.EhEditRange_Click); // // m_Contents_btUngroup // this.m_Contents_btUngroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btUngroup.Location = new System.Drawing.Point(147, 176); this.m_Contents_btUngroup.Name = "m_Contents_btUngroup"; this.m_Contents_btUngroup.Size = new System.Drawing.Size(104, 24); this.m_Contents_btUngroup.TabIndex = 23; this.m_Contents_btUngroup.Text = "Ungroup"; this.m_Contents_btUngroup.Click += new System.EventHandler(this.EhUngroup_Click); // // m_Contents_btGroup // this.m_Contents_btGroup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btGroup.Location = new System.Drawing.Point(147, 144); this.m_Contents_btGroup.Name = "m_Contents_btGroup"; this.m_Contents_btGroup.Size = new System.Drawing.Size(104, 24); this.m_Contents_btGroup.TabIndex = 22; this.m_Contents_btGroup.Text = "Group"; this.m_Contents_btGroup.Click += new System.EventHandler(this.EhGroup_Click); // // m_Contents_btPlotAssociations // this.m_Contents_btPlotAssociations.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btPlotAssociations.Location = new System.Drawing.Point(147, 112); this.m_Contents_btPlotAssociations.Name = "m_Contents_btPlotAssociations"; this.m_Contents_btPlotAssociations.Size = new System.Drawing.Size(104, 24); this.m_Contents_btPlotAssociations.TabIndex = 21; this.m_Contents_btPlotAssociations.Text = "PlotAssociations..."; this.m_Contents_btPlotAssociations.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.m_Contents_btPlotAssociations.Click += new System.EventHandler(this.EhPlotAssociations_Click); // // m_Contents_btListSelDown // this.m_Contents_btListSelDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btListSelDown.Image = ((System.Drawing.Image)(resources.GetObject("m_Contents_btListSelDown.Image"))); this.m_Contents_btListSelDown.Location = new System.Drawing.Point(147, 72); this.m_Contents_btListSelDown.Name = "m_Contents_btListSelDown"; this.m_Contents_btListSelDown.Size = new System.Drawing.Size(32, 32); this.m_Contents_btListSelDown.TabIndex = 20; this.m_Contents_btListSelDown.Click += new System.EventHandler(this.EhListSelDown_Click); // // m_Contents_btListSelUp // this.m_Contents_btListSelUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btListSelUp.Image = ((System.Drawing.Image)(resources.GetObject("m_Contents_btListSelUp.Image"))); this.m_Contents_btListSelUp.Location = new System.Drawing.Point(147, 32); this.m_Contents_btListSelUp.Name = "m_Contents_btListSelUp"; this.m_Contents_btListSelUp.Size = new System.Drawing.Size(32, 32); this.m_Contents_btListSelUp.TabIndex = 19; this.m_Contents_btListSelUp.Click += new System.EventHandler(this.EhListSelUp_Click); // // m_Contents_lbContents // this.m_Contents_lbContents.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_lbContents.CheckedNodes = ((System.Collections.Hashtable)(resources.GetObject("m_Contents_lbContents.CheckedNodes"))); this.m_Contents_lbContents.HideSelection = false; this.m_Contents_lbContents.Location = new System.Drawing.Point(0, 24); this.m_Contents_lbContents.Name = "m_Contents_lbContents"; this.m_Contents_lbContents.RubberbandGradientBlend = new MWControlSuite.MWRubberbandGradientBlend[0]; this.m_Contents_lbContents.RubberbandGradientColorBlend = new MWControlSuite.MWRubberbandGradientColorBlend[0]; this.m_Contents_lbContents.SelNodes = ((System.Collections.Hashtable)(resources.GetObject("m_Contents_lbContents.SelNodes"))); this.m_Contents_lbContents.Size = new System.Drawing.Size(136, 240); this.m_Contents_lbContents.TabIndex = 18; this.m_Contents_lbContents.DoubleClick += new System.EventHandler(this.EhContents_DoubleClick); // // m_Contents_btPullData // this.m_Contents_btPullData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btPullData.Image = ((System.Drawing.Image)(resources.GetObject("m_Contents_btPullData.Image"))); this.m_Contents_btPullData.Location = new System.Drawing.Point(163, 72); this.m_Contents_btPullData.Name = "m_Contents_btPullData"; this.m_Contents_btPullData.Size = new System.Drawing.Size(32, 32); this.m_Contents_btPullData.TabIndex = 17; this.m_Contents_btPullData.Click += new System.EventHandler(this.EhPullData_Click); // // m_Contents_btPutData // this.m_Contents_btPutData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.m_Contents_btPutData.Image = ((System.Drawing.Image)(resources.GetObject("m_Contents_btPutData.Image"))); this.m_Contents_btPutData.Location = new System.Drawing.Point(163, 32); this.m_Contents_btPutData.Name = "m_Contents_btPutData"; this.m_Contents_btPutData.Size = new System.Drawing.Size(32, 32); this.m_Contents_btPutData.TabIndex = 16; this.m_Contents_btPutData.Click += new System.EventHandler(this.EhPutData_Click); // // label14 // this.label14.Location = new System.Drawing.Point(0, 8); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(88, 16); this.label14.TabIndex = 15; this.label14.Text = "XYPlotLayer Contents"; // // m_Content_tvDataAvail // this.m_Content_tvDataAvail.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_Content_tvDataAvail.CheckedNodes = ((System.Collections.Hashtable)(resources.GetObject("m_Content_tvDataAvail.CheckedNodes"))); this.m_Content_tvDataAvail.HideSelection = false; this.m_Content_tvDataAvail.Location = new System.Drawing.Point(3, 24); this.m_Content_tvDataAvail.Name = "m_Content_tvDataAvail"; this.m_Content_tvDataAvail.RubberbandGradientBlend = new MWControlSuite.MWRubberbandGradientBlend[0]; this.m_Content_tvDataAvail.RubberbandGradientColorBlend = new MWControlSuite.MWRubberbandGradientColorBlend[0]; this.m_Content_tvDataAvail.SelNodes = ((System.Collections.Hashtable)(resources.GetObject("m_Content_tvDataAvail.SelNodes"))); this.m_Content_tvDataAvail.Size = new System.Drawing.Size(152, 240); this.m_Content_tvDataAvail.TabIndex = 14; this.m_Content_tvDataAvail.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.EhDataAvailable_BeforeExpand); // // label13 // this.label13.Location = new System.Drawing.Point(3, 8); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(80, 16); this.label13.TabIndex = 13; this.label13.Text = "Available data"; // // _splitContainer // this._splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; this._splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this._splitContainer.Location = new System.Drawing.Point(0, 0); this._splitContainer.Name = "_splitContainer"; // // _splitContainer.Panel1 // this._splitContainer.Panel1.Controls.Add(this.m_Content_tvDataAvail); this._splitContainer.Panel1.Controls.Add(this.label13); this._splitContainer.Panel1.Controls.Add(this.m_Contents_btPutData); this._splitContainer.Panel1.Controls.Add(this.m_Contents_btPullData); // // _splitContainer.Panel2 // this._splitContainer.Panel2.Controls.Add(this.m_Contents_lbContents); this._splitContainer.Panel2.Controls.Add(this.m_Contents_chkShowRange); this._splitContainer.Panel2.Controls.Add(this.label14); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btEditRange); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btListSelUp); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btUngroup); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btListSelDown); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btGroup); this._splitContainer.Panel2.Controls.Add(this.m_Contents_btPlotAssociations); this._splitContainer.Size = new System.Drawing.Size(456, 271); this._splitContainer.SplitterDistance = 196; this._splitContainer.TabIndex = 26; // // LineScatterLayerContentsControl // this.Controls.Add(this._splitContainer); this.Name = "LineScatterLayerContentsControl"; this.Size = new System.Drawing.Size(456, 271); this._splitContainer.Panel1.ResumeLayout(false); this._splitContainer.Panel2.ResumeLayout(false); this._splitContainer.ResumeLayout(false); this.ResumeLayout(false); }
const int excludeFindTreeNodeLevel = 3; // 查找不会找这个level的树结点 public FindForm(MWControlSuite.MWTreeView tree) { InitializeComponent(); m_tree = tree; }