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


C# ContentItem.GetChildren方法代码示例

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


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

示例1: GetItemsInZone

        public override ItemList GetItemsInZone(ContentItem parentItem, string zoneName)
        {
            if(zoneName.EndsWith("None"))
                return new ItemList();
            if (zoneName.EndsWith("All"))
                return parentItem.GetChildren(new DelegateFilter(ci => ci.ZoneName != null));

            return parentItem.GetChildren(zoneName);
        }
开发者ID:spmason,项目名称:n2cms,代码行数:9,代码来源:PageZoneAdapter.cs

示例2: GetParts

        public override System.Collections.Generic.IEnumerable<ContentItem> GetParts(ContentItem belowParentItem, string inZoneNamed, string filteredForInterface)
        {
            if(inZoneNamed.EndsWith("None"))
                return new ItemList();
            if (inZoneNamed.EndsWith("All"))
                return belowParentItem.GetChildren(new DelegateFilter(ci => ci.ZoneName != null));

            return belowParentItem.GetChildren(inZoneNamed);
        }
开发者ID:brianmatic,项目名称:n2cms,代码行数:9,代码来源:PageZoneAdapter.cs

示例3: GetChildren

 protected virtual IEnumerable<ContentItem> GetChildren(ContentItem currentItem)
 {
     IEnumerable<ContentItem> children = currentItem.GetChildren();
     if (Filter != null)
         children = Filter(children);
     return children;
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:7,代码来源:HierarchyBuilder.cs

示例4: GetChildren

    private static N2.Collections.ItemList GetChildren(ContentItem parentItem)
    {
        N2.Collections.ItemFilter trashFilter = new N2.Collections.TypeFilter(true, typeof(N2.Edit.Trash.TrashContainerItem));
        N2.Collections.ItemFilter folderFilter = new N2.Collections.TypeFilter(true, typeof(FolderItem));
        N2.Collections.ItemFilter imageFilter = new N2.Collections.TypeFilter(true, typeof(ImageItem));

        return parentItem.GetChildren(trashFilter, folderFilter, imageFilter);
    }
开发者ID:phobos-consulting,项目名称:toodyaystone,代码行数:8,代码来源:NavigationHelper.cs

示例5: AddReferencesRecursive

 protected void AddReferencesRecursive(ContentItem current, ItemList referrers)
 {
     referrers.AddRange(Find.Items.Where.Detail().Eq(Item).Select());
     foreach (ContentItem child in current.GetChildren())
     {
         AddReferencesRecursive(child, referrers);
     }
 }
开发者ID:spmason,项目名称:n2cms,代码行数:8,代码来源:ReferencingItems.ascx.cs

示例6: AddReferencesRecursive

		protected void AddReferencesRecursive(ContentItem current, ItemList referrers)
		{
			referrers.AddRange(Content.Search.Repository.Find(Parameter.Equal(null, Item).Detail()));
				//Find.Items.Where.Detail().Eq(Item).Select());
			foreach (ContentItem child in current.GetChildren())
			{
				AddReferencesRecursive(child, referrers);
			}
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:9,代码来源:ReferencingItems.ascx.cs

示例7: UpdateEditor

		public override void UpdateEditor(ContentItem item, Control editor)
		{
			TextBox tb = (TextBox)editor;
			tb.Text = string.Empty;
			foreach (ContentItem child in item.GetChildren())
			{
				tb.Text += child.Title + Environment.NewLine;
			}
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:9,代码来源:EditableOptionsAttribute.cs

示例8: GetChildren

 /// <summary>Gets the children of the given item for the given user interface.</summary>
 /// <param name="parent">The item whose children to get.</param>
 /// <param name="userInterface">The interface where the children are displayed.</param>
 /// <returns>An enumeration of the children.</returns>
 public virtual IEnumerable<ContentItem> GetChildren(ContentItem parent, string userInterface)
 {
     foreach (var child in parent.GetChildren(new AccessFilter(WebContext.User, Security)))
     {
         yield return child;
     }
     if (Interfaces.Managing == userInterface)
     {
         foreach (var child in NodeFactory.GetChildren(parent.Path))
         {
             yield return child;
         }
     }
 }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:18,代码来源:NodeAdapter.cs

示例9: GetFiles

 private static IEnumerable GetFiles(ContentItem contentItem, FileType fileType)
 {
     IEnumerable<ContentItem> files = contentItem.GetChildren().Pages().Published().Authorized(Operations.Read);
     switch (fileType)
     {
         case FileType.Image :
             files = files.Where(f => f is FileSystem.Images.Image);
             break;
     }
     return files.Select(ci => new
         {
             name = ci.Title,
             url = GetUrl(fileType, ci),
             imageUrl = GetImageUrl(ci)
         });
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:16,代码来源:FileManagerUserControl.ascx.cs

示例10: HasChildren

 /// <summary>Returns true when an item has children.</summary>
 /// <param name="filter">The filter to apply.</param>
 /// <param name="parent">The item whose childrens existence is to be determined.</param>
 /// <returns>True when there are children.</returns>
 public virtual bool HasChildren(ContentItem parent, ItemFilter filter)
 {
     return parent.GetChildren(filter).Count > 0;
 }
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:8,代码来源:NodeAdapter.cs

示例11: RecurseTree

 /// <summary>
 /// Builds up the entire site tree recursively, adding items to the list
 /// </summary>
 /// <param name="list">This should be an empty list</param>
 /// <param name="parent">This should be called using the root item</param>
 private void RecurseTree(IList<ContentItem> list, ContentItem parent)
 {
     // TODO: add caching?
     foreach (var item in parent.GetChildren())
     {
         if (item.Visible && item.IsPage) // TODO make this a setting
         {
             list.Add(item);
             RecurseTree(list, item);
         }
     }
 }
开发者ID:sergheizagaiciuc,项目名称:n2cms,代码行数:17,代码来源:GoogleSiteMapHandler.cs

示例12: ApplyRulesRecursive

        private void ApplyRulesRecursive(ContentItem item, IEnumerable<string> allowedOperations)
        {
            // Only apply the rules if the current user has permission to administer this item.
            if (Engine.SecurityManager.IsAuthorized(item, User, Operations.Administer))
                ApplyRules(item, allowedOperations);

            // Apply recursively.
            ContentItem[] children = item.GetChildren().ToArray();
            foreach (ContentItem child in children)
                ApplyRulesRecursive(child, allowedOperations);
        }
开发者ID:dpawatts,项目名称:zeus,代码行数:11,代码来源:Default.aspx.cs

示例13: RecurseTree

 /// <summary>
 /// Builds up the entire site tree recursively, adding items to the list
 /// </summary>
 /// <param name="list">This should be an empty list</param>
 /// <param name="parent">This should be called using the root item</param>
 private static void RecurseTree(IList<ContentItem> list, ContentItem parent)
 {
     // TODO: add caching?
     foreach (var item in parent.GetChildren().Visible().Pages())
     {
         list.Add(item);
         RecurseTree(list, item);
     }
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:14,代码来源:GoogleSiteMapHandler.cs

示例14: GetTranslations

		private static IEnumerable<StartPage> GetTranslations(ContentItem currentPage)
		{
			return currentPage.GetChildren().OfType<StartPage>();
		}
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:4,代码来源:Defaults.cs

示例15: AddReferencesRecursive

 protected void AddReferencesRecursive(ContentItem current, List<ContentItem> referrers)
 {
     referrers.AddRange(Context.Finder.QueryItems().Where(ci => ci.Details.OfType<LinkProperty>().Any(ld => ld.LinkedItem == current)));
     foreach (ContentItem child in current.GetChildren())
         AddReferencesRecursive(child, referrers);
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:6,代码来源:ReferencingItems.ashx.cs


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