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); }
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(); } }