Beispiel #1
0
 public void set3rdNotifyInfo(Notify notify)
 {
     if (notify.Title == null || notify.Content == null)
     {
         throw new Exception("notify title or content cannot be null");
     }
     NotifyInfo.Builder builder = NotifyInfo.CreateBuilder().SetTitle(notify.Title).SetContent(notify.Content);
     if (this.typeNotNull(notify.Type))
     {
         builder.SetType(notify.Type);
         if (!string.IsNullOrEmpty(notify.Payload))
         {
             builder.SetPayload(notify.Payload);
         }
         if (!string.IsNullOrEmpty(notify.Intent))
         {
             if (notify.Intent.Length > GtConfig.getTransIntentLength())
             {
                 throw new Exception("intent size overlimit " + (object)GtConfig.getTransIntentLength());
             }
             if (!this.reg.IsMatch(notify.Intent))
             {
                 throw new Exception("intent format error,should start with \"intent:#Intent;\",end with \";end\" ");
             }
             builder.SetIntent(notify.Intent);
         }
         if (!string.IsNullOrEmpty(notify.Url))
         {
             builder.SetUrl(notify.Url);
         }
     }
     this.pushInfo.SetNotifyInfo(builder.Build()).SetValidNotify(true);
 }
Beispiel #2
0
        public IGtHttpProxy()
        {
            string httpProxyIp   = GtConfig.getHttpProxyIp();
            int    httpProxyPort = GtConfig.getHttpProxyPort();

            if (string.IsNullOrWhiteSpace(httpProxyIp))
            {
                return;
            }
            this._host   = httpProxyIp;
            this._port   = httpProxyPort;
            this._user   = GtConfig.getHttpProxyUser();
            this._passwd = GtConfig.getHttpProxyPasswd();
        }