• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TreePosition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TreePosition的典型用法代码示例。如果您正苦于以下问题:C# TreePosition类的具体用法?C# TreePosition怎么用?C# TreePosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TreePosition类属于命名空间,在下文中一共展示了TreePosition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetParent

		public TreePosition GetParent (TreePosition pos)
		{
			var node = (TreeStoreNode) pos;
			if (node.Parent == null)
				return null;

			return node.Parent;
		}
开发者ID:m13253,项目名称:xwt,代码行数:8,代码来源:TreeStoreBackend.cs


示例2: GetIterPos

		IterPos GetIterPos (TreePosition pos)
		{
			IterPos tpos = (IterPos) pos;
			if (tpos != null && tpos.Version != version) {
				tpos.LastChildIndex = -1;
				tpos.ChildrenCount = -1;
			}
			return tpos;
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:9,代码来源:TreeStoreBackend.cs


示例3: GetChild

		public TreePosition GetChild (TreePosition pos, int index)
		{
			var node = (TreeStoreNode) pos;
			var list = GetListForNode (node);
			if (list.Count == 0 || index >= list.Count)
				return null;

			return list [index];
		}
开发者ID:m13253,项目名称:xwt,代码行数:9,代码来源:TreeStoreBackend.cs


示例4: AddChild

 public TreePosition AddChild(TreePosition pos)
 {
     IterPos tpos = (IterPos)pos;
     Gtk.TreeIter it;
     if (pos == null)
         it = Tree.AppendNode ();
     else
         it = Tree.AppendNode (tpos.Iter);
     return new IterPos (it);
 }
开发者ID:carlosalberto,项目名称:xwt,代码行数:10,代码来源:TreeStoreBackend.cs


示例5: AddChild

 public TreePosition AddChild(TreePosition pos)
 {
     version++;
     IterPos tpos = GetIterPos (pos);
     Gtk.TreeIter it;
     if (pos == null)
         it = Tree.AppendNode ();
     else
         it = Tree.AppendNode (tpos.Iter);
     return new IterPos (version, it);
 }
开发者ID:garuma,项目名称:xwt,代码行数:11,代码来源:TreeStoreBackend.cs


示例6: IterFromNode

        Gtk.TreeIter IterFromNode (TreePosition node)
		{
			GCHandle gch;
			if (!handleHash.TryGetValue (node, out gch)) {
				gch = GCHandle.Alloc (node);
				handleHash [node] = gch;
				nodeHash [gch] = node;
			}
			Gtk.TreeIter result = Gtk.TreeIter.Zero;
			result.UserData = (IntPtr)gch;
			return result;
		}
开发者ID:m13253,项目名称:xwt,代码行数:12,代码来源:CustomTreeModel.cs


示例7: AddChild

        public TreePosition AddChild(TreePosition pos)
        {
            version++;
            IterPos tpos = GetIterPos (pos);
            Gtk.TreeIter it;
            if (pos == null)
                it = Tree.AppendNode ();
            else
                it = Tree.AppendNode (tpos.Iter);

            var node = new IterPos (version, it);
            if (NodeInserted != null)
                NodeInserted (this, new TreeNodeEventArgs (node));
            return node;
        }
开发者ID:antmicro,项目名称:xwt,代码行数:15,代码来源:TreeStoreBackend.cs


示例8: SaveChildren

		void SaveChildren (List<NodeInfo> info, TreePosition it)
		{
			int num = tree.DataSource.GetChildrenCount (it);
			for (int n=0; n<num; n++) {
				var child = tree.DataSource.GetChild (it, n);
				object id = tree.DataSource.GetValue (child, idColumn);
				NodeInfo ni = new NodeInfo ();
				ni.Id = id;
				ni.Expanded = tree.IsRowExpanded (child);
				ni.Selected = tree.IsRowSelected (child);
				info.Add (ni);
				if (tree.DataSource.GetChildrenCount (child) > 0) {
					ni.ChildInfo = new List<NodeInfo> ();
					SaveChildren (ni.ChildInfo, child);
				}
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:17,代码来源:TreeViewStatus.cs


示例9: Load

		void Load (List<NodeInfo> info, TreePosition it)
		{
			bool oneSelected = false;
			var infoCopy = new List<NodeInfo> (info);
			Dictionary<NodeInfo,TreePosition> nodes = new Dictionary<NodeInfo, TreePosition> ();
			
			int num = tree.DataSource.GetChildrenCount (it);
			for (int n=0; n<num; n++) {
				var child = tree.DataSource.GetChild (it, n);
				object id = tree.DataSource.GetValue (child, idColumn);
				NodeInfo ni = ExtractNodeInfo (info, id);
				if (ni != null) {
					nodes [ni] = child;
					if (ni.Expanded)
						tree.ExpandRow (child, false);
					else
						tree.CollapseRow (child);
					
					if (ni.Selected) {
						oneSelected = true;
						tree.SelectRow (child);
					}
					else
						tree.UnselectRow (child);
					
					if (ni.ChildInfo != null)
						Load (ni.ChildInfo, child);
				}
			}
			
			// If this tree level had a selected node and this node has been deleted, then
			// try to select and adjacent node
			if (!oneSelected) {
				// 'info' contains the nodes that have not been inserted
				if (info.Any (n => n.Selected)) {
					NodeInfo an = FindAdjacentNode (infoCopy, nodes, info[0]);
					if (an != null) {
						it = nodes [an];
						tree.SelectRow (it);
					}
				}
			}
		}
开发者ID:m13253,项目名称:xwt,代码行数:43,代码来源:TreeViewStatus.cs


示例10: GetChildrenCount

        public int GetChildrenCount(TreePosition pos)
        {
            if (pos == null)
                return Tree.IterNChildren ();

            IterPos tpos = GetIterPos (pos);

            if (tpos.ChildrenCount != -1)
                return tpos.ChildrenCount;

            return tpos.ChildrenCount = Tree.IterNChildren (tpos.Iter);
        }
开发者ID:antmicro,项目名称:xwt,代码行数:12,代码来源:TreeStoreBackend.cs


示例11: SetValue

 public void SetValue(TreePosition pos, int column, object value)
 {
     IterPos tpos = GetIterPos (pos);
     SetValue (tpos.Iter, column, value);
     if (NodeChanged != null)
         NodeChanged (this, new TreeNodeEventArgs (pos));
 }
开发者ID:antmicro,项目名称:xwt,代码行数:7,代码来源:TreeStoreBackend.cs


示例12: CollapseRow

 public void CollapseRow(TreePosition pos)
 {
     Widget.CollapseRow (Widget.Model.GetPath (((IterPos)pos).Iter));
 }
开发者ID:jbeaurain,项目名称:xwt,代码行数:4,代码来源:TreeViewBackend.cs


示例13: ScrollToRow

 public void ScrollToRow(TreePosition pos)
 {
     Widget.ScrollToCell (Widget.Model.GetPath (((IterPos)pos).Iter), Widget.Columns[0], false, 0, 0);
 }
开发者ID:jbeaurain,项目名称:xwt,代码行数:4,代码来源:TreeViewBackend.cs


示例14: IsRowExpanded

 public bool IsRowExpanded(TreePosition pos)
 {
     return Widget.GetRowExpanded (Widget.Model.GetPath (((IterPos)pos).Iter));
 }
开发者ID:jbeaurain,项目名称:xwt,代码行数:4,代码来源:TreeViewBackend.cs


示例15: ExpandToRow

 public void ExpandToRow(TreePosition pos)
 {
     Widget.ExpandToPath (Widget.Model.GetPath (((IterPos)pos).Iter));
 }
开发者ID:jbeaurain,项目名称:xwt,代码行数:4,代码来源:TreeViewBackend.cs


示例16: AddWiget

 public TreePosition AddWiget(TreePosition pos, string name, Type type, Widget widget)
 {
     var item = new ItemWidget (type) { Widget = widget };
     return store.AddNode (pos)
         .SetValue (nameCol, name)
     //.SetValue (iconCol, Icon)
         .SetValue (widgetCol, item)
         .CurrentPosition;
 }
开发者ID:hamekoz,项目名称:hamekoz-sharp,代码行数:9,代码来源:MainWindow.cs


示例17: GetChild

        public TreePosition GetChild(TreePosition pos, int index)
        {
            IterPos tpos = GetIterPos (pos);
            if (tpos != null && tpos.LastChildIndex == index)
                return new IterPos (version, tpos.LastChildIter);
            if (index == 0) {
                if (tpos != null) {
                    Gtk.TreeIter it;
                    if (Tree.IterChildren (out it, tpos.Iter)) {
                        tpos.LastChildIter = it;
                        tpos.LastChildIndex = 0;
                        return new IterPos (version, it);
                    }
                } else {
                    Gtk.TreeIter it;
                    if (Tree.GetIterFirst (out it))
                        return new IterPos (version, it);
                }
                return null;
            }

            if (tpos == null) {
                Gtk.TreeIter it;
                if (Tree.IterNthChild (out it, index))
                    return new IterPos (version, it);
                else
                    return null;
            }

            if (tpos.LastChildIndex == -1 || tpos.LastChildIndex > index) {
                Gtk.TreeIter it;
                if (Tree.IterNthChild (out it, tpos.Iter, index)) {
                    tpos.LastChildIter = it;
                    tpos.LastChildIndex = index;
                    return new IterPos (version, it);
                } else
                    return null;
            }

            // tpos.LastChildIndex < index

            Gtk.TreeIter iter = tpos.LastChildIter;
            for (int n = tpos.LastChildIndex; n < index; n++) {
                if (!Tree.IterNext (ref iter))
                    return null;
            }
            tpos.LastChildIter = iter;
            tpos.LastChildIndex = index;
            return new IterPos (version, iter);
        }
开发者ID:antmicro,项目名称:xwt,代码行数:50,代码来源:TreeStoreBackend.cs


示例18: GetNext

 public TreePosition GetNext(TreePosition pos)
 {
     IterPos tpos = GetIterPos (pos);
     Gtk.TreeIter it = tpos.Iter;
     if (!Tree.IterNext (ref it))
         return null;
     return new IterPos (version, it);
 }
开发者ID:antmicro,项目名称:xwt,代码行数:8,代码来源:TreeStoreBackend.cs


示例19: ExpandRow

 public void ExpandRow(TreePosition pos, bool expandedChildren)
 {
     Widget.ExpandRow (Widget.Model.GetPath (((IterPos)pos).Iter), expandedChildren);
 }
开发者ID:jbeaurain,项目名称:xwt,代码行数:4,代码来源:TreeViewBackend.cs


示例20: GetParent

 public TreePosition GetParent(TreePosition pos)
 {
     IterPos tpos = GetIterPos (pos);
     Gtk.TreeIter it;
     if (!Tree.IterParent (out it, tpos.Iter))
         return null;
     return new IterPos (version, it);
 }
开发者ID:antmicro,项目名称:xwt,代码行数:8,代码来源:TreeStoreBackend.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TreeProvider类代码示例发布时间:2022-05-24
下一篇:
C# TreeOffset类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap