public int Add(object value) { ToolboxItemContainer item = (ToolboxItemContainer)value; if (item != null) { HostItem hostItem = new HostItem(item.GetToolboxItem(null)); if (this._tab != null) { this._tab.Items.Add(hostItem); } else if (this._toolbox.GeneralCategory != null) { this._toolbox.GeneralCategory.Items.Add(hostItem); } else { if (this._toolbox.Categories.Count == 0) { this._toolbox.Categories.Add(this._toolbox.CreateNewTab(Resources.ToolboxTabDefaultName)); } this._toolbox.Categories[this._toolbox.Categories.Count - 1].Items.Add(hostItem); } } return(-1); }
public void Remove(object value) { ToolboxItemContainer item = (ToolboxItemContainer)value; if (item != null) { ToolboxItem toolboxItem = item.GetToolboxItem(null); this._toolbox.RemoveToolboxItem(toolboxItem, (this._tab != null) ? this._tab.Text : null); } }