상속: ItemToolboxNode
예제 #1
0
파일: Toolbox.cs 프로젝트: deck05/aspeditor
        private void Repopulate(bool categorised)
        {
            IDesignerHost   host           = parentServices.GetService(typeof(IDesignerHost)) as IDesignerHost;
            IToolboxService toolboxService = parentServices.GetService(typeof(IToolboxService)) as IToolboxService;

            if (toolboxService == null || host == null)
            {
                return;
            }

            store.Clear();

            ToolboxItemCollection tools = toolboxService.GetToolboxItems(host);

            if (tools == null)
            {
                return;
            }

            ArrayList nodes = new ArrayList(tools.Count);

            CategoryNameCollection catNames = toolboxService.CategoryNames;

            foreach (string name in catNames)
            {
                tools = toolboxService.GetToolboxItems(name, host);
                foreach (ToolboxItem ti in tools)
                {
                    ToolboxItemToolboxNode node = new ToolboxItemToolboxNode(ti);
                    node.Category = name;
                    nodes.Add(node);
                }
            }

            store.SetNodes(nodes);
            EnsureState();
        }
예제 #2
0
파일: Toolbox.cs 프로젝트: mono/aspeditor
        private void Repopulate(bool categorised)
        {
            IDesignerHost host = parentServices.GetService (typeof (IDesignerHost)) as IDesignerHost;
            IToolboxService toolboxService = parentServices.GetService (typeof (IToolboxService)) as IToolboxService;
            if (toolboxService == null || host == null) return;

            store.Clear ();

            ToolboxItemCollection tools = toolboxService.GetToolboxItems (host);
            if (tools == null) return;

            ArrayList nodes = new ArrayList (tools.Count);

            CategoryNameCollection catNames = toolboxService.CategoryNames;

            foreach (string name in catNames) {
                tools = toolboxService.GetToolboxItems (name, host);
                foreach (ToolboxItem ti in tools) {
                    ToolboxItemToolboxNode node = new ToolboxItemToolboxNode (ti);
                    node.Category = name;
                    nodes.Add (node);
                }
            }

            store.SetNodes (nodes);
            EnsureState ();
        }