本文整理汇总了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)
};
}
示例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;
}
示例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;
}
示例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));
}
示例5: IsSite
public static bool IsSite(Item item)
{
return item.IsDerived(Templates.Site.ID);
}
示例6: IncludeInNavigation
private bool IncludeInNavigation(Item item)
{
return item.IsDerived(Templates.Navigable.ID) && MainUtil.GetBool(item[Templates.Navigable.Fields.ShowInNavigation], false);
}
示例7: DataPoint
public DataPoint(Item item)
{
Assert.IsTrue(item.IsDerived(Templates.DataPoint.ID), $"item must derive {0}",Templates.DataPoint.ID);
_item = item;
}
示例8: IsSiteConfigurationItem
private bool IsSiteConfigurationItem(Item item)
{
return item.IsDerived(MultiSite.Templates.SiteConfiguration.ID);
}
示例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()
};
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}