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


C# Gtk.GetIter方法代码示例

本文整理汇总了C#中Gtk.GetIter方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.GetIter方法的具体用法?C# Gtk.GetIter怎么用?C# Gtk.GetIter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk的用法示例。


在下文中一共展示了Gtk.GetIter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update

		/// <summary>
		/// Use a list of modifications to update Gtk.TreeStore
		/// </summary>
		public static void Update(RemoteTreeStore remoteStore, Gtk.TreeStore gtkStore)
		{
			RemoteTreeModification[] modifications = remoteStore.GetModifications();
			if (modifications.Length > 0) {
				Console.WriteLine(String.Format("Received {0} modifications from {1}", modifications.Length, remoteStore));
			}
			foreach(RemoteTreeModification mod in modifications) {
				Console.WriteLine(mod);
				if (mod is RemoteTreeModification.InsertNode) {
					RemoteTreeModification.InsertNode insertMod = (RemoteTreeModification.InsertNode)mod;
					if (insertMod.ParentNodePath.Indices.Length == 0) {
						// Insert to the top level
						gtkStore.InsertNode(insertMod.NodeIndex);
					} else {
						TreeIter it;
						gtkStore.GetIter(out it, new TreePath(insertMod.ParentNodePath.Indices));
						gtkStore.InsertNode(it, insertMod.NodeIndex);
					}
				}
				if (mod is RemoteTreeModification.RemoveNode) {
					RemoteTreeModification.RemoveNode removeMod = (RemoteTreeModification.RemoveNode)mod;
					TreeIter it;
					gtkStore.GetIter(out it, new TreePath(removeMod.NodePath.Indices));
					gtkStore.Remove(ref it);
				}
				if (mod is RemoteTreeModification.UpdateNode) {
					RemoteTreeModification.UpdateNode updateMod = (RemoteTreeModification.UpdateNode)mod;
					// Igonre the root node
					if (updateMod.NodePath.IsRoot) {
						continue;
					}
					TreeIter it;
					gtkStore.GetIter(out it, new TreePath(updateMod.NodePath.Indices));
					object value = updateMod.Value;
					// If it is image, dereference it
					if (value is PixmapRef) {
						value = ((PixmapRef)value).GetPixbuf();
					}
					gtkStore.SetValue(it, updateMod.ColumnIndex, value);
				}
			}
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:45,代码来源:GtkTreeStoreUpdater.cs

示例2: LoadCertificateTree

        public static void LoadCertificateTree(Gtk.TreeStore certStore)
        {
            foreach (EveCertGroup group in m_CertGroups.Values)
            {
                Gtk.TreeIter groupIter = certStore.AppendValues(group.Name, -1, group.ID, true);
                group.TreeReference = new Gtk.TreeRowReference(certStore, certStore.GetPath(groupIter));
            }

            foreach (EveCertificate cert in m_Certificates.Values)
            {
                EveCertGroup group = m_CertGroups[cert.GroupID];
                Gtk.TreeIter groupIter;
                Gtk.TreeIter certIter;

                if (certStore.GetIter(out groupIter, group.TreeReference.Path))
                {
                    certIter = certStore.AppendValues(groupIter, cert.Name, cert.Grade, cert.ID, false);
                    cert.TreeReference = new Gtk.TreeRowReference(certStore, certStore.GetPath(certIter));
                }
            }
        }
开发者ID:SilkyPantsDan,项目名称:ECM,代码行数:21,代码来源:ItemDatabase.cs

示例3: FilterTree

        private bool FilterTree(Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            lock (inventory)
            {

                try
                {
                    if (this.entry_search.Text == "")
                        return true;

                    if (filtered.Contains(iter))//*sigh*
                        return true;

                    object obj = model.GetValue(iter, 1);
                    if (obj == null)
                        return false;

                    string Name = (string)obj;

                    if (Name.Contains(this.entry_search.Text))
                    {
                        filtered.Add(iter);//*sigh*

                        TreePath path = model.GetPath(iter);
                        while (path.Depth > 1)
                        {
                            path.Up();
                            TreeIter iter2;
                            model.GetIter(out iter2, path);
                            filtered.Add(iter2);//*sigh*
                        }

                        return true;
                    }

                    return false;
                }
                catch
                {
                    return false;
                }
            }
        }
开发者ID:robincornelius,项目名称:omvviewer-light,代码行数:43,代码来源:Inventory.cs

示例4: getPrevIterFromSelection

        /**
         * Gets both iters from the provided ListStore obj based on the passed TreePath object(the selected row)
         */
        private bool getPrevIterFromSelection(out Gtk.TreeIter selectedIter, out Gtk.TreeIter prevIter, 
                                                Gtk.TreePath selectedRow,  Gtk.ListStore listModel)
        {
            
            listModel.GetIter(out selectedIter, selectedRow);
            selectedRow.Prev();
            listModel.GetIter(out prevIter, selectedRow);

            return  (prevIter.Stamp!=0 && !prevIter.Equals(selectedIter));
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:13,代码来源:SettingsDialog.cs

示例5: getNextIterFromSelection

        /**
         * Gets both iters from the provided ListStore obj based on the passed TreePath object(the selected row)
         */

        private bool getNextIterFromSelection(out Gtk.TreeIter selectedIter, out Gtk.TreeIter nextIter, 
                                                Gtk.TreePath selectedRow,  Gtk.ListStore listModel)
        {
            
            listModel.GetIter(out selectedIter, selectedRow);
            selectedRow.Next();
            listModel.GetIter(out nextIter, selectedRow);

            return (nextIter.Stamp!=0  && !nextIter.Equals(selectedIter));
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:14,代码来源:SettingsDialog.cs

示例6: removeSelectedElementInTreeview

        /*
         * Returns the value of the removed element, or null- if no element removed
         */
        private String removeSelectedElementInTreeview(Gtk.TreeView target, Gtk.ListStore model)
        {
            Gtk.TreeIter iter; 
            Gtk.TreePath[] selectedRows=  target.Selection.GetSelectedRows();

            if(selectedRows.Length >0 )
            {
                model.GetIter(out iter, selectedRows[0]);
                string value = (string)model.GetValue(iter, 0);

                if(model.Remove(ref iter))
                    return value;
                else
                    return null;
            }
            return null;
        }
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:20,代码来源:SettingsDialog.cs

示例7: LoadMarket

        public static void LoadMarket(Gtk.TreeStore marketStore, Gtk.ListStore itemStore)
        {
            LoadMarket();

            foreach(EveMarketGroup group in m_MarketGroups.Values)
            {
                Gtk.TreeIter groupIter;
                Gtk.TreeIter  parentIter;

                if (group.ParentID > -1 && marketStore.GetIter(out parentIter, m_MarketGroups[group.ParentID].TreeReference.Path))
                {
                    groupIter = marketStore.AppendNode(parentIter);
                }
                else
                {
                    groupIter = marketStore.AppendNode();
                }

                group.TreeReference = new Gtk.TreeRowReference(marketStore, marketStore.GetPath(groupIter));
                marketStore.SetValues(groupIter, new Gdk.Pixbuf(ItemDatabase.GetMarketIconStream(group.IconString)), group.Name, group.ID, group.HasItems, true);
            }

            foreach (EveItem item in m_Items.Values)
            {
                if (item.MarketGroupID > -1)
                {
                    Gtk.TreeIter parentIter;
                    if (marketStore.GetIter(out parentIter, m_MarketGroups[item.MarketGroupID].TreeReference.Path))
                    {
                        Gtk.TreeIter childIter = marketStore.AppendValues(parentIter, null, item.Name, item.ID, false, false);
                        itemStore.AppendValues(item.Name, item.ID);

                        item.TreeReference = new Gtk.TreeRowReference(marketStore, marketStore.GetPath(childIter));
                    }
                }
            }
        }
开发者ID:SilkyPantsDan,项目名称:ECM,代码行数:37,代码来源:ItemDatabase.cs


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