Exemplo n.º 1
0
 public bool ValidateData(bool checkSummary = true)
 {
     if (string.IsNullOrEmpty(AppId))
     {
         throw new WXException(1, "AppID can't be empty.");
     }
     if (string.IsNullOrEmpty(SdkVersion) || string.IsNullOrEmpty(CheckContent) || string.IsNullOrEmpty(CheckSummary))
     {
         return(false);
     }
     if (Req == null && Resp == null)
     {
         return(false);
     }
     if (Req != null && !Req.ValidateData())
     {
         return(false);
     }
     if (Resp != null && !Resp.ValidateData())
     {
         return(false);
     }
     if (checkSummary)
     {
         string str = WXApiImpl.GetCheckSummary(CheckContent, SdkVersion, AppId);
         if ((str == null) || !str.Equals(CheckSummary, StringComparison.CurrentCultureIgnoreCase))
         {
             return(false);
         }
     }
     return(true);
 }