Exemplo n.º 1
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool extend = ((Control.ModifierKeys & Keys.Shift) != 0);

            int         n      = (int)(e.Command - AnkhCommand.ListViewSort0);
            SmartColumn column = list.AllColumns[n];

            if (list.SortColumns.Contains(column))
            {
                list.SortColumns.Remove(column);

                list.UpdateSortGlyphs();

                if (list.SortColumns.Count > 0)
                {
                    list.Sort();
                }
            }
            else if (!extend)
            {
                list.SortColumns.Clear();
                list.SortColumns.Add(column);
                list.UpdateSortGlyphs();
                list.Sort();
            }
            else
            {
                list.SortColumns.Add(column);
                list.UpdateSortGlyphs();
                list.Sort();
            }
        }
Exemplo n.º 2
0
        protected override void OnUpdate(SmartListView list, CommandUpdateEventArgs e)
        {
            int n = (int)(e.Command - AnkhCommand.ListViewSort0);

            if (n >= list.AllColumns.Count || n < 0)
            {
                e.Text           = "";
                e.DynamicMenuEnd = true;
                return;
            }

            SmartColumn column = list.AllColumns[n];

            if (e.TextQueryType == TextQueryType.Name)
            {
                e.Text = column.MenuText;
            }

            if (!column.Sortable)
            {
                e.Enabled = false;
            }

            e.Checked = list.SortColumns.Contains(column);
        }
Exemplo n.º 3
0
        protected override void OnUpdate(SmartListView list, Ankh.Commands.CommandUpdateEventArgs e)
        {
            bool foundOne = false;

            e.Checked = true;

            foreach (SmartColumn sc in list.SortColumns)
            {
                foundOne = true;

                switch (e.Command)
                {
                    case AnkhCommand.ListViewSortAscending:
                        if (sc.ReverseSort)
                        {
                            e.Checked = false;
                            return;
                        }
                        break;
                    case AnkhCommand.ListViewSortDescending:
                        if (!sc.ReverseSort)
                        {
                            e.Checked = false;
                            return;
                        }
                        break;
                }
            }
            if (!foundOne)
            {
                e.Checked = e.Enabled = false;
            }
        }
Exemplo n.º 4
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool extend = ((Control.ModifierKeys & Keys.Shift) != 0);

            int n = (int)(e.Command - VisualGitCommand.ListViewSort0);
            SmartColumn column = list.AllColumns[n];

            if (list.SortColumns.Contains(column))
            {
                list.SortColumns.Remove(column);

                list.UpdateSortGlyphs();

                if (list.SortColumns.Count > 0)
                    list.Sort();
            }
            else if (!extend)
            {
                list.SortColumns.Clear();
                list.SortColumns.Add(column);
                list.UpdateSortGlyphs();
                list.Sort();
            }
            else
            {
                list.SortColumns.Add(column);
                list.UpdateSortGlyphs();
                list.Sort();
            }
        }
Exemplo n.º 5
0
        protected override void OnUpdate(SmartListView list, Ankh.Commands.CommandUpdateEventArgs e)
        {
            bool foundOne = false;

            e.Checked = true;

            foreach (SmartColumn sc in list.SortColumns)
            {
                foundOne = true;

                switch (e.Command)
                {
                case AnkhCommand.ListViewSortAscending:
                    if (sc.ReverseSort)
                    {
                        e.Checked = false;
                        return;
                    }
                    break;

                case AnkhCommand.ListViewSortDescending:
                    if (!sc.ReverseSort)
                    {
                        e.Checked = false;
                        return;
                    }
                    break;
                }
            }
            if (!foundOne)
            {
                e.Checked = e.Enabled = false;
            }
        }
Exemplo n.º 6
0
        public SmartListViewItem(SmartListView listView)
        {
            if (listView == null)
                throw new ArgumentNullException("listView");

            _view = listView;
        }
Exemplo n.º 7
0
        public PropertyEditItem(SmartListView listView, string name)
            : base(listView)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");

            Text = _name = name;
        }
