Пример #1
0
 //检查工具名称唯一性
 public bool CheckToolUnique(string toolName)
 {
     if (ToolsDic != null)
     {
         if (!ToolsDic.ContainsKey(toolName))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
 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);
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }