See Also: NodeStore Members
This class provides a simple mechanism of implementing the Model required by the Gtk.TreeView.
C# Example
[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 (DemoNode));
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 IEnumerable interface, so code can be written like this:
C# Example
void DumpColumnValues (NodeStore store, int col)
{
foreach (object[] row in store)
Console.WriteLine ("Value of column {0} is {1}", col, row [col]);
}