public void AddTool(IBoardEditorTool tool) { this.customTools.Add(tool.Name, tool); int index = this.customTools.IndexOfKey(tool.Name); CreateListViewItem(tool, this.predefinedTools.Count + index); }
private void DestroyListViewItem(IBoardEditorTool tool, int position) { if (this.SelectedTool == tool) { SelectTool(0); } this.Items.RemoveAt(position); this.toolIcons.Images.RemoveByKey(tool.Name); }
private void CreateListViewItem(IBoardEditorTool tool, int position) { this.toolIcons.Images.Add(tool.Name, tool.Icon); ListViewItem item = new ListViewItem(); item.Text = tool.Name; item.ImageKey = tool.Name; item.Tag = tool; this.Items.Insert(position, item); }
private void AddPredefinedTool(IBoardEditorTool tool) { this.predefinedTools.Add(tool); CreateListViewItem(tool, this.predefinedTools.Count - 1); }