Exemplo n.º 8
0
        public PropertyEditItem(SmartListView listView, string name)
            : base(listView)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            Text = _name = name;
        }
Exemplo n.º 9
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool value = (e.Command == AnkhCommand.ListViewSortDescending);

            foreach (SmartColumn sc in list.SortColumns)
            {
                sc.ReverseSort = value;
            }
            list.UpdateSortGlyphs();
            list.Sort();
        }
Exemplo n.º 10
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool value = (e.Command == AnkhCommand.ListViewSortDescending);

            foreach (SmartColumn sc in list.SortColumns)
            {
                sc.ReverseSort = value;
            }
            list.UpdateSortGlyphs();
            list.Sort();
        }
Exemplo n.º 11
0
        public virtual void OnExecute(CommandEventArgs e)
        {
            SmartListView list = GetListView(e);

            if (list == null)
            {
                return;
            }

            OnExecute(list, e);
        }
Exemplo n.º 12
0
        SmartGroup(SmartListView listView, ListViewGroup group)
        {
            if (listView == null)
                throw new ArgumentNullException("listView");
            else if (group == null)
                throw new ArgumentNullException("group");

            Debug.Assert(group.Tag == null);
            _lv = listView;
            _group = group;
            _group.Tag = this;
        }
Exemplo n.º 13
0
        public virtual void OnUpdate(CommandUpdateEventArgs e)
        {
            SmartListView list = GetListView(e);

            if (list == null)
            {
                e.Enabled = false;
                return;
            }

            OnUpdate(list, e);
        }
Exemplo n.º 14
0
        public FileSystemListViewItem(SmartListView view, SvnItem item)
            : base(view)
        {
            if (item == null)
                throw new ArgumentNullException("item");

            _svnItem = item;

            ImageIndex = View.IconMapper.GetIcon(item.FullPath);

            RefreshValues();
        }
Exemplo n.º 15
0
        private void pendingList_ItemChecked(object sender, ItemCheckedEventArgs e)
        {
            if (e.Item.Checked)
            {
                okButton.Enabled = true;
            }
            else
            {
                SmartListView lv = sender as SmartListView;

                okButton.Enabled = (lv != null && lv.HasCheckedItems);
            }
        }
Exemplo n.º 16
0
        public FileSystemListViewItem(SmartListView view, SvnItem item)
            : base(view)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            _svnItem = item;

            ImageIndex = View.IconMapper.GetIcon(item.FullPath);

            RefreshValues();
        }
Exemplo n.º 17
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            int n = (int)(e.Command - AnkhCommand.ListViewShow0);

            SmartColumn sc  = list.AllColumns[n];
            int         col = sc.Index;

            if (col > 0)
            {
                list.Columns.Remove(sc);

                if (!list.VirtualMode)
                {
                    Debug.Assert(sc.Index < 0);

                    foreach (ListViewItem li in list.Items)
                    {
                        if (li.SubItems.Count > col)
                        {
                            li.SubItems.RemoveAt(col);
                        }
                    }
                }
            }
            else
            {
                list.Columns.Add(sc);

                if (!list.VirtualMode)
                {
                    col = sc.Index;
                    foreach (ListViewItem li in list.Items)
                    {
                        SmartListViewItem si = li as SmartListViewItem;

                        if (si != null)
                        {
                            si.SetValue(sc.AllColumnsIndex, si.GetValue(sc.AllColumnsIndex));
                        }
                    }
                }
            }
        }
Exemplo n.º 18
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            int n = (int)(e.Command - AnkhCommand.ListViewShow0);

            SmartColumn sc = list.AllColumns[n];
            int col = sc.Index;
            if (col > 0)
            {
                list.Columns.Remove(sc);

                if (!list.VirtualMode)
                {
                    Debug.Assert(sc.Index < 0);

                    foreach (ListViewItem li in list.Items)
                    {
                        if (li.SubItems.Count > col)
                            li.SubItems.RemoveAt(col);
                    }
                }
            }
            else
            {
                list.Columns.Add(sc);

                if (!list.VirtualMode)
                {
                    col = sc.Index;
                    foreach (ListViewItem li in list.Items)
                    {
                        SmartListViewItem si = li as SmartListViewItem;

                        if (si != null)
                            si.SetValue(sc.AllColumnsIndex, si.GetValue(sc.AllColumnsIndex));
                    }
                }
            }
        }
