Exemplo n.º 1
0
 public ToolboxTabEnumerator(ToolboxTabCollection mappings)
 {
     this.temp           = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }
Exemplo n.º 2
0
        private ToolboxTabCollection PopulateToolboxTabs(XmlDocument xmlDocument)
        {
            if (xmlDocument == null)
            {
                return(null);
            }

            XmlNode toolboxNode = xmlDocument.FirstChild;

            if (toolboxNode == null)
            {
                return(null);
            }

            XmlNode tabCollectionNode = toolboxNode.FirstChild;

            if (tabCollectionNode == null)
            {
                return(null);
            }

            XmlNodeList tabsNodeList = tabCollectionNode.ChildNodes;

            if (tabsNodeList == null)
            {
                return(null);
            }

            ToolboxTabCollection toolboxTabs = new ToolboxTabCollection();

            foreach (XmlNode tabNode in tabsNodeList)
            {
                if (tabNode == null)
                {
                    continue;
                }

                XmlNode propertiesNode = tabNode.FirstChild;
                if (propertiesNode == null)
                {
                    continue;
                }

                XmlNode nameNode = propertiesNode[Strings.Name];
                if (nameNode == null)
                {
                    continue;
                }

                ToolboxTab toolboxTab = new ToolboxTab();
                toolboxTab.Name = nameNode.InnerXml.ToString();
                PopulateToolboxItems(tabNode, toolboxTab);
                toolboxTabs.Add(toolboxTab);
            }
            if (toolboxTabs.Count == 0)
            {
                return(null);
            }

            return(toolboxTabs);
        }