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


C# IPublishedContent.GetTemplateAlias方法代码示例

本文整理汇总了C#中IPublishedContent.GetTemplateAlias方法的典型用法代码示例。如果您正苦于以下问题:C# IPublishedContent.GetTemplateAlias方法的具体用法?C# IPublishedContent.GetTemplateAlias怎么用?C# IPublishedContent.GetTemplateAlias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPublishedContent的用法示例。


在下文中一共展示了IPublishedContent.GetTemplateAlias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerializableNode

        public SerializableNode(IPublishedContent content, bool traverseChildren, bool getTemplateAlias = true)
        {
            if (traverseChildren)
                this.Children = content.Children.Select(c => new SerializableNode(c, traverseChildren));
            else
                this.Children = new List<SerializableNode>();

            //this.ContentType = content.ContentType;
            //this.ContentSet = new List<PortableNode>();// content.ContentSet;
            this.CreateDate = content.CreateDate;
            this.CreatorId = content.CreatorId;
            this.CreatorName = content.CreatorName;
            this.DocumentTypeAlias = content.DocumentTypeAlias;
            this.DocumentTypeId = content.DocumentTypeId;
            this.Id = content.Id;
            this.IsDraft = content.IsDraft;
            this.ItemType = content.ItemType;
            this.Level = content.Level;
            this.Name = content.Name;
            //this.Parent = content.Parent;
            this.ParentId = (content.Parent == null) ? -1 : content.Parent.Id;
            this.Path = content.Path;
            //this.Properties = content.Properties;
            //this.Properties = content.Properties.Select(p=>new SerializableProperty(p)).ToList<IPublishedProperty>();// new List<IPublishedProperty>();
            this.PropertiesDictionary = content.Properties.ToDictionary(k => k.PropertyTypeAlias, k => k.DataValue);
            this.SortOrder = content.SortOrder;
            this.TemplateId = content.TemplateId;
            this.TemplateAlias = content.GetTemplateAlias();
            this.UpdateDate = content.UpdateDate;
            this.Url = content.Url;
            this.UrlName = content.UrlName;
            this.Version = content.Version;
            this.WriterId = content.WriterId;
            this.WriterName = content.WriterName;
        }
开发者ID:joeriks,项目名称:Tapas,代码行数:35,代码来源:SerializableNode.cs

示例2: PageViewModel

 public PageViewModel(IPublishedContent model)
 {
     Id = model.Id;
     Name = model.Name;
     Url = model.Url;
     Path = model.Path;
     ContentTypeAlias = model.ContentType.Alias;
     CreateDate = model.CreateDate;
     Template = model.GetTemplateAlias();
     TemplateId = model.TemplateId;
     Properties = new Dictionary<string,PropertyViewModel>();
     foreach(var x in model.Properties) {
         Properties.Add(x.PropertyTypeAlias, new PropertyViewModel() { DataValue = x.DataValue, HasValue = x.HasValue, PropertyTypeAlias = x.PropertyTypeAlias, Value = x.Value, XPathValue = x.XPathValue });
     }
 }
开发者ID:sbosell,项目名称:umbraco-hearts-angular,代码行数:15,代码来源:PageViewModel.cs

示例3: ContentHasTemplate

 /// <summary>
 /// Quick fix to all for checking if a content item has a template
 /// </summary>
 /// <param name="content">The <see cref="IPublishedContent"/></param>
 /// <returns>True or false indicating whether or not the content has an associated template selected</returns>
 private static bool ContentHasTemplate(IPublishedContent content)
 {
     try
     {
         var template = content.GetTemplateAlias();
         return !string.IsNullOrEmpty(template);
     }
     catch (Exception)
     {
         return false;
     }
 }
开发者ID:naepalm,项目名称:Buzz.Hybrid,代码行数:17,代码来源:LinkHelper.cs


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