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


C# Item.IsDerived方法代码示例

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


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

示例1: CreateNavigationItem

 private NavigationItem CreateNavigationItem(Item item, int level, int maxLevel = -1)
 {
     return new NavigationItem
     {
         Item = item,
         Url = (item.IsDerived(Templates.Link.ID) ? item.LinkFieldUrl(Templates.Link.Fields.Link) : item.Url()),
         Target = (item.IsDerived(Templates.Link.ID) ? item.LinkFieldTarget(Templates.Link.Fields.Link) : ""),
         IsActive = this.IsItemActive(item),
         Children = this.GetChildNavigationItems(item, level + 1, maxLevel)
     };
 }
开发者ID:mrodriguezr,项目名称:Sitecore_OM,代码行数:11,代码来源:NavigationRepository.cs

示例2: Repository

        public Repository(Item item)
        {

            Assert.IsTrue(item.IsDerived(Templates.Repository.ID),
                string.Format("'{0}' must be derrived from '{1}'", nameof(item), Templates.Repository.ID));
            _item = item;
        }
开发者ID:blacktambourine,项目名称:DiversusHackathon2016,代码行数:7,代码来源:Repository.cs

示例3: NewsRepository

 public NewsRepository(Item contextItem)
 {
     if (contextItem == null)
       {
     throw new ArgumentNullException(nameof(contextItem));
       }
       if (!contextItem.IsDerived(Templates.NewsFolder.ID))
       {
     throw new ArgumentException("Item must derive from NewsFolder", nameof(contextItem));
       }
       this.ContextItem = contextItem;
 }
开发者ID:Brad-Christie,项目名称:Habitat,代码行数:12,代码来源:NewsRepository.cs

示例4: IncludeInNavigation

 private bool IncludeInNavigation(Item item, bool forceShowInMenu = false)
 {
     return item.IsDerived(Templates.Navigable.ID) && (forceShowInMenu || MainUtil.GetBool(item[Templates.Navigable.Fields.ShowInNavigation], false));
 }
开发者ID:mrodriguezr,项目名称:Sitecore_OM,代码行数:4,代码来源:NavigationRepository.cs

示例5: IsSite

 public static bool IsSite(Item item)
 {
   return item.IsDerived(Templates.Site.ID);
 }
开发者ID:aehyok,项目名称:Habitat,代码行数:4,代码来源:SiteContext.cs

示例6: IncludeInNavigation

 private bool IncludeInNavigation(Item item)
 {
     return item.IsDerived(Templates.Navigable.ID) && MainUtil.GetBool(item[Templates.Navigable.Fields.ShowInNavigation], false);
 }
开发者ID:BIGANDYT,项目名称:Spitfire,代码行数:4,代码来源:NavigationRepository.cs

示例7: DataPoint

 public DataPoint(Item item)
 {
     Assert.IsTrue(item.IsDerived(Templates.DataPoint.ID), $"item must derive {0}",Templates.DataPoint.ID);
     _item = item;
 }
开发者ID:blacktambourine,项目名称:DiversusHackathon2016,代码行数:5,代码来源:DataPoint.cs

示例8: IsSiteConfigurationItem

 private bool IsSiteConfigurationItem(Item item)
 {
   return item.IsDerived(MultiSite.Templates.SiteConfiguration.ID);
 }
开发者ID:aehyok,项目名称:Habitat,代码行数:4,代码来源:SiteDefinitionsRepository.cs

示例9: CreateNavigationItem

 private NavigationItem CreateNavigationItem(Item item, int level, int maxLevel = -1)
 {
     var targetItem = item.IsDerived(Templates.Link.ID) ? item.TargetItem(Templates.Link.Fields.Link) : item;
     return new NavigationItem
            {
                Item = item,
                Url = item.IsDerived(Templates.Link.ID) ? item.LinkFieldUrl(Templates.Link.Fields.Link) : item.Url(),
                Target = item.IsDerived(Templates.Link.ID) ? item.LinkFieldTarget(Templates.Link.Fields.Link) : "",
                IsActive = this.IsItemActive(targetItem ?? item),
                Children = this.GetChildNavigationItems(item, level + 1, maxLevel),
                ShowChildren = !item.IsDerived(Templates.Navigable.ID) || item.Fields[Templates.Navigable.Fields.ShowChildren].IsChecked()
            };
 }
开发者ID:Sitecore,项目名称:Habitat,代码行数:13,代码来源:NavigationRepository.cs

示例10: GetPageAssetValue

        private string GetPageAssetValue(Item item, ID assetField)
        {
            if (item.IsDerived(Templates.PageAssets.ID))
            {
                var assetValue = item[assetField];
                if (!string.IsNullOrWhiteSpace(assetValue))
                    return assetValue;
            }

            return GetInheritedPageAssetValue(item, assetField);
        }
开发者ID:BIGANDYT,项目名称:Habitat,代码行数:11,代码来源:AddAssets.cs

示例11: DataSet

 public DataSet(Item dataset)
 {
     Assert.IsTrue(dataset.IsDerived(Templates.DataSet.ID),
         string.Format("'{0}' must be derrived from '{1}'", nameof(dataset), Templates.Repository.ID));
     _dataset = dataset;
 }
开发者ID:blacktambourine,项目名称:DiversusHackathon2016,代码行数:6,代码来源:DataSet.cs

示例12: Assert

 /// <summary>
 /// Asserts that the specified item complies with the requirements set by the clause attribute.
 /// </summary>
 /// <param name="item">The item to test for clause compliance.</param>
 /// <param name="type">The model class type that the item is being bound to.</param>
 /// <exception cref="ItemBinding.Model.BindingContracts.RequiredBaseTemplateException"></exception>
 public override void Assert(Item item, Type type)
 {
   if (!item.IsDerived(BaseTemplateId))
     throw new RequiredBaseTemplateException(item, BaseTemplateId, type);
 }
开发者ID:soen,项目名称:SitecoreItemBinding,代码行数:11,代码来源:RequiredBaseTemplateAttribute.cs

示例13: IsComplied

 /// <summary>
 /// Determines whether the specified item complies with the requirements set by the clause attribute.
 /// </summary>
 /// <param name="item">The item to test for clause compliance.</param>
 /// <returns>
 ///   <c>true</c> if the item complies with the clause requirements; otherwise <c>false</c>
 /// </returns>
 public override Boolean IsComplied(Item item)
 {
   return item.IsDerived(BaseTemplateId);
 }
开发者ID:soen,项目名称:SitecoreItemBinding,代码行数:11,代码来源:RequiredBaseTemplateAttribute.cs


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