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

RaiseCallbackEvent() protected method

protected RaiseCallbackEvent ( string eventArgs ) : void
eventArgs string
return void
		protected virtual void RaiseCallbackEvent (string eventArgs)
		{
			string[] args = eventArgs.Split ('|');
			RequiresDataBinding = true;
			EnsureDataBound ();
			
			TreeNode node = MakeNodeTree (args);
			ArrayList levelLines = new ArrayList ();
			TreeNode nd = node;
			while (nd != null) {
				int childCount = nd.Parent != null ? nd.Parent.ChildNodes.Count : Nodes.Count;
				levelLines.Insert (0, (nd.Index < childCount - 1) ? this : null);
				nd = nd.Parent;
			}
			
			StringWriter sw = new StringWriter ();
			HtmlTextWriter writer = new HtmlTextWriter (sw);
			EnsureStylesPrepared ();

			node.Expanded = true;
			int num = node.ChildNodes.Count;
			for (int n=0; n<num; n++)
				RenderNode (writer, node.ChildNodes [n], node.Depth + 1, levelLines, true, n<num-1);
			
			string res = sw.ToString ();
			callbackResult = res.Length > 0 ? res : "*";
		}