public static HttpResponseMessage GetResponseMessage(HttpRequestMessage request, LayoutModel model)
 {
     var root = request.GetRequestContext().VirtualPathRoot;
     var html = AssetManager.GetLayoutHtml(model, root);
     return new HttpResponseMessage()
     {
         Content = new StringContent(html, Encoding.UTF8, "text/html")
     };
 }
 public static string GetLayoutHtml(LayoutModel model, string rootUrl)
 {
     model.Server = model.Server ?? "Thinktecture IdentityServer";
     var json = Newtonsoft.Json.JsonConvert.SerializeObject(model, Newtonsoft.Json.Formatting.None, new Newtonsoft.Json.JsonSerializerSettings() { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() });
     return LoadResourceString("Thinktecture.IdentityServer.Core.Assets.app.layout.html",
         new {
             server = model.Server,
             rootUrl,
             layoutModel = json, 
         });
 }
        public static string GetLayoutHtml(LayoutModel model, string rootUrl)
        {
            if (model == null) throw new ArgumentNullException("model");

            if (rootUrl == null) rootUrl = "";
            if (rootUrl.EndsWith("/")) rootUrl = rootUrl.Substring(0, rootUrl.Length - 1);

            model.Server = model.Server ?? "Thinktecture IdentityServer";
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(model, Newtonsoft.Json.Formatting.None, new Newtonsoft.Json.JsonSerializerSettings() { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() });
            return LoadResourceString("Thinktecture.IdentityServer.Core.Assets.app.layout.html",
                new {
                    server = model.Server,
                    rootUrl,
                    layoutModel = json, 
                });
        }
        public static HttpResponseMessage GetResponseMessage(HttpRequestMessage request, LayoutModel model)
        {
            var root = request.GetRequestContext().VirtualPathRoot;
            var html = AssetManager.GetLayoutHtml(model, root);

            return(new HttpResponseMessage()
            {
                Content = new StringContent(html, Encoding.UTF8, "text/html")
            });
        }
 public EmbeddedHtmlResult(HttpRequestMessage request, LayoutModel model)
 {
     this.request = request;
     this.model   = model;
 }
 public EmbeddedHtmlResult(HttpRequestMessage request, LayoutModel model)
 {
     this.request = request;
     this.model = model;
 }