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(); } }
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(); }); }
public void Dispose(EndpointHandler endPointHandler) { //throw new NotImplementedException(); }
public void ProcessHandler(EndpointHandler endPointHandler) { //throw new NotImplementedException(); }