Esempio n. 1
0
 public void Dispose(EndpointHandler endpointHandler)
 {
     if (endpointHandler.AcceptType == ContentType.JSON.Description() || endpointHandler.AcceptType == ContentType.JSONP.Description())
     {
         endpointHandler.data = TemplatePlugin.current.Tags;
     }
     else
     {
         endpointHandler.data = TemplatePlugin.current.ToString();
     }
 }
Esempio n. 2
0
        public void ProcessHandler(EndpointHandler endpointHandler)
        {
            if (TemplatePlugin.current != null)
            {
                StateBag.Current.Reset(TemplatePlugin.current);
                TemplatePlugin.current.Set("currenttime", DateTime.Now.ToString("M/d - h:mmtt").ToLower());
                TemplatePlugin.current.Set("domain", endpointHandler.context.Request.Url.Host);
                TemplatePlugin.current.Set("like", endpointHandler.context.Request.Url.ToString().ToURL());
                try
                {
                    endpointHandler.context.Response.AppendHeader("ServeTime", (DateTime.Now.Subtract((DateTime)endpointHandler.context.Items["Time"])).TotalMilliseconds.ToString() + "ms");
                    endpointHandler.context.Response.AppendHeader("Queries", endpointHandler.context.Items["Queries"].ToString());
                }
                catch
                {
                }
            }



            //endpointHandler.ContentTypeHandlers.Add(ContentType.HTML.Description(), (EndpointHandler e) => { return e.data.ToString(); });
        }
Esempio n. 3
0
 public void Dispose(EndpointHandler endPointHandler)
 {
     //throw new NotImplementedException();
 }
Esempio n. 4
0
 public void ProcessHandler(EndpointHandler endPointHandler)
 {
     //throw new NotImplementedException();
 }