Пример #1
0
        public bool CheckSupported()
        {
            if (Req == null && Resp == null)
            {
                return(false);
            }
            bool flag;

            switch (ConmandId)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                flag = true;
                break;

            default:
                flag = false;
                break;
            }
            WXBaseMessage message = null;

            if (Req is SendMessageToWX.Req)
            {
                SendMessageToWX.Req req = (SendMessageToWX.Req)Req;
                message = req.Message;
            }
            if (Req is ShowMessageFromWX.Req)
            {
                ShowMessageFromWX.Req req2 = (ShowMessageFromWX.Req)Req;
                message = req2.Message;
            }
            if (Resp is GetMessageFromWX.Resp)
            {
                GetMessageFromWX.Resp resp = (GetMessageFromWX.Resp)Resp;
                message = resp.Message;
            }
            if (message != null)
            {
                flag &= (message.Type() >= 0) && (message.Type() <= 8);
            }
            return(flag);
        }
Пример #2
0
        public bool CheckSupported()
        {
            if (this.Req == null && this.Resp == null)
            {
                return(false);
            }
            bool flag;

            switch (this.ConmandID)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                flag = true;
                break;

            default:
                flag = false;
                break;
            }
            WXBaseMessage wXBaseMessage = null;

            if (this.Req != null && this.Req is SendMessageToWX.Req)
            {
                SendMessageToWX.Req req = this.Req as SendMessageToWX.Req;
                wXBaseMessage = req.Message;
            }
            if (this.Req != null && this.Req is ShowMessageFromWX.Req)
            {
                ShowMessageFromWX.Req req2 = this.Req as ShowMessageFromWX.Req;
                wXBaseMessage = req2.Message;
            }
            if (this.Resp != null && this.Resp is GetMessageFromWX.Resp)
            {
                GetMessageFromWX.Resp resp = this.Resp as GetMessageFromWX.Resp;
                wXBaseMessage = resp.Message;
            }
            if (wXBaseMessage != null)
            {
                flag &= (wXBaseMessage.Type() >= 0 && wXBaseMessage.Type() <= 8);
            }
            return(flag);
        }
Пример #3
0
 public virtual void OnShowMessageFromWXRequest(ShowMessageFromWX.Req request)
 {
 }
Пример #4
0
        internal void FromProto(object protoObj)
        {
            TransactDataP ap = protoObj as TransactDataP;

            if (ap != null)
            {
                ConmandId    = (int)ap.ConmandID;
                AppId        = ap.AppID;
                SdkVersion   = ap.SdkVersion;
                CheckContent = ap.CheckContent;
                CheckSummary = ap.CheckSummary;
                if (!string.IsNullOrEmpty(ap.GetReq.Base.Transaction))
                {
                    Req = new GetMessageFromWX.Req();
                    Req.FromProto(ap.GetReq);
                }
                if (!string.IsNullOrEmpty(ap.AuthReq.Base.Transaction))
                {
                    Req = new SendAuth.Req();
                    Req.FromProto(ap.AuthReq);
                }
                if (!string.IsNullOrEmpty(ap.SendReq.Base.Transaction))
                {
                    Req = new SendMessageToWX.Req();
                    Req.FromProto(ap.SendReq);
                }
                if (!string.IsNullOrEmpty(ap.ShowReq.Base.Transaction))
                {
                    Req = new ShowMessageFromWX.Req();
                    Req.FromProto(ap.ShowReq);
                }
                if (!string.IsNullOrEmpty(ap.GetResp.Base.Transaction))
                {
                    Resp = new GetMessageFromWX.Resp();
                    Resp.FromProto(ap.GetResp);
                }
                if (!string.IsNullOrEmpty(ap.AuthResp.Base.Transaction))
                {
                    Resp = new SendAuth.Resp();
                    Resp.FromProto(ap.AuthResp);
                }
                if (!string.IsNullOrEmpty(ap.SendResp.Base.Transaction))
                {
                    Resp = new SendMessageToWX.Resp();
                    Resp.FromProto(ap.SendResp);
                }
                if (!string.IsNullOrEmpty(ap.ShowResp.Base.Transaction))
                {
                    Resp = new ShowMessageFromWX.Resp();
                    Resp.FromProto(ap.ShowResp);
                }
                if (!string.IsNullOrEmpty(ap.PayReq.Base.Transaction))
                {
                    Req = new SendPay.Req();
                    Req.FromProto(ap.PayReq);
                }
                if (!string.IsNullOrEmpty(ap.PayResp.Base.Transaction))
                {
                    Resp = new SendPay.Resp();
                    Resp.FromProto(ap.PayResp);
                }
            }
        }
Пример #5
0
 internal void FromProto(object protoObj)
 {
     TransactDataP ap = protoObj as TransactDataP;
     if (ap != null)
     {
         ConmandId = (int)ap.ConmandID;
         AppId = ap.AppID;
         SdkVersion = ap.SdkVersion;
         CheckContent = ap.CheckContent;
         CheckSummary = ap.CheckSummary;
         if (!string.IsNullOrEmpty(ap.GetReq.Base.Transaction))
         {
             Req = new GetMessageFromWX.Req();
             Req.FromProto(ap.GetReq);
         }
         if (!string.IsNullOrEmpty(ap.AuthReq.Base.Transaction))
         {
             Req = new SendAuth.Req();
             Req.FromProto(ap.AuthReq);
         }
         if (!string.IsNullOrEmpty(ap.SendReq.Base.Transaction))
         {
             Req = new SendMessageToWX.Req();
             Req.FromProto(ap.SendReq);
         }
         if (!string.IsNullOrEmpty(ap.ShowReq.Base.Transaction))
         {
             Req = new ShowMessageFromWX.Req();
             Req.FromProto(ap.ShowReq);
         }
         if (!string.IsNullOrEmpty(ap.GetResp.Base.Transaction))
         {
             Resp = new GetMessageFromWX.Resp();
             Resp.FromProto(ap.GetResp);
         }
         if (!string.IsNullOrEmpty(ap.AuthResp.Base.Transaction))
         {
             Resp = new SendAuth.Resp();
             Resp.FromProto(ap.AuthResp);
         }
         if (!string.IsNullOrEmpty(ap.SendResp.Base.Transaction))
         {
             Resp = new SendMessageToWX.Resp();
             Resp.FromProto(ap.SendResp);
         }
         if (!string.IsNullOrEmpty(ap.ShowResp.Base.Transaction))
         {
             Resp = new ShowMessageFromWX.Resp();
             Resp.FromProto(ap.ShowResp);
         }
         if (!string.IsNullOrEmpty(ap.PayReq.Base.Transaction))
         {
             Req = new SendPay.Req();
             Req.FromProto(ap.PayReq);
         }
         if (!string.IsNullOrEmpty(ap.PayResp.Base.Transaction))
         {
             Resp = new SendPay.Resp();
             Resp.FromProto(ap.PayResp);
         }
     }
 }