本文整理汇总了C#中Gtk.TreePath.PrependIndex方法的典型用法代码示例。如果您正苦于以下问题:C# TreePath.PrependIndex方法的具体用法?C# TreePath.PrependIndex怎么用?C# TreePath.PrependIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreePath
的用法示例。
在下文中一共展示了TreePath.PrependIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PathFromNode
internal TreePath PathFromNode(DocNode node)
{
if (node == null)
return new TreePath ();
DocNode work = node;
TreePath path = new TreePath ();
while (work != root_node) {
DocNode parent = work.Parent;
path.PrependIndex (parent.IndexOf (work));
work = parent;
}
path.PrependIndex (0);
return path;
}
示例2: GetPath
public TreePath GetPath (TreeIter iter)
{
Node node = (Node) iter;
TreePath result = new TreePath ();
if (node == null)
return result;
while (node.Parent != null) {
result.PrependIndex (node.Parent.Children.IndexOf (node));
node = node.Parent;
}
result.PrependIndex (nodes.IndexOf (node));
return result;
}
示例3: GetPath
internal TreePath GetPath (ITreeNode node)
{
TreePath path = new TreePath ();
int idx;
while (node.Parent != null) {
idx = node.Parent.IndexOf (node);
if (idx < 0) throw new Exception ("Badly formed tree");
path.PrependIndex (idx);
node = node.Parent;
}
idx = Nodes.IndexOf (node);
if (idx < 0) throw new Exception ("Node not found in Nodes list");
path.PrependIndex (idx);
path.Owned = false;
return path;
}
示例4: PathFromNode
TreePath PathFromNode (object node)
{
if (node == null)
return new TreePath ();
object work = node;
TreePath path = new TreePath ();
if (work is MemberInfo) {
Type parent = (work as MemberInfo).ReflectedType;
path.PrependIndex (Array.IndexOf (parent.GetMembers (), work));
work = parent;
}
if (work is Type) {
Assembly assm = (work as Type).Assembly;
path.PrependIndex (Array.IndexOf (assm.GetTypes (), work));
work = assm;
}
if (work is Assembly)
path.PrependIndex (Array.IndexOf (assemblies, node));
return path;
}