示例#1
0
        public void AddTool(IBoardEditorTool tool)
        {
            this.customTools.Add(tool.Name, tool);
            int index = this.customTools.IndexOfKey(tool.Name);

            CreateListViewItem(tool, this.predefinedTools.Count + index);
        }
示例#2
0
 private void DestroyListViewItem(IBoardEditorTool tool, int position)
 {
     if (this.SelectedTool == tool)
     {
         SelectTool(0);
     }
     this.Items.RemoveAt(position);
     this.toolIcons.Images.RemoveByKey(tool.Name);
 }
示例#3
0
        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);
        }
示例#4
0
 private void AddPredefinedTool(IBoardEditorTool tool)
 {
     this.predefinedTools.Add(tool);
     CreateListViewItem(tool, this.predefinedTools.Count - 1);
 }