本文整理汇总了C#中IPage.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IPage.GetType方法的具体用法?C# IPage.GetType怎么用?C# IPage.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPage
的用法示例。
在下文中一共展示了IPage.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public PageJavaScriptProjection Create(IPage page)
{
IJavaScriptAccessor jsAccessor = null;
Type pageType;
if (page is IProxy)
{
pageType = page.GetType().BaseType;
}
else
{
pageType = page.GetType();
}
string key = "JAVASCRIPTRENDERER-" + pageType.Name.ToUpperInvariant();
if (containerProvider.CurrentScope.IsRegisteredWithKey<IJavaScriptAccessor>(key))
{
jsAccessor = containerProvider.CurrentScope
.ResolveKeyed<IJavaScriptAccessor>(key, new Parameter[]
{
new PositionalParameter(0, page)
});
}
if (jsAccessor == null)
{
throw new CmsException(string.Format("No page javascript accessor was found for the page type {0}.", pageType.FullName));
}
var jsProjection = new PageJavaScriptProjection(page, jsAccessor);
return jsProjection;
}
示例2: Create
public PageStylesheetProjection Create(IPage page, IEnumerable<IOptionValue> options)
{
IStylesheetAccessor jsAccessor = null;
Type pageType;
if (page is IProxy)
{
pageType = page.GetType().BaseType;
}
else
{
pageType = page.GetType();
}
string key = "STYLESHEETRENDERER-" + pageType.Name.ToUpperInvariant();
if (containerProvider.CurrentScope.IsRegisteredWithKey<IStylesheetAccessor>(key))
{
jsAccessor = containerProvider.CurrentScope
.ResolveKeyed<IStylesheetAccessor>(key, new Parameter[]
{
new PositionalParameter(0, page),
new PositionalParameter(1, options)
});
}
if (jsAccessor == null)
{
throw new CmsException(string.Format("No page style sheet accessor was found for the page type {0}.", pageType.FullName));
}
var jsProjection = new PageStylesheetProjection(page, jsAccessor);
return jsProjection;
}
示例3: OnAppearing
public virtual async Task OnAppearing(IPage CurrentPage)
{
if (this.CurrentPage == null || CurrentPage.GetType () != this.CurrentPage.GetType ()) {
this.SetCurrentPage = CurrentPage;
}
}
示例4: OnNavigatingTo
public virtual async Task OnNavigatingTo (IPage CurrentPage)
{
if (this.CurrentPage == null || CurrentPage.GetType () != this.CurrentPage.GetType ()) {
this.SetCurrentPage = CurrentPage;
}
}
示例5: ResolveControllerName
/// <summary>
/// Resolves the name of the controller.
/// </summary>
/// <param name="currentPage">The current page.</param>
/// <returns></returns>
/// <exception cref="System.NullReferenceException">Missing ContentType attribute</exception>
protected string ResolveControllerName(IPage currentPage)
{
var contentTypeAttribute = currentPage.GetType().GetAttribute<ContentTypeAttribute>();
if (contentTypeAttribute == null)
{
throw new NullReferenceException("Missing ContentType attribute");
}
return contentTypeAttribute.ControllerType == null
? currentPage.GetType().Name
: this.ControllerMapper.GetControllerName(contentTypeAttribute.ControllerType);
}
示例6: GetWriteablePage
public IPage GetWriteablePage(ulong commitId, IPage page)
{
if (!CanWrite) throw new InvalidOperationException("Attempt to retrieve a writeable page from a read-only store");
var p = page as BinaryFilePage;
if (p == null)
{
throw new ArgumentException("Expected a BinaryFilePage instance. Received a " + page.GetType().FullName);
}
if (p.IsWriteable)
{
return p;
}
p.MakeWriteable(commitId);
return p;
}