public bool AddCmd(ShellCmd cmd) { lock (ShellCmdLock) { try { ICmd newcmd; switch (Mw.ChipName) { default: newcmd = null; break; } if (!Cmd.Add(newcmd)) { return(false); } Cmd.Start(); return(true); } catch (Exception ex) { Log.error("添加命令失败!错误消息:" + ex.Message); return(false); } // TODO /*if (IsExclusiveMode) return false; * ShellCmdQueue.Enqueue(cmd); * return true;*/ } }