本文整理汇总了C#中Page.getPageInfoFromUrl方法的典型用法代码示例。如果您正苦于以下问题:C# Page.getPageInfoFromUrl方法的具体用法?C# Page.getPageInfoFromUrl怎么用?C# Page.getPageInfoFromUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page.getPageInfoFromUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StaticUrl
public Inject StaticUrl(string url)
{
if (S.isSessionLost()) { return lostInject(); } //check session
if (!string.IsNullOrEmpty(url))
{
var arrUrl = url.Split('\"');
if (arrUrl[0].IndexOf("+") < 0)
{
//found page with no query in url
var page = new Page(S);
//parse URL
page.Url = page.parseUrl(url.ToLower().Replace(" ", "-"));
//get page Info
page.getPageInfoFromUrl();
//get static page class
if(page.pageService != "")
{
var service = page.getStaticPage(page.pageService);
var response = service.LoadSubPage(page.Url.path.Replace(page.pagePathName + "/", ""));
S.javascript.Add("static-page", "S.url.push('" + page.pageTitle + "','" + url.Replace(" ", "-") + "');");
response.js =
S.cssFiles.renderCssFiles(false) + "\n" +
S.javascriptFiles.renderJavascriptFiles(false, S.javascript.renderJavascript(false));
return response;
}
}
}
return new Inject();
}
示例2: PageRequest
public PageRequest(Server server, HttpContext context)
{
//the Pipeline.PageRequest is simply the first page request for a Websilk website.
S = new Core(server, context);
var page = new Page(S);
S.isFirstLoad = true;
if (S.isFirstLoad == true)
{
getUserAgent(context);
}
//parse URL
page.Url = page.parseUrl(S.Request.Path.ToString().ToLower().Replace(" ", "-"));
//get page Info
page.getPageInfoFromUrl();
//register initial javascript
S.javascript.Add("init", "S.init(" + (S.User.useAjax ? "true" : "false") + "," + page.pageId + "," + page.pageType + ",'" + page.pagePathName + "','" + page.pageTitle + "','" + page.PageTitleForBrowserTab + "'," + page.websiteId + ",'" + page.websiteTitle + "', '" + (S.Request.IsHttps ? "https://" : "http://") + "','" + page.Url.host + "');");
//render the page
var response = page.Render();
//unload the core (before sending response)
S.Unload();
//render the server response
S.Response.ContentType = "text/html";
S.Response.WriteAsync(response);
}
示例3: Url
public PageRequest Url(string url)
{
if (S.isSessionLost()) { return lostPageRequest(); } //check session
var response = new PageRequest();
if (!string.IsNullOrEmpty(url))
{
var arrUrl = url.Split('\"');
if (arrUrl[0].IndexOf("+") < 0)
{
//found page with no query in url
var page = new Page(S);
//parse URL
page.Url = page.parseUrl(url.ToLower().Replace(" ", "-"));
//get page Info
page.getPageInfoFromUrl();
//load page content
page.Render();
//write to console
Console.WriteLine("Load page: " + page.pageTitle);
//set up response
response.components = new List<PageComponent>();
response.css = "";
response.editor = "";
response.js = "";
response.pageTitle = page.pageTitle;
response.url = url;
response.pageId = page.pageId;
response.already = true;
//load page components, excluding components from the currently loaded page
//render each component for the page
}
}
return response;
}
示例4: GeneratePage
private void GeneratePage(string name)
{
var P = new Page(S);
var page = new Page.structPage();
var scaffold = new Scaffold(S, "/App/Content/themes/default/layout.html");
var panels = P.loadLayout(scaffold);
var panelHead = panels[0];
var panelBody = panels[1];
var panelFoot = panels[2];
page.layers = new List<int>();
page.panels = new List<Panel>();
page.components = new List<Component>();
if (name == "home")
{
//generate a home page
P.Url = P.parseUrl("/home");
P.getPageInfoFromUrl();
}else if (name == "login")
{
//generate login page
P.Url = P.parseUrl("/login");
P.getPageInfoFromUrl();
var cLogin = P.loadComponent(new Websilk.Components.Login(), panelBody, panelBody.cells[0], true);
var posLogin = cLogin.position[4];
posLogin.padding.top = 50;
cLogin.position[4] = posLogin;
}else if (name == "access-denied")
{
//generate login page
P.Url = P.parseUrl("/access-denied");
P.getPageInfoFromUrl();
var cLogin = P.loadComponent(new Websilk.Components.Login(), panelBody, panelBody.cells[0], true);
var posLogin = cLogin.position[4];
posLogin.padding.top = 50;
cLogin.position[4] = posLogin;
}
page.pageId = P.pageId;
//add components from head, body, & foot
foreach (var component in panelHead.cells[0].components)
{
page.components.Add(component);
}
foreach (var component in panelBody.cells[0].components)
{
page.components.Add(component);
}
foreach (var component in panelFoot.cells[0].components)
{
page.components.Add(component);
}
//save page to file
S.Util.Serializer.SaveToFile(page, S.Server.MapPath("/App/Content/websites/1/pages/" + page.pageId + "/page.json"), Newtonsoft.Json.Formatting.None);
}