static public Commend CommendGenerator(string rawMsg)
        {
            string [] cmdmsg;
            string    Source;
            string    Destination;
            string    Type = null;

            if (rawMsg.Length != 0)
            {
                cmdmsg = rawMsg.Split(',');
            }
            else
            {
                return(null);
            }
            if (cmdmsg.Length > 3)
            {
                Type        = System.Configuration.ConfigurationManager.AppSettings[cmdmsg[0]];
                Source      = cmdmsg[1];
                Destination = cmdmsg[2];
            }
            if (Type == null)
            {
                return(null);
            }
            string  assemblyname = "GMS";
            string  classname    = assemblyname + "." + Type;
            Commend CMD          = (Commend)Assembly.Load(assemblyname).CreateInstance(classname);

            CMD.appendcontext(cmdmsg);
            return(CMD);
        }
 public bool AddCmd(Commend cmd)
 {
     lock (thislock)
     {
         LoC.Add(cmd);
     }
     return(CheckUp(cmd, LoC.Count - 1));
 }
 public bool AddCmdEmg(Commend cmd, int index = 2)
 {
     lock (thislock)
     {
         LoC.Insert(index, cmd);
     }
     return(CheckUp(cmd, LoC.Count - 1));
 }
        public bool Remove(int index)
        {
            Commend tmp = LoC[index];

            lock (thislock)
            {
                LoC.RemoveAt(index);
            }
            return(LoC[index].Equals(tmp) ? false : true);
        }
 private void dowork(object state)
 {
     c = CommendFactory.CommendGenerator(msg.Trim());
     if (c != null)
     {
         // c.GetType();
         c.Process();
         //queue.AddCmd(c);
     }
 }
 private bool CheckUp(Commend _cmd, int index)
 {
     return(LoC[index].Equals(_cmd));
 }