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


C# TreeModel类代码示例

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


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

示例1: 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

示例2: LoadData

 public void LoadData(TreeViewBackend treeBackend, TreeModel treeModel, TreeIter iter)
 {
     this.treeModel = treeModel;
     this.iter = iter;
     cellView.Initialize (this);
     Visible = cellView.Visible;
 }
开发者ID:nite2006,项目名称:xwt,代码行数:7,代码来源:CustomCellRenderer.cs

示例3: TextDataFunc

    private void TextDataFunc(CellLayout cell_layout, CellRenderer renderer, TreeModel model, TreeIter iter)
    {
        CellRendererText textRenderer = (CellRendererText) renderer;
        Tilegroup group = (Tilegroup) Model.GetValue(iter, 0);

        textRenderer.Text = group.Name;
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:7,代码来源:TileGroupSelector.cs

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: GtkTreeModelResult

		public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
		{
			ParentWidget = parent;
			TModel = treeModel;
			Column = column;
			resultIter = iter;
		}
开发者ID:nerzhulart,项目名称:monodevelop,代码行数:7,代码来源:GtkTreeModelResult.cs

示例9: tree_select

        // the treeview is selected
        private bool tree_select(TreeSelection selection, TreeModel model, TreePath path, bool selected)
        {
            if (this != Global.Core.Library.DynamicTree)
                Global.Core.Library.DynamicTree.Selection.UnselectAll ();

            if (this != Global.Core.Library.FolderTree)
                Global.Core.Library.FolderTree.Selection.UnselectAll ();

            if (this != Global.Core.Library.PlaylistTree)
                Global.Core.Library.PlaylistTree.Selection.UnselectAll ();

            //if it isnt already selected
            if (!selected)
            {
                Global.Core.TopBar.SelectedTree = this;
                Global.Core.Library.MediaTree.SetFilter (FilterMedia);
                Global.Core.Library.MediaTree.Refilter ();

                //raise the event
                if (TreeSelected != null)
                {
                    TreeIter iter;
                    if (model.GetIter (out iter, path))
                        TreeSelected (model, iter);
                }
            }

            return true;
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:30,代码来源:OrganizerTree.cs

示例10: FindBar

        /*
         * Constructor
         */
        public FindBar(PhotoQuery query, TreeModel model)
            : base(new HBox())
        {
            this.query = query;
            box = Child as HBox;

            box.Spacing = 6;
            box.BorderWidth = 2;

            box.PackStart (new Label (Catalog.GetString ("Find:")), false, false, 0);

            entry = new Entry ();
            entry.Completion = new LogicEntryCompletion (entry, model);

            entry.TextInserted  += HandleEntryTextInserted;
            entry.TextDeleted   += HandleEntryTextDeleted;
            entry.KeyPressEvent += HandleEntryKeyPress;

            box.PackStart (entry, true, true, 0);

            Button clear_button = new Gtk.Button ();
            clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleCloseButtonClicked;
            clear_button.Relief = Gtk.ReliefStyle.None;
            box.PackStart (clear_button, false, false, 0);
        }
开发者ID:iainlane,项目名称:f-spot,代码行数:29,代码来源:FindBar.cs

示例11: 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

示例12: 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

示例13: compareLayer

 /// <summary> Compare ZPos Values and return which comes first </summary>
 public int compareLayer(TreeModel model, TreeIter tia, TreeIter tib)
 {
     object objA = model.GetValue (tia, 0);
     object objB = model.GetValue (tib, 0);
     int a = getZPos(objA);
     int b = getZPos(objB);
     return a.CompareTo(b);
 }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:9,代码来源:LayerListWidget.cs

示例14: 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

示例15: 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


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