本文整理汇总了C#中MrCMS.Entities.Documents.Web.Webpage.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Webpage.GetType方法的具体用法?C# Webpage.GetType怎么用?C# Webpage.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MrCMS.Entities.Documents.Web.Webpage
的用法示例。
在下文中一共展示了Webpage.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInfo
private ISitemapGenerationInfo GetInfo(Webpage webpage)
{
ISitemapGenerationInfo generationInfo = null;
if (webpage == null)
return null;
var typeName = webpage.GetType().FullName;
if (SitemapGenerationInfoTypes.ContainsKey(typeName))
{
generationInfo = _kernel.Get(SitemapGenerationInfoTypes[typeName]) as ISitemapGenerationInfo;
}
return generationInfo ?? _kernel.Get<DefaultSitemapGenerationInfo>();
}
示例2: Process
public void Process(ViewResult result, Webpage webpage)
{
if (string.IsNullOrWhiteSpace(result.ViewName))
{
if (webpage.PageTemplate != null && !string.IsNullOrWhiteSpace(webpage.PageTemplate.PageTemplateName))
{
result.ViewName = webpage.PageTemplate.PageTemplateName;
}
else
{
result.ViewName = webpage.GetType().Name;
}
}
if (string.IsNullOrWhiteSpace(result.MasterName))
{
Layout layout = _getCurrentLayout.Get(webpage);
if (layout != null)
{
result.MasterName = layout.GetLayoutName();
}
}
}
示例3: GetChildNodeTransforms
private List<MobileFriendlyNavigationChildNode> GetChildNodeTransforms(Dictionary<Webpage, List<MobileFriendlyNavigationChildNode>> mobileFriendlyNavigationChildNodes, Webpage parent)
{
if (parent == null)
return new List<MobileFriendlyNavigationChildNode>();
var nodes = mobileFriendlyNavigationChildNodes[parent];
if (nodes.Any() && !(parent is SitemapPlaceholder))
{
foreach (var node in nodes)
node.DisplayOrder = node.DisplayOrder + 1;
nodes.Insert(0, new MobileFriendlyNavigationChildNode
{
ChildCount = 0,
Id = parent.Id,
Name = parent.Name,
ParentId = parent.Id,
PublishOn = parent.PublishOn,
UrlSegment = parent.LiveUrlSegment,
DocumentType = parent.GetType().FullName,
DisplayOrder = 0
});
}
return _processChildNodes.Process(nodes, parent).OrderBy(node => node.DisplayOrder).ToList();
}
示例4: GetController
public Controller GetController(RequestContext requestContext, Webpage webpage, string httpMethod)
{
string controllerName = GetControllerName(webpage, httpMethod);
var controller = ControllerFactory.CreateController(requestContext, controllerName) as Controller;
controller.ControllerContext = new ControllerContext(requestContext, controller)
{
RouteData = requestContext.RouteData
};
var routeValueDictionary = new RouteValueDictionary();
routeValueDictionary["controller"] = controllerName;
routeValueDictionary["action"] = GetActionName(webpage, httpMethod);
routeValueDictionary["page"] = webpage;
controller.RouteData.Values.Merge(routeValueDictionary);
var type = webpage.GetType();
if (MrCMSApp.AppWebpages.ContainsKey(type))
{
controller.RouteData.DataTokens["app"] = MrCMSApp.AppWebpages[type];
}
return controller;
}