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


C# Item.GetChildren方法代码示例

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


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

示例1: Render

        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            var psButtons = button.GetChildren();
            foreach (Item psButton in psButtons)
            {
                var msg = Message.Parse(this, psButton["Click"]);
                var scriptDb = msg.Arguments["scriptDB"];
                var scriptId = msg.Arguments["script"];

                if (string.IsNullOrWhiteSpace(scriptDb) || string.IsNullOrWhiteSpace(scriptId))
                {
                    continue;
                }

                var scriptItem = Factory.GetDatabase(scriptDb).GetItem(scriptId);
                if (scriptItem == null || !RulesUtils.EvaluateRules(scriptItem["ShowRule"], context.Items[0]))
                {
                    continue;
                }

                RenderLargeButton(output, ribbon, Control.GetUniqueID("script"),
                    Translate.Text(scriptItem.DisplayName),
                    scriptItem["__Icon"], string.Empty,
                    psButton["Click"],
                    RulesUtils.EvaluateRules(scriptItem["EnableRule"], context.Items[0]),
                    false, context);

                return;
            }
        }
开发者ID:GuitarRich,项目名称:Console,代码行数:30,代码来源:ContentEditorRibbonPanel.cs

示例2: ProcessChildren

        /// <summary>
        /// Processes the children.
        /// </summary>
        /// <param name="rootItem">The root item.</param>
        /// <param name="itemsRedirectsList">The items redirects list.</param>
        /// <param name="sectionsRedirectList">The sections redirect list.</param>
        /// <param name="regExList">The reg ex list.</param>
        /// <param name="itemsRedirectsListOut">The items redirects list out.</param>
        /// <param name="sectionsRedirectListOut">The sections redirect list out.</param>
        /// <param name="regExListOut">The reg ex list out.</param>
        private static void ProcessChildren(Item rootItem,
      List<RedirectItem> itemsRedirectsList,
      List<RedirectItem> sectionsRedirectList,
      List<RegExItem> regExList,
      out List<RedirectItem> itemsRedirectsListOut,
      out List<RedirectItem> sectionsRedirectListOut,
      out List<RegExItem> regExListOut)
        {
            itemsRedirectsListOut = itemsRedirectsList;
              sectionsRedirectListOut = sectionsRedirectList;
              regExListOut = regExList;

              foreach (var item in rootItem.GetChildren().ToArray())
              {
            if (!item.Publishing.IsPublishable(System.DateTime.Now, true))
            {
              continue;
            }

            List<RedirectItem> bufItemsRedirectsList;
            List<RedirectItem> bufSectionsRedirectList;
            List<RegExItem> bufRegExRedirectList;

            CheckRedirectType(item, out bufItemsRedirectsList, out bufSectionsRedirectList, out bufRegExRedirectList);
            if (bufItemsRedirectsList != null)
            {
              itemsRedirectsListOut.AddRange(bufItemsRedirectsList);
            }

            if (bufSectionsRedirectList != null)
            {
              sectionsRedirectListOut.AddRange(bufSectionsRedirectList);
            }

            if (bufRegExRedirectList != null)
            {
              regExListOut.AddRange(bufRegExRedirectList);
            }

            ProcessChildren(item, itemsRedirectsList, sectionsRedirectList, regExList, out itemsRedirectsList, out sectionsRedirectList, out regExList);
              }
        }
开发者ID:Eduserv,项目名称:Sitecore-RedirectManager,代码行数:52,代码来源:RedirectProcessor.cs

示例3: ProcessItem

    /// <summary>
    /// Adds items to the collection based on the search criteria
    /// </summary>
    /// <param name="items">The collection to add items to</param>
    /// <param name="current">The current item</param>
    /// <param name="templateId">Template filter</param>
    /// <param name="branchId">Branch filter</param>
    /// <param name="start">Indicates if the item is the start item</param>
    protected virtual void ProcessItem(ItemCollection items, Item current, ID templateId, ID branchId, bool start)
    {
      if (!start)
      {
        var include = IncludeItem(current, templateId, branchId);

        if (include)
          items.Add(current);
      }

      if (Recursive || start)
      {
        // process each child
        ChildList children = current.GetChildren();
        for (int i = 0; i < children.Count; i++)
        {
          ProcessItem(items, children[i], templateId, branchId, false);
        }
      }
    }
开发者ID:KerwinMa,项目名称:revolver,代码行数:28,代码来源:FindItems.cs


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