本文整理汇总了C#中Template.AddPageAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# Template.AddPageAssembly方法的具体用法?C# Template.AddPageAssembly怎么用?C# Template.AddPageAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template.AddPageAssembly方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTemplate
/// <summary>
/// Creates an isolated template class for the module to render
/// inside.
/// </summary>
public new void CreateTemplate()
{
template = new Template(core.Http.TemplatePath, "1301.html");
template.Parse("U_ACCOUNT", core.Hyperlink.AppendSid(Owner.AccountUriStub, true));
if (assembly != null)
{
template.AddPageAssembly(assembly);
template.SetProse(core.Prose);
}
List<string[]> breadCrumbParts = new List<string[]>();
breadCrumbParts.Add(new string[] { "forum", core.Prose.GetString("FORUM") });
breadCrumbParts.Add(new string[] { "mcp", core.Prose.GetString("MODERATOR_CONTROL_PANEL") });
Owner.ParseBreadCrumbs(core.Template, "BREADCRUMBS", breadCrumbParts);
}
示例2: CreateTemplate
/// <summary>
/// Creates an isolated template class for the module to render
/// inside.
/// </summary>
private new void CreateTemplate()
{
string formSubmitUri = string.Empty;
template = new Template(core.Http.TemplatePath, "1301.html");
if (Owner != null)
{
formSubmitUri = core.Hyperlink.AppendSid(Owner.UriStub + "forum/mcp", true);
template.Parse("U_MCP", core.Hyperlink.AppendSid(Owner.UriStub + "forum/mcp/", true));
template.Parse("S_MCP", core.Hyperlink.AppendSid(Owner.UriStub + "forum/mcp/", true));
}
template.AddPageAssembly(Assembly.GetCallingAssembly());
template.SetProse(core.Prose);
Form = new Form("control-panel", formSubmitUri);
Form.SetValues(core.Http.Form);
if (core.Http.Form["save"] != null)
{
Form.IsFormSubmission = true;
}
core.Template.Parse("IS_CONTENT", "FALSE");
List<string[]> breadCrumbParts = new List<string[]>();
breadCrumbParts.Add(new string[] { "forum", core.Prose.GetString("FORUM") });
breadCrumbParts.Add(new string[] { "mcp", core.Prose.GetString("MODERATOR_CONTROL_PANEL") });
Owner.ParseBreadCrumbs(core.Template, "BREADCRUMBS", breadCrumbParts);
}
示例3: CreateTemplate
/// <summary>
/// Creates an isolated template class for the module to render
/// inside.
/// </summary>
private void CreateTemplate()
{
string formSubmitUri = string.Empty;
template = new Template(core.Http.TemplatePath, "1301.html");
template.Medium = core.Template.Medium;
if (Owner != null)
{
formSubmitUri = core.Hyperlink.AppendSid(Owner.AccountUriStub, true);
template.Parse("U_ACCOUNT", formSubmitUri);
template.Parse("S_ACCOUNT", formSubmitUri);
}
template.AddPageAssembly(Assembly.GetCallingAssembly());
template.SetProse(core.Prose);
Form = new Form("control-panel", formSubmitUri);
Form.SetValues(core.Http.Form);
if (core.Http.Form["save"] != null)
{
Form.IsFormSubmission = true;
}
core.Template.Parse("IS_CONTENT", "FALSE");
template.Parse("SITE_TITLE", core.Settings.SiteTitle);
}
示例4: CreateTemplate
/// <summary>
/// Creates an isolated template class for the module to render
/// inside.
/// </summary>
public void CreateTemplate()
{
template = new Template(core.Http.TemplatePath, "1301.html");
template.Parse("U_ACCOUNT", core.Hyperlink.AppendSid(Owner.AccountUriStub, true));
if (assembly != null)
{
template.AddPageAssembly(assembly);
template.SetProse(core.Prose);
}
core.Template.Parse("IS_CONTENT", "FALSE");
}
示例5: TPage
//.........这里部分代码省略.........
httpTimer.Start();
#endif
session = new SessionState(Core, db, User, HttpContext.Current.Request, HttpContext.Current.Response);
loggedInMember = session.LoggedInMember;
#if DEBUG
httpTimer.Stop();
HttpContext.Current.Response.Write(string.Format("<!-- section A in {0} -->\r\n", httpTimer.ElapsedTicks / 10000000.0));
#endif
long loadStart = initTimer.ElapsedTicks;
tz = new UnixTime(core, UnixTime.UTC_CODE);
core.Session = session;
core.CoreDomain = AppDomain.CurrentDomain;
if (loggedInMember != null)
{
tz = loggedInMember.UserInfo.GetTimeZone;
}
// move it here
core.Tz = tz;
// As a security measure we use the http object to prevent
// applications hijacking the response output
core.Http = new Http();
Template.Path = core.Http.TemplatePath;
core.Prose = new Prose();
core.Prose.Initialise(core, "en");
//List<string> asmNames = core.GetLoadedAssemblyNames();
foreach (string asm in BoxSocial.Internals.Application.AssemblyNames.Keys)
{
core.Prose.AddApplication(asm);
}
//List<Assembly> asms = core.GetLoadedAssemblies();
foreach (Assembly asm in BoxSocial.Internals.Application.LoadedAssemblies.Values)
{
template.AddPageAssembly(asm);
}
template.SetProse(core.Prose);
string pageString = core.Http.Query["p"];
if (!string.IsNullOrEmpty(pageString))
{
string[] pages = pageString.Split(new char[] { ',' });
page = new int[pages.Length];
for (int i = 0; i < pages.Length; i++)
{
if (!int.TryParse(pages[i], out page[i]))
{
page[i] = 1;
}
}
}
else
{
page = new int[] { 1 };
}
string offsetString = core.Http.Query["o"];
if (!string.IsNullOrEmpty(offsetString))
{
string[] offsets = offsetString.Split(new char[] { ',' });
offset = new long[offsets.Length];
for (int i = 0; i < offsets.Length; i++)
{
if (!long.TryParse(offsets[i], out offset[i]))
{
offset[i] = 0;
}
}
}
else
{
offset = new long[] { 0 };
}
if (session != null && session.SignedIn && core.IsMobile && core.ResponseFormat == ResponseFormats.Html)
{
List<ApplicationEntry> applications = BoxSocial.Internals.Application.GetApplications(core, core.Session.LoggedInMember);
foreach (ApplicationEntry ae in applications)
{
BoxSocial.Internals.Application.LoadApplication(core, AppPrimitives.Member, ae);
}
core.InvokePostHooks(new HookEventArgs(core, AppPrimitives.Member, core.Session.LoggedInMember));
}
loadTime = (initTimer.ElapsedTicks - loadStart);
initTimer.Stop();
initTime += initTimer.ElapsedTicks;
}