2005-08-28  Ben Maurer  <bmaurer@ximian.com>

	* en/Gtk/NodeSelection.xml: Docs

In .:
2005-08-28  Ben Maurer  <bmaurer@ximian.com>

	* gtk/NodeSelection.cs: helper api


svn path=/trunk/gtk-sharp/; revision=49040
This commit is contained in:
Ben Maurer 2005-08-28 21:18:39 +00:00
parent 675b915e36
commit 327a28442e
4 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2005-08-28 Ben Maurer <bmaurer@ximian.com>
* gtk/NodeSelection.cs: helper api
2005-08-27 Peter Williams <peter@newton.cx>
* gnome/Program.custom: Use a GLib.Argv in PersistentData to store

View File

@ -1,3 +1,7 @@
2005-08-28 Ben Maurer <bmaurer@ximian.com>
* en/Gtk/NodeSelection.xml: Docs
2005-08-14 John Luke <john.luke@gmail.com>
* en/Gtk/IconView.xml: add iconview example

View File

@ -234,5 +234,21 @@
<remarks />
</Docs>
</Member>
<Member MemberName="SelectedNode">
<MemberSignature Language="C#" Value="public Gtk.ITreeNode SelectedNode { set; get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gtk.ITreeNode</ReturnType>
</ReturnValue>
<Exception cref="T:System.InvalidOperationException">The Multiple selection mode is in use.</exception>
<Docs>
<summary>The selected node</summary>
<value>The currently selected node</value>
<remarks>
This property does not make sense in the Multiple selection mode. Therefore
it will throw an exception when used under this mode.
</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@ -130,5 +130,28 @@ namespace Gtk {
return results;
}
}
public ITreeNode SelectedNode {
get {
if (Mode == SelectionMode.Multiple)
throw new InvalidOperationException ("SelectedNode is not valid with multi-selection mode");
ITreeNode [] sn = SelectedNodes;
if (sn.Length == 0)
return null;
return sn [0];
}
set {
// with multiple mode, the behavior
// here would be unclear. Does it just
// select the `value' node or does it
// make the `value' node the only
// selected node.
if (Mode == SelectionMode.Multiple)
throw new InvalidOperationException ("SelectedNode is not valid with multi-selection mode");
SelectNode (value);
}
}
}
}