private void InsertMapFrameToTree(IElement pElement, TOCTreeNodeCollection pParantNodes) { if (pElement is IMapFrame) { IMapFrame frame = (IMapFrame)pElement; string name = frame.Map.Name; if (name == "") { name = "Scene"; } TOCTreeNode pNode = new TOCTreeNodeEx(name, false, true); Bitmap bitmap = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream("Yutai.ArcGIS.Controls.Controls.TOCTreeview.layers.bmp")); pNode.Image = bitmap; pNode.Tag = frame; pParantNodes.Add(pNode); this.InsertMapToTree((IBasicMap)frame.Map, pNode); } else if (pElement is IGroupElement) { IGroupElement element = (IGroupElement)pElement; IEnumElement elements = element.Elements; elements.Reset(); for (IElement element3 = elements.Next(); element3 != null; element3 = elements.Next()) { this.InsertMapFrameToTree(element3, pParantNodes); } } }
public TOCTreeNode() { this.OID = 0; this.m_pImage = null; this.m_nItemHeight = 18; this.m_Space = 4; this.m_Checked = false; this.m_Text = ""; this.m_IsSelected = false; this.m_Bounds = new Rectangle(0, 0, 10, 10); this.m_TextRect = new Rectangle(0, 0, 0, 0); this.m_ExpandRect = new Rectangle(0, 0, 0, 0); this.m_ImageRect = new Rectangle(0, 0, 0, 0); this.m_ChectRect = new Rectangle(0, 0, 0, 0); this.m_HasButton = false; this.m_HasCheck = false; this.m_HasImage = false; this.m_HasText = false; this.m_ChildNodes = new TOCTreeNodeCollection(); this.m_BackColor = Color.White; this.m_ForeColor = Color.Black; this.m_IsEditing = false; this.m_IsExpanded = false; this.m_IsVisible = true; this.m_pNextVisibleNode = null; this.m_pPrevVisibleNode = null; this.m_pParentNode = null; this.m_NodeFont = new Font("Arial", 8f); this.m_Pen = new Pen(Color.Black, 0f); this.m_pTreeView = null; this.m_pTag = null; this.m_NodeType = NodeType.None; this.m_ChildNodes.Owner = this; this.m_BmpUnCheck = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream("Yutai.ArcGIS.Controls.Controls.TOCTreeview.uncheck.bmp")); this.m_BmpCheck = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream("Yutai.ArcGIS.Controls.Controls.TOCTreeview.checked.bmp")); this.m_BmpUnCheck_nofc = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream( "Yutai.ArcGIS.Controls.Controls.TOCTreeview.unchecked_nofc.bmp")); this.m_BmpCheck_nofc = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream( "Yutai.ArcGIS.Controls.Controls.TOCTreeview.checked_nofc.bmp")); this.m_BmpCheck_novis = new Bitmap( base.GetType() .Assembly.GetManifestResourceStream( "Yutai.ArcGIS.Controls.Controls.TOCTreeview.checked_novis.bmp")); }