Example #1
0
 protected virtual void OnPost(PushPostEventArgs args)
 {
     if (PushPost != null)
     {
         PushPost(this, args);
     }
 }
Example #2
0
        protected virtual void DoPost(HttpListenerRequest request, NameValueCollection headers)
        {
            string contentType  = request.ContentType;
            string sig          = request.Headers["X-Hub-Signature"];
            string hubSignature = null;

            if (!string.IsNullOrEmpty(sig) && sig.Length > 4)
            {
                hubSignature = sig.Substring(4);
            }
            SyndicationFeed feed = null;

            try
            {
                using (var reader = new XmlTextReader(request.InputStream))
                {
                    feed = SyndicationFeed.Load(reader);
                }
            }
            catch
            {
                // There was something wrong with the feed.
                // Just ignore it and return.
                return;
            }
            var args = new PushPostEventArgs(contentType, hubSignature, feed);

            OnPost(args);
        }
 protected virtual void OnPost(PushPostEventArgs args)
 {
     if (PushPost != null)
     {
         PushPost(this, args);
     }
 }
 protected virtual void DoPost(HttpListenerRequest request, NameValueCollection headers)
 {
     string contentType = request.ContentType;
     string sig = request.Headers["X-Hub-Signature"];
     string hubSignature = null;
     if (!string.IsNullOrEmpty(sig) && sig.Length > 4)
     {
         hubSignature = sig.Substring(4);
     }
     SyndicationFeed feed = null;
     try
     {
         using (var reader = new XmlTextReader(request.InputStream))
         {
             feed = SyndicationFeed.Load(reader);
         }
     }
     catch
     {
         // There was something wrong with the feed.
         // Just ignore it and return.
         return;
     }
     var args = new PushPostEventArgs(contentType, hubSignature, feed);
     OnPost(args);
 }