Exemple #1
0
        private void PopulateToolboxItems(ToolboxTab toolboxTab)
        {
            if (toolboxTab == null)
            {
                return;
            }

            Type[] typeArray = null;

            switch (toolboxTab.Name)
            {
            case Strings.WindowsForms:
                typeArray = windowsFormsToolTypes;
                break;

            case Strings.Components:
                typeArray = componentsToolTypes;
                break;

            case Strings.Data:
                typeArray = dataToolTypes;
                break;

            case Strings.UserControls:
                typeArray = userControlsToolTypes;
                break;

            default:
                break;
            }

            ToolboxItemCollection toolboxItems = new ToolboxItemCollection();

            for (int i = 0; i < typeArray.Length; i++)
            {
                ToolboxItem toolboxItem = new ToolboxItem();

                toolboxItem.Type = typeArray[i];
                toolboxItem.Name = typeArray[i].Name;
                toolboxItems.Add(toolboxItem);
            }

            toolboxTab.ToolboxItems = toolboxItems;
        }