本文整理汇总了C#中ContentItem.GetChild方法的典型用法代码示例。如果您正苦于以下问题:C# ContentItem.GetChild方法的具体用法?C# ContentItem.GetChild怎么用?C# ContentItem.GetChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentItem
的用法示例。
在下文中一共展示了ContentItem.GetChild方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Navigate
public virtual ContentItem Navigate(ContentItem startingPoint, string path)
{
return startingPoint.GetChild(path)
?? sources.ResolvePath(startingPoint, path).CurrentItem
?? virtualNodes.Get(startingPoint.Path + path.TrimStart('/'))
?? virtualNodes.Get(path);
}
示例2: GetChild
protected override ContentItem GetChild(ContentItem item)
{
ContentItem childItem = item.GetChild(DefaultChildName);
if (childItem == null)
{
childItem = CreateChild(item, ChildType);
}
return childItem;
}
示例3: Parse
protected virtual ContentItem Parse(ContentItem current, string url)
{
if (current == null) throw new ArgumentNullException("current");
Debug.WriteLine("Parsing " + url);
url = CleanUrl(url);
if (url.Length == 0)
return current;
return current.GetChild(url) ?? NotFoundPage(url);
}
示例4: Navigate
public ContentItem Navigate(ContentItem startingPoint, string path)
{
return startingPoint.GetChild(path)
?? virtualNodes.Get(path);
}
示例5: IsNameOccupiedOnDestination
/// <summary>Checks that destination have no child item with the same name.</summary>
public virtual bool IsNameOccupiedOnDestination(ContentItem source, ContentItem destination, bool excludeMyself = true)
{
if (source == null) throw new ArgumentNullException("source");
if (destination == null) throw new ArgumentNullException("destination");
ContentItem existingItem = destination.GetChild(source.Name);
if (existingItem == null)
return false;
if (excludeMyself && existingItem == source)
return false;
if (!excludeMyself && source.Name == source.ID.ToString())
return false;
return true;
}
示例6: Navigate
public ContentItem Navigate(ContentItem startingPoint, string path)
{
return startingPoint.GetChild(path)
?? virtualNodes.Get(startingPoint.Path + path.TrimStart('/'))
?? virtualNodes.Get(path);
}
示例7: Parse
protected virtual ContentItem Parse(ContentItem current, Url url)
{
if (current == null) throw new ArgumentNullException("current");
logger.Debug("Parsing " + url);
var path = CleanUrl(url.PathAndQuery);
if (path.Length == 0)
return current;
return current.GetChild(path)
?? NotFoundPage(url);
}
示例8: IsNameOccupiedOnDestination
/// <summary>Checks that destination have no child item with the same name.</summary>
public virtual bool IsNameOccupiedOnDestination(ContentItem source, ContentItem destination)
{
if (source == null) throw new ArgumentNullException("source");
if (destination == null) throw new ArgumentNullException("destination");
ContentItem existingItem = destination.GetChild(source.Name);
return existingItem != null && existingItem != source;
}
示例9: Parse
protected virtual ContentItem Parse(ContentItem current, string url)
{
if (current == null) throw new ArgumentNullException("current");
url = CleanUrl(url);
if (url.Length == 0)
return current;
// Check if start of URL contains a language identifier.
foreach (Language language in Context.Current.LanguageManager.GetAvailableLanguages())
if (url.StartsWith(language.Name, StringComparison.InvariantCultureIgnoreCase))
throw new NotImplementedException();
return current.GetChild(url) ?? NotFoundPage(url);
}