[Gtk-sharp-list] [Patch] GetNodes() for NodeStore

Mike Kestner mkestner@novell.com
Tue, 26 Apr 2005 09:22:40 -0500


On Mon, 2005-04-25 at 23:22 -0700, Eric Butler wrote:

> I couldn't find any simple way to get a list of all the nodes in a
> NodeStore. This one line method does the trick... unless I totally
> overlooked something (which happens quite often) could it please be added?
> 
> This is extremely useful because I can do something like:
> 
> public void on_mnuConnectionsClearDisconnected_activate(object o,
> EventArgs e)
>         {
>                 foreach (ConnectionListItem node in
> connectionList.NodeStore.GetNodes()) {

I just committed a patch to trunk to make NodeStore implement
IEnumerable.  Now you can do:

foreach (ConnectionListItem node in connectionList.NodeStore) {}

Keep in mind, this only iterates the root nodes.

Thanks for the patch.
-- 
Mike Kestner <mkestner@novell.com>