コード例 #1
0
        public BaseCmd GetCmd(CommandModel model, SendContent receviContent)
        {
            Type    type    = Type.GetType(combinTypeName(model.CustomerCmd.ToString()));
            BaseCmd baseCmd = (BaseCmd)(Activator.CreateInstance(type, _service, receviContent));

            return(baseCmd);
        }
コード例 #2
0
 private void ReceiveMessageHandler(object sender, ReceiveEventArgs e)
 {
     if (e.ReceiveContent != null)
     {
         List <string>  strList    = new List <string>();
         CommandModel   receiveCmd = PublicMethod.JsonDeSerialize <CommandModel>(e.ReceiveContent.Message);
         ReflectionType typeObject = new ReflectionType(this);
         BaseCmd        baseCmd    = typeObject.GetCmd(receiveCmd, e.ReceiveContent);
         strList = baseCmd.Do();
         foreach (string strContent in strList)
         {
             Connector.Send(strContent);
         }
         baseCmd.Dispose();
     }
 }