//检查工具名称唯一性 public bool CheckToolUnique(string toolName) { if (ToolsDic != null) { if (!ToolsDic.ContainsKey(toolName)) { return(true); } } return(false); }
public bool RemoverTool(string ToolName) { if (ToolsDic != null) { if (ToolsDic.ContainsKey(ToolName)) { ToolsDic.Remove(ToolName); ToolList.Remove(ToolList.Find(p => p.ToolName == ToolName)); return(true); } } return(false); }
public bool InsertTool(int index, ITool tool) { if (ToolsDic != null) { if (!ToolsDic.ContainsKey(tool.ToolName)) { ToolsDic.Add(tool.ToolName, tool); ToolList.Insert(index, tool); return(true); } } return(false); }
public bool AddTool(ITool tool) { if (ToolsDic != null) { if (!ToolsDic.ContainsKey(tool.ToolName)) { ToolsDic.Add(tool.ToolName, tool); ToolList.Add(tool); return(true); } } return(false); }