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


C# TreeModel.GetValue方法代码示例

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


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

示例1: CellDataHandler

        public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            SourceRowRenderer renderer = cell as SourceRowRenderer;
            if (renderer == null) {
                return;
            }

            var type = model.GetValue (iter, (int)SourceModel.Columns.Type);
            if (type == null || (SourceModel.EntryType) type != SourceModel.EntryType.Source) {
                renderer.Visible = false;
                return;
            }

            Source source = model.GetValue (iter, 0) as Source;
            renderer.Source = source;
            renderer.Iter = iter;

            if (source == null) {
                return;
            }

            renderer.Visible = true;
            renderer.Text = source.Name;
            renderer.Sensitive = source.CanActivate;
        }
开发者ID:gclark916,项目名称:banshee,代码行数:25,代码来源:SourceRowRenderer.cs

示例2: EventsListFromPaths

        /// <summary>
        /// Fill a list of events from a list of paths, if the first and unique path is an EventType the list
        /// is filled with al the child events in this EventType category.
        /// </summary>
        /// <param name = "model">Model.</param>
        /// <param name="events">Events.</param>
        /// <param name="paths">Paths.</param>
        public static List<TimelineEventLongoMatch> EventsListFromPaths(TreeModel model, TreePath[] paths)
        {
            List<TimelineEventLongoMatch> events = new List<TimelineEventLongoMatch> ();

            // If it's an EventType or a Player, traverse all children to fill the list
            if (paths.Length == 1 && !(model.GetValue (paths [0]) is TimelineEventLongoMatch)) {
                TreeIter parentIter;
                TreeIter child;
                bool hasChild;

                model.GetIter (out parentIter, paths [0]);
                hasChild = model.IterHasChild (parentIter);
                model.IterChildren (out child, parentIter);
                while (hasChild) {
                    TimelineEventLongoMatch evt = model.GetValue (child, 0) as TimelineEventLongoMatch;
                    if (evt != null) {
                        events.Add (evt);
                    }
                    hasChild = model.IterNext (ref child);
                }
            } else {
                foreach (var path in paths) {
                    TimelineEventLongoMatch evt = model.GetValue (path) as TimelineEventLongoMatch;
                    if (evt != null) {
                        events.Add (evt);
                    }
                }
            }
            return events;
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:37,代码来源:TreeViewHelpers.cs

示例3: CompareTagsSortFunc

		static int CompareTagsSortFunc (TreeModel model, TreeIter a, TreeIter b)
		{
			Tag tag_a = model.GetValue (a, 0) as Tag;
			Tag tag_b = model.GetValue (b, 0) as Tag;

			if (tag_a == null || tag_b == null)
				return 0;

			return string.Compare (tag_a.NormalizedName, tag_b.NormalizedName);
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:10,代码来源:TagManager.cs

示例4: ProfileNameDataFunc

		public static void ProfileNameDataFunc (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
		{
			if (model.GetValue (iter, 0) != null) {
				Cms.Profile profile = (Cms.Profile) model.GetValue (iter, 0);
				if (profile.ProductName.Length < NameLenth)
					(renderer as Gtk.CellRendererText).Text = profile.ProductName;
				else
					(renderer as Gtk.CellRendererText).Text = profile.ProductName.Substring(0, NameLenth) + "...";
			}
			else
				(renderer as Gtk.CellRendererText).Text = "";
		}
开发者ID:guadalinex-archive,项目名称:guadalinex-v6,代码行数:12,代码来源:PreferenceDialog.cs

示例5: GetActionByAccel

        private bool GetActionByAccel(TreeModel model, TreePath path, TreeIter iter, uint accelKey, Gdk.ModifierType accelMods)
        {
            var rowAccelKey = (uint)model.GetValue(iter, (int)Column.AccelKey);
            var rowAccelMods = (Gdk.ModifierType)model.GetValue(iter, (int)Column.AccelMods);

            if (rowAccelKey == accelKey && rowAccelMods == accelMods)
            {
                this.actionConflict = (string)model.GetValue(iter, (int)Column.Action);
                return true;
            }

            return false;
        }
开发者ID:jholland918,项目名称:gtk-sharp-samples,代码行数:13,代码来源:ShortcutDialog.cs

示例6: FilterTasks

        /// <summary>
        /// Override the default filter mechanism so that we show only
        /// completed tasks in this group.
        /// </summary>
        /// <param name="model">
        /// A <see cref="TreeModel"/>
        /// </param>
        /// <param name="iter">
        /// A <see cref="TreeIter"/>
        /// </param>
        /// <returns>
        /// A <see cref="System.Boolean"/>
        /// </returns>
        protected override bool FilterTasks(TreeModel model, TreeIter iter)
        {
            // Don't show any task here if showCompletedTasks is false
            if (!showCompletedTasks)
                return false;

            ITask task = model.GetValue (iter, 0) as ITask;
            if (task == null || task.State != TaskState.Completed)
                return false;

            // Make sure that the task fits into the specified range depending
            // on what the user has set the range slider to be.
            if (task.CompletionDate < this.timeRangeStart)
                return false;

            if (task.CompletionDate == DateTime.MinValue)
                return true; // Just in case

            // Don't show tasks in the completed group that were completed
            // today.  Tasks completed today should still appear under their
            // original group until tomorrow.
            DateTime today = DateTime.Now;

            if (today.Year == task.CompletionDate.Year
                    && today.DayOfYear == task.CompletionDate.DayOfYear)
                return false;

            return true;
        }
开发者ID:nolith,项目名称:tasque,代码行数:42,代码来源:CompletedTaskGroupModel.cs

示例7: OnMatchSelected

		protected override bool OnMatchSelected (TreeModel filter, TreeIter iter){
			Entry entry = (Entry)Entry;
			entry.Text = ((ItemTag)filter.GetValue(iter,0)).Name;
			entry.FinishEditing();
			entry.RemoveWidget();
			return true;
		}
开发者ID:konne88,项目名称:MyInventory,代码行数:7,代码来源:ItemEditBox.cs

示例8: OnPixbufCellLayout

        private void OnPixbufCellLayout(CellLayout layout, CellRenderer cell,
                                         TreeModel model, TreeIter iter)
        {
            CellRendererPixbuf pixbufCell = (cell as CellRendererPixbuf);

            IVirtualDevice device = (IVirtualDevice) model.GetValue (iter, 0);

            switch (device.DeviceType) {
            case VirtualDeviceType.HardDisk:
                pixbufCell.Pixbuf = hdPixbuf;
                break;
            case VirtualDeviceType.CdRom:
                pixbufCell.Pixbuf = cdromPixbuf;
                break;
            case VirtualDeviceType.Ethernet:
                pixbufCell.Pixbuf = ethernetPixbuf;
                break;
            case VirtualDeviceType.Floppy:
                pixbufCell.Pixbuf = floppyPixbuf;
                break;
            default:
                pixbufCell.Pixbuf = null;
                break;
            }
        }
开发者ID:snorp,项目名称:vmx-manager,代码行数:25,代码来源:DeviceView.cs

示例9: OnMatchSelected

		protected override bool OnMatchSelected (TreeModel filter, TreeIter iter){
			Location.Item = (Model.Item)filter.GetValue(iter,0);
			Entry entry = (Entry)Entry;
			entry.FinishEditing();
			entry.RemoveWidget();
			return true;
		}
开发者ID:konne88,项目名称:MyInventory,代码行数:7,代码来源:LocationsBox.cs

示例10: AlbumCellDataFunc

        private void AlbumCellDataFunc(TreeViewColumn column,
						CellRenderer renderer,
						TreeModel model,
						TreeIter iter)
        {
            MusicStoreTrackInfo track = (MusicStoreTrackInfo) model.GetValue (iter, 0);
            ((CellRendererText)renderer).Text = track.Album;
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:8,代码来源:MusicStoreView.cs

示例11: ContentDataFunc

		private void ContentDataFunc (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			object dataObject = model.GetValue (iter, columnIndex);
			if (dataObject == null)
				nullRenderer.SetContent (cell as CellRendererText, dataObject);
			else
				contentRenderer.SetContent (cell as CellRendererText, dataObject);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:8,代码来源:DataGridColumn.cs

示例12: ImageDataFunc

		static void ImageDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
		{

			var isError = (bool)tree_model.GetValue (iter, 2);
			var crpixbuf = (CellRendererPixbuf)cell;
			crpixbuf.Visible = isError;
			crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:HighlightingPanel.cs

示例13: RenderCoverage

		public static void RenderCoverage (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			var txt = cell as CellRendererText;
			CodeRecord rc = (CodeRecord)model.GetValue (iter, 0);
			if (txt != null) {
				txt.Foreground = CellColor (rc.Coverage);
				txt.Text = String.Format ("{0:00.0}%", rc.Coverage * 100.0);
			}
		}
开发者ID:Money520,项目名称:XR.Baboon,代码行数:9,代码来源:CodeRecordCellRenderFuncs.cs

示例14: RenderFont

		private void RenderFont (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
		{
			string fontName = (string)model.GetValue (iter, 0);

			CellRendererText cell = renderer as CellRendererText;

			cell.Text = fontName;
			cell.Font = string.Format ("{0} 10", fontName);
			cell.Family = fontName;
		}
开发者ID:RudoCris,项目名称:Pinta,代码行数:10,代码来源:ToolBarFontComboBox.cs

示例15: CheckForText

		bool CheckForText (TreeModel model, TreeIter iter, bool exact)
		{
			string modelText = model.GetValue (iter, Column) as string;
			if (modelText == null) {
				return false;
			}

			if (exact) {
				return modelText == DesiredText;
			} else {
				return (modelText.IndexOf (DesiredText) > -1);
			}
		}
开发者ID:nerzhulart,项目名称:monodevelop,代码行数:13,代码来源:GtkTreeModelResult.cs


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