首页 新闻 会员 周边 捐助

帮忙看下下面的代码是用什么还装NODE类的。

0
悬赏园豆:30 [已解决问题] 解决于 2008-08-21 12:37
<TABLE style="MARGIN-BOTTOM: 0px" cellSpacing=0 cellPadding=0 width="100%"> <TBODY> <TR> <TD style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" vAlign=top colSpan=2><PRE><FONT color=#1000a0>public</FONT> <FONT color=#1000a0>class</FONT> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection"><FONT color=#0000ff>TreeNodeCollection</FONT></A></B> : <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>, <A title=System.Collections.ICollection href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.ICollection"><FONT color=#0000ff>ICollection</FONT></A>, <A title=System.Collections.IEnumerable href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IEnumerable"><FONT color=#0000ff>IEnumerable</FONT></A> { <FONT color=#808080>// Methods</FONT> <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Add(String):System.Windows.Forms.TreeNode"><FONT color=#0000ff>Add</FONT></A></B>(<A title=System.String href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.String"><FONT color=#0000ff>string</FONT></A> text); <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Add(System.Windows.Forms.TreeNode):Int32"><FONT color=#0000ff>Add</FONT></A></B>(<A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> tn); <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/AddRange(System.Windows.Forms.TreeNode%5b%5d)"><FONT color=#0000ff>AddRange</FONT></A></B>(<A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A>[] treeNodes); <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Clear()"><FONT color=#0000ff>Clear</FONT></A></B>(); <FONT color=#1000a0>public</FONT> <A title=System.Boolean href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Boolean"><FONT color=#0000ff>bool</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Contains(System.Windows.Forms.TreeNode):Boolean"><FONT color=#0000ff>Contains</FONT></A></B>(<A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> tn); <FONT color=#1000a0>public</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/CopyTo(System.Array,Int32)"><FONT color=#0000ff>CopyTo</FONT></A></B>(<A title=System.Array href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Array"><FONT color=#0000ff>Array</FONT></A> rgDest, <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index); <FONT color=#1000a0>public</FONT> <A title=System.Collections.IEnumerator href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IEnumerator"><FONT color=#0000ff>IEnumerator</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/GetEnumerator():System.Collections.IEnumerator"><FONT color=#0000ff>GetEnumerator</FONT></A></B>(); <FONT color=#1000a0>public</FONT> <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/IndexOf(System.Windows.Forms.TreeNode):Int32"><FONT color=#0000ff>IndexOf</FONT></A></B>(<A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> tn); <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Insert(Int32,System.Windows.Forms.TreeNode)"><FONT color=#0000ff>Insert</FONT></A></B>(<A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index, <A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> tnNew); <FONT color=#1000a0>public</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/Remove(System.Windows.Forms.TreeNode)"><FONT color=#0000ff>Remove</FONT></A></B>(<A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> tn); <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/RemoveAt(Int32)"><FONT color=#0000ff>RemoveAt</FONT></A></B>(<A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index); <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/System.Collections.IList.Add(Object):Int32"><FONT color=#0000ff>Add</FONT></A></B>(<A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> objNode); <A title=System.Boolean href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Boolean"><FONT color=#0000ff>bool</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/System.Collections.IList.Contains(Object):Boolean"><FONT color=#0000ff>Contains</FONT></A></B>(<A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> objNode); <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/System.Collections.IList.IndexOf(Object):Int32"><FONT color=#0000ff>IndexOf</FONT></A></B>(<A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> objNode); <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/System.Collections.IList.Insert(Int32,Object)"><FONT color=#0000ff>Insert</FONT></A></B>(<A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index, <A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> objNode); <A title=System.Void href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Void"><FONT color=#0000ff>void</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/System.Collections.IList.Remove(Object)"><FONT color=#0000ff>Remove</FONT></A></B>(<A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> objNode); <FONT color=#808080>// Properties</FONT> <FONT color=#1000a0>public</FONT> <A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:Count:Int32"><FONT color=#0000ff>Count</FONT></A></B> { <FONT color=#1000a0>get</FONT>; } <FONT color=#1000a0>public</FONT> <A title=System.Boolean href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Boolean"><FONT color=#0000ff>bool</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:IsReadOnly:Boolean"><FONT color=#0000ff>IsReadOnly</FONT></A></B> { <FONT color=#1000a0>get</FONT>; } <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>virtual</FONT> <A title=System.Windows.Forms.TreeNode href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNode"><FONT color=#0000ff>TreeNode</FONT></A> <B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:Item(Int32):System.Windows.Forms.TreeNode"><FONT color=#0000ff>this</FONT></A></B>[<A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index] { <FONT color=#1000a0>get</FONT>; <FONT color=#1000a0>set</FONT>; } <A title=System.Boolean href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Boolean"><FONT color=#0000ff>bool</FONT></A> <A title=System.Collections.ICollection href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.ICollection"><FONT color=#0000ff>ICollection</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:System.Collections.ICollection.IsSynchronized:Boolean"><FONT color=#0000ff>IsSynchronized</FONT></A></B> { <FONT color=#1000a0>get</FONT>; } <A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> <A title=System.Collections.ICollection href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.ICollection"><FONT color=#0000ff>ICollection</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:System.Collections.ICollection.SyncRoot:Object"><FONT color=#0000ff>SyncRoot</FONT></A></B> { <FONT color=#1000a0>get</FONT>; } <A title=System.Boolean href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Boolean"><FONT color=#0000ff>bool</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:System.Collections.IList.IsFixedSize:Boolean"><FONT color=#0000ff>IsFixedSize</FONT></A></B> { <FONT color=#1000a0>get</FONT>; } <A title=System.Object href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Object"><FONT color=#0000ff>object</FONT></A> <A title=System.Collections.IList href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Collections.IList"><FONT color=#0000ff>IList</FONT></A>.<B><A class=bold href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Windows.Forms:2.0.0.0:969db8053d3322ac/System.Windows.Forms.TreeNodeCollection/property:System.Collections.IList.Item(Int32):Object"><FONT color=#0000ff>this</FONT></A></B>[<A title=System.Int32 href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:969db8053d3322ac/System.Int32"><FONT color=#0000ff>int</FONT></A> index] { <FONT color=#1000a0>get</FONT>; <FONT color=#1000a0>set</FONT>; } } </PRE></TD></TR></TBODY></TABLE> <P>这个集合类是用什么来盛放NODE类的?</P> <P>是ARRARY还是ILIST。哪位能把ILIST接口讲的明白些。</P>
秋色的主页 秋色 | 初学一级 | 园豆:47
提问于:2008-08-20 13:25
< >
分享
最佳答案
0
node 是TreeNode 的一个节点 public virtual 方法的关键字是virtual 说明这个方法不是继承来的 说明这个是类应该是一个父类 给下面的子类提供了 public virtual TreeNode Add(string text); 这样一个方法 换句话说 TreeNode 是为止支持这个类产生的 TreeNodeCollection 在看看这个类名字就是 TreeNodeCollection TreeNode的集合 所以说这个类里面肯定还有个属性或者字段 是list<TreeNode> 集成ILIST 估计就是想用集合而已 并没有继承其他的东西 ps:因为这个类表示的是集合关系TreeNodeCollection Collection 集合 所以实现ILIST应该表示的是结构上的关系 应该没有其他意义
小眼睛老鼠 | 老鸟四级 |园豆:2731 | 2008-08-20 18:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册