示例#1
0
            public override void RemoveItem(int index)
            {
                var path = new Gtk.TreePath();

                path.AppendIndex(index);
                Handler.Tree.Model.EmitRowDeleted(path);
            }
示例#2
0
        public Gtk.TreePath GetPathAtRow(int row)
        {
            var path = new Gtk.TreePath();

            path.AppendIndex(row);
            return(path);
        }
示例#3
0
			public override void InsertItem(int index, ITreeItem item)
			{
				var path = new Gtk.TreePath();
				path.AppendIndex(index);
				var iter = Handler.model.GetIterFromItem(item, path);
				Handler.tree.Model.EmitRowInserted(path, iter);
			}
示例#4
0
			public override void AddItem(ITreeItem item)
			{
				var path = new Gtk.TreePath();
				path.AppendIndex(Collection.Count);
				var iter = Handler.model.GetIterFromItem(item, path);
				Handler.tree.Model.EmitRowInserted(path, iter);
			}
示例#5
0
 public Gtk.TreePath GetPath(int index)
 {
     this.VerifyValidIndex(index);
     Gtk.TreePath path = new Gtk.TreePath();
     path.AppendIndex(index);
     path.Owned = false;
     return(path);
 }
示例#6
0
        public Gtk.TreePath GetPath(Gtk.TreeIter iter)
        {
            var node = NodeFromIter(iter);

            var path = new Gtk.TreePath();

            path.AppendIndex(node);
            return(path);
        }
示例#7
0
        public Gtk.TreePath GetPath(Gtk.TreeIter iter)
        {
            var row = GetRow(iter);

            var path = new Gtk.TreePath();

            path.AppendIndex(row);
            return(path);
        }
示例#8
0
        public Gtk.TreePath GetPath(Gtk.TreeIter iter)
        {
            var node = NodeFromIter(iter);

            if (node == null)
            {
                throw new ArgumentException("iter");
            }

            var path = new Gtk.TreePath();

            path.AppendIndex(node.Row);
            return(path);
        }
示例#9
0
        private void HandleViewModelSelectionChangedCore(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            _updatingSelection = true;
            try
            {
                var selection = _romListView.Selection;
                switch (e.Action)
                {
                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
                    if (e.NewItems != null)
                    {
                        foreach (ProgramDescriptionViewModel item in e.NewItems)
                        {
                            var index = ViewModel.Programs.IndexOf(item);
                            var path  = new Gtk.TreePath();
                            path.AppendIndex(index);
                            selection.SelectPath(path);
                        }
                    }
                    if (e.OldItems != null)
                    {
                        foreach (ProgramDescriptionViewModel item in e.OldItems)
                        {
                            var index = ViewModel.Programs.IndexOf(item);
                            var path  = new Gtk.TreePath();
                            path.AppendIndex(index);
                            selection.UnselectPath(path);
                        }
                    }
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                    selection.UnselectAll();
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
                    break;
                }
            }
            finally
            {
                _updatingSelection = false;
            }
        }
示例#10
0
        public override int GetRowIndexOfPath(Gtk.TreePath path)
        {
            var tempPath = new Gtk.TreePath();
            int count    = GetCount(Gtk.TreeIter.Zero, path.Indices[0]);

            // slow but works for now
            for (int i = 0; i < path.Indices.Length - 1; i++)
            {
                tempPath.AppendIndex(path.Indices[i]);
                Gtk.TreeIter iter;
                if (model.GetIter(out iter, tempPath))
                {
                    count += GetCount(iter, path.Indices[i + 1]);
                }
            }
            count += path.Indices.Length - 1;
            //count += path.Indices[row.Indices.Length - 1];

            return(count);
        }
示例#11
0
	public Gtk.TreePath GetPath(int index)
	{
	  this.VerifyValidIndex(index);
	  Gtk.TreePath path = new Gtk.TreePath();
	  path.AppendIndex(index);
	  path.Owned = false;
	  return path;
	}
示例#12
0
		public Gtk.TreePath GetPath (Gtk.TreeIter iter)
		{
			var node = NodeFromIter (iter);
			if (node == null)
				throw new ArgumentException ("iter");

			var path = new Gtk.TreePath ();
			path.AppendIndex (node.Row);
			return path;
		}