当前位置: 首页>>代码示例>>C#>>正文


C# TreePath.PrependIndex方法代码示例

本文整理汇总了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;
        }
开发者ID:mono,项目名称:monodoc-widgets,代码行数:15,代码来源:CatalogStore.cs

示例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;
		}
开发者ID:col42dev,项目名称:mono-tools,代码行数:14,代码来源:ProfileStore.cs

示例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;
			}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:18,代码来源:NodeStore.cs

示例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;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:TreeModelDemo.cs


注:本文中的Gtk.TreePath.PrependIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。