当前位置: 首页>>代码示例>>C#>>正文


C# Webpage.GetType方法代码示例

本文整理汇总了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>();
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:13,代码来源:SiteMapElementAppender.cs

示例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();
                }
            }
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:23,代码来源:ProcessWebpageViews.cs

示例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();
 }
开发者ID:neozhu,项目名称:Ecommerce,代码行数:23,代码来源:MobileFriendlyNavigationService.cs

示例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;
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:24,代码来源:ControllerManager.cs


注:本文中的MrCMS.Entities.Documents.Web.Webpage.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。