當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。