Exemplo n.º 19
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool extend = ((Control.ModifierKeys & Keys.Shift) != 0);

            int         n      = (int)(e.Command - AnkhCommand.ListViewGroup0);
            SmartColumn column = list.AllColumns[n];

            if (list.GroupColumns.Contains(column))
            {
                list.GroupColumns.Remove(column);
            }
            else if (!extend)
            {
                list.GroupColumns.Clear();
                list.GroupColumns.Add(column);
            }
            else
            {
                list.GroupColumns.Add(column);
            }

            list.RefreshGroups();
        }
Exemplo n.º 20
0
        protected override void OnUpdate(SmartListView list, CommandUpdateEventArgs e)
        {
            int n = (int)(e.Command - VisualGitCommand.ListViewSort0);

            if (n >= list.AllColumns.Count || n < 0)
            {
                e.Text = "";
                e.DynamicMenuEnd = true;
                return;
            }

            SmartColumn column = list.AllColumns[n];

            if (e.TextQueryType == TextQueryType.Name)
            {
                e.Text = column.MenuText;
            }

            if (!column.Sortable)
                e.Enabled = false;

            e.Checked = list.SortColumns.Contains(column);
        }
Exemplo n.º 21
0
        protected override void OnExecute(SmartListView list, CommandEventArgs e)
        {
            bool extend = ((Control.ModifierKeys & Keys.Shift) != 0);

            int n = (int)(e.Command - AnkhCommand.ListViewGroup0);
            SmartColumn column = list.AllColumns[n];

            if (list.GroupColumns.Contains(column))
            {
                list.GroupColumns.Remove(column);
            }
            else if (!extend)
            {
                list.GroupColumns.Clear();
                list.GroupColumns.Add(column);
            }
            else
            {
                list.GroupColumns.Add(column);
            }

            list.RefreshGroups();
        }
Exemplo n.º 22
0
 protected abstract void OnExecute(SmartListView list, CommandEventArgs e);
Exemplo n.º 23
0
 protected abstract void OnUpdate(SmartListView list, CommandUpdateEventArgs e);
Exemplo n.º 24
0
 public AuthenticationListItem(SmartListView listview)
     : base(listview)
 {
 }
 public AuthenticationListItem(SmartListView listview)
     : base(listview)
 {
 }
Exemplo n.º 26
0
 public SmartGroup(SmartListView listView, string key, string headerText)
     : this(listView, new ListViewGroup(key, headerText))
 {
 }
Exemplo n.º 27
0
 public SmartGroup(SmartListView listView, string header, HorizontalAlignment headerAlignment)
     : this(listView, new ListViewGroup(header, headerAlignment))
 {
 }
Exemplo n.º 28
0
 public SmartGroup(SmartListView listView, string header)
     : this(listView, new ListViewGroup(header))
 {
 }
Exemplo n.º 29
0
 public SmartGroup(SmartListView listView)
     : this(listView, new ListViewGroup())
 {
     if (listView == null)
         throw new ArgumentNullException("listView");
 }
Exemplo n.º 30
0
 protected abstract void OnUpdate(SmartListView list, CommandUpdateEventArgs e);
Exemplo n.º 31
0
 public RepositoryProviderListViewItem(SmartListView view, ScmRepositoryProvider repoProvider)
     : base(view)
 {
     Tag = repoProvider;
     Refresh();
 }
Exemplo n.º 32
0
 public CertificateListItem(SmartListView listview)
     : base(listview)
 {
 }
Exemplo n.º 33
0
 protected abstract void OnExecute(SmartListView list, CommandEventArgs e);