System.Web.UI.WebControls.TreeView.UnsetExpandStates C# (CSharp) Method

UnsetExpandStates() private method

private UnsetExpandStates ( TreeNodeCollection col, string states ) : void
col TreeNodeCollection
states string
return void
		void UnsetExpandStates (TreeNodeCollection col, string[] states)
		{
			foreach (TreeNode node in col) {
				if (node.Expanded.HasValue && node.Expanded.Value) {
					bool expand = (Array.IndexOf (states, node.Path) != -1);
					if (!expand) node.Expanded = false;
				}
				if (node.HasChildData)
					UnsetExpandStates (node.ChildNodes, states);
			}
		}