diff --git a/doc/en/Gtk/ListStore.xml b/doc/en/Gtk/ListStore.xml index 2e4b57cc2..aebcb76a8 100644 --- a/doc/en/Gtk/ListStore.xml +++ b/doc/en/Gtk/ListStore.xml @@ -10,9 +10,23 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - The ListStore is a columned list data structure to be used with widget. It is the model part in Model/View/Controller design paradigm. The contents of the ListStore can be sorted and are drag-and-drop ready. - - + The ListStore is a columned list data structure to be used with widget. + + +Iteration: In new versions of Gtk# (2.0 and up) this class implements the interface, so code can be written like this: + + + + + void DumpColumnValues (ListStore store, int col) + { + foreach (object[] row in store) + Console.WriteLine ("Value of column {0} is {2}", col, row [col]); + } + + + + GLib.Object @@ -1511,9 +1525,8 @@ The above example creates a new three columns list store. The types of the colum a If the elements of the current instance are modified while an enumeration is in progress, a call to or throws . - + - - + \ No newline at end of file diff --git a/doc/en/Gtk/NodeStore.xml b/doc/en/Gtk/NodeStore.xml index fb9399e76..1fe98b0d9 100644 --- a/doc/en/Gtk/NodeStore.xml +++ b/doc/en/Gtk/NodeStore.xml @@ -10,8 +10,60 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - Tree and List store for objects. + A store for that provides data from an arbitrary class. It is simpler to use than the . + +This class provides a simple mechanism of implementing the Model required by the . + + + + [TreeNode (ColumnCount=2)] + class DemoNode { + string name; + string email; + + public DemoNode (string name, string email) + { + this.name = name; + this.email = email; + } + + [TreeNodeValue (Column=0)] + public string Name { + get { return name; } + } + + [TreeNodeValue (Column=1)] + public string EMail { + get { return email; } + } + } + + class Demo { + NodeStore store; + + void PopulateStore () + { + NodeStore store = new NodeStore (typeof (MyRow)); + DemoNode my_node = new DemoNode ("Miguel de Icaza", "miguel@ximian.com"); + store.AddNode (my_node); + } + + + +Iteration: In new versions of Gtk# (2.0 and up) this class implements the interface, so code can be written like this: + + + + + void DumpColumnValues (NodeStore store, int col) + { + foreach (object[] row in store) + Console.WriteLine ("Value of column {0} is {2}", col, row [col]); + } + + + @@ -144,4 +196,4 @@ - + \ No newline at end of file