Beispiel #1
0
		public ToolboxItemCollection GetToolboxItems (string category, System.ComponentModel.Design.IDesignerHost host)
		{
			if (!categories.ContainsKey (category))
				return null;

			ArrayList tools = new ArrayList ();

			foreach(ToolboxItem tool in ((ArrayList) categories[category]))
				if (((IToolboxUser) host.GetDesigner (host.RootComponent)).GetToolSupported (tool))
					tools.Add (tool);

			return new ToolboxItemCollection ((ToolboxItem[]) tools.ToArray (typeof (ToolboxItem)));
		}
Beispiel #2
0
		public ToolboxItemCollection GetToolboxItems (System.ComponentModel.Design.IDesignerHost host)
		{
			ArrayList tools = new ArrayList();
			IToolboxUser toolboxUser = (IToolboxUser) host.GetDesigner (host.RootComponent);
			
			foreach (ArrayList arr in categories.Values)
				foreach (ToolboxItem tool in arr)
					if (toolboxUser.GetToolSupported (tool))
						tools.Add (tool);

			return new ToolboxItemCollection ((ToolboxItem[]) tools.ToArray (typeof (ToolboxItem)));
		}
Beispiel #3
0
		public ToolboxItem GetSelectedToolboxItem (System.ComponentModel.Design.IDesignerHost host)
		{
			IToolboxUser toolboxUser = (IToolboxUser) host.GetDesigner (host.RootComponent);
			if (toolboxUser.GetToolSupported (selectedItem))
				return selectedItem;
			else
				return null;
		}