Пример #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;
		}