Exemple #1
0
		void FillBoundChildrenRecursive (IHierarchicalEnumerable hEnumerable, TreeNodeCollection nodeCollection)
		{
			if (hEnumerable == null)
				return;			
			
			foreach (object obj in hEnumerable) {
				IHierarchyData hdata = hEnumerable.GetHierarchyData (obj);
				TreeNode child = new TreeNode ();
				nodeCollection.Add (child);
				child.Bind (hdata);
				OnTreeNodeDataBound (new TreeNodeEventArgs (child));

				if (MaxDataBindDepth >= 0 && child.Depth == MaxDataBindDepth)
					continue;

				if (hdata == null || !hdata.HasChildren)
					continue;

				IHierarchicalEnumerable e = hdata.GetChildren ();
				FillBoundChildrenRecursive (e, child.ChildNodes);
			}
		}