SenseNet.ContentRepository.Storage.Schema.NodeType.GetChildren C# (CSharp) Method

GetChildren() public method

public GetChildren ( ) : TypeCollection
return TypeCollection
		public TypeCollection<NodeType> GetChildren()
		{
			TypeCollection<NodeType> children = new TypeCollection<NodeType>(this.SchemaRoot);
			foreach (NodeType nt in _children)
				children.Add(nt);
			return children;
		}

Usage Example

コード例 #1
0
        private static List <NodeType> GetNodeTypeRootsToDelete(TypeCollection <NodeType> origSet, TypeCollection <NodeType> newSet)
        {
            // Walks (preorder) origSet NodeType tree and collects only deletable subtree roots.

            List <NodeType> _nodeTypeRootsToDelete = new List <NodeType>();
            List <NodeType> _nodeTypesToEnumerate  = new List <NodeType>();

            // collect only roots
            foreach (NodeType rootNodeType in origSet)
            {
                if (rootNodeType.Parent == null)
                {
                    _nodeTypesToEnumerate.Add(rootNodeType);
                }
            }

            int index = 0;

            while (index < _nodeTypesToEnumerate.Count)
            {
                NodeType currentType = _nodeTypesToEnumerate[index++];

                // delete currentType if newSet does not contain it otherwise add its children to enumerator
                if (newSet.GetItemById(currentType.Id) == null)
                {
                    _nodeTypeRootsToDelete.Add(currentType);
                }
                else
                {
                    _nodeTypesToEnumerate.AddRange(currentType.GetChildren());
                }
            }

            return(_nodeTypeRootsToDelete);
        }
All Usage Examples Of SenseNet.ContentRepository.Storage.Schema.NodeType::GetChildren