コード例 #1
0
 /// <summary>
 /// 将命令移入命令池
 /// </summary>
 /// <param name="taskid"></param>
 /// <param name="taskruntimeinfo"></param>
 /// <returns></returns>
 public bool Add(string commanddetailid, CommandRunTimeInfo commandruntimeinfo)
 {
     lock (_locktag)
     {
         if (!CommandRuntimePool.ContainsKey(commanddetailid))
         {
             CommandRuntimePool.Add(commanddetailid, commandruntimeinfo);
             return(true);
         }
         return(false);
     }
 }
コード例 #2
0
        public static CommandRunTimeInfo Create(tb_commandlibdetail command)
        {
            CommandRunTimeInfo runTimeInfo  = new CommandRunTimeInfo();
            string             namespacestr = typeof(AbstractCommand).Namespace;
            var obj = Assembly.GetAssembly(typeof(AbstractCommand)).CreateInstance(namespacestr + "." + command.commandmainclassname.ToString(), true);

            if (obj != null && obj is AbstractCommand)
            {
                var commandInfo = (obj as AbstractCommand);
                commandInfo.CommandDetail      = command;
                commandInfo.CommandDescription = command.commanddescription;
                commandInfo.CommandDisplayName = command.commandname;
                commandInfo.CommandVersion     = command.commandlibid.ToString();
                runTimeInfo.commandBase        = commandInfo;
            }
            return(runTimeInfo);
        }