コード例 #1
0
        /// <summary>
        /// Gets all the entities that are the descendants of the folder with the specified ID.
        /// </summary>
        /// <param name="parentId">The parent ID.</param>
        /// <returns>
        /// The entities.
        /// </returns>
        public IEnumerable <IEntity> RetrieveDescendants(Guid parentId)
        {
            var descendants       = new List <IEntity>();
            var folders           = Folders.RetrieveChildren(parentId);
            var folderDescendants = folders.SelectMany(x => RetrieveDescendants(x.Id));

            descendants.AddRange(folders);
            descendants.AddRange(folderDescendants);
            descendants.AddRange(Forms.RetrieveChildren(parentId));
            descendants.AddRange(ConfiguredForms.RetrieveChildren(parentId));
            descendants.AddRange(Layouts.RetrieveChildren(parentId));
            descendants.AddRange(Validations.RetrieveChildren(parentId));
            descendants.AddRange(DataValues.RetrieveChildren(parentId));
            return(descendants);
        }
コード例 #2
0
        /// <summary>
        /// Gets all the entities that are the children of the folder with the specified ID.
        /// </summary>
        /// <param name="parentId">The parent ID.</param>
        /// <returns>
        /// The entities.
        /// </returns>
        /// <remarks>
        /// You can specify a parent ID of null to get the root entities.
        /// </remarks>
        public IEnumerable <IEntity> RetrieveChildren(Guid?parentId)
        {
            var children = new List <IEntity>();

            children.AddRange(Folders.RetrieveChildren(parentId));
            children.AddRange(Forms.RetrieveChildren(parentId));
            if (parentId.HasValue)
            {
                children.AddRange(ConfiguredForms.RetrieveChildren(parentId.Value));
            }
            children.AddRange(Layouts.RetrieveChildren(parentId));
            children.AddRange(Validations.RetrieveChildren(parentId));
            children.AddRange(DataValues.RetrieveChildren(parentId));
            return(children);
        }