コード例 #1
0
ファイル: ListViewSort.cs プロジェクト: windygu/AnkhSVN
        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();
            }
        }
コード例 #2
0
ファイル: ListViewSort.cs プロジェクト: windygu/AnkhSVN
        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);
        }
コード例 #3
0
ファイル: ListViewSortOrder.cs プロジェクト: necora/ank_git
        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;
            }
        }
コード例 #4
0
ファイル: ListViewSort.cs プロジェクト: pvginkel/VisualGit
        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();
            }
        }
コード例 #5
0
ファイル: ListViewSortOrder.cs プロジェクト: windygu/AnkhSVN
        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;
            }
        }
コード例 #6
0
        public SmartListViewItem(SmartListView listView)
        {
            if (listView == null)
                throw new ArgumentNullException("listView");

            _view = listView;
        }
コード例 #7
0
ファイル: PropertyEditItem.cs プロジェクト: necora/ank_git
        public PropertyEditItem(SmartListView listView, string name)
            : base(listView)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");

            Text = _name = name;
        }
コード例 #8
0
ファイル: PropertyEditItem.cs プロジェクト: windygu/AnkhSVN
        public PropertyEditItem(SmartListView listView, string name)
            : base(listView)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            Text = _name = name;
        }
コード例 #9
0
ファイル: ListViewSortOrder.cs プロジェクト: windygu/AnkhSVN
        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();
        }
コード例 #10
0
ファイル: ListViewSortOrder.cs プロジェクト: necora/ank_git
        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();
        }
コード例 #11
0
        public virtual void OnExecute(CommandEventArgs e)
        {
            SmartListView list = GetListView(e);

            if (list == null)
            {
                return;
            }

            OnExecute(list, e);
        }
コード例 #12
0
ファイル: SmartGroup.cs プロジェクト: paulpv/reviewboardvsx
        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;
        }
コード例 #13
0
        public virtual void OnUpdate(CommandUpdateEventArgs e)
        {
            SmartListView list = GetListView(e);

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

            OnUpdate(list, e);
        }
コード例 #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();
        }
コード例 #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);
            }
        }
コード例 #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();
        }
コード例 #17
0
ファイル: ListViewShow.cs プロジェクト: windygu/AnkhSVN
        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));
                        }
                    }
                }
            }
        }
コード例 #18
0
ファイル: ListViewShow.cs プロジェクト: necora/ank_git
        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));
                    }
                }
            }
        }
コード例 #19
0
ファイル: ListViewGroup.cs プロジェクト: windygu/AnkhSVN
        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();
        }
コード例 #20
0
ファイル: ListViewSort.cs プロジェクト: pvginkel/VisualGit
        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);
        }
コード例 #21
0
ファイル: ListViewGroup.cs プロジェクト: necora/ank_git
        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();
        }
コード例 #22
0
 protected abstract void OnExecute(SmartListView list, CommandEventArgs e);
コード例 #23
0
 protected abstract void OnUpdate(SmartListView list, CommandUpdateEventArgs e);
コード例 #24
0
 public AuthenticationListItem(SmartListView listview)
     : base(listview)
 {
 }
コード例 #25
0
 public AuthenticationListItem(SmartListView listview)
     : base(listview)
 {
 }
コード例 #26
0
ファイル: SmartGroup.cs プロジェクト: paulpv/reviewboardvsx
 public SmartGroup(SmartListView listView, string key, string headerText)
     : this(listView, new ListViewGroup(key, headerText))
 {
 }
コード例 #27
0
ファイル: SmartGroup.cs プロジェクト: paulpv/reviewboardvsx
 public SmartGroup(SmartListView listView, string header, HorizontalAlignment headerAlignment)
     : this(listView, new ListViewGroup(header, headerAlignment))
 {
 }
コード例 #28
0
ファイル: SmartGroup.cs プロジェクト: paulpv/reviewboardvsx
 public SmartGroup(SmartListView listView, string header)
     : this(listView, new ListViewGroup(header))
 {
 }
コード例 #29
0
ファイル: SmartGroup.cs プロジェクト: paulpv/reviewboardvsx
 public SmartGroup(SmartListView listView)
     : this(listView, new ListViewGroup())
 {
     if (listView == null)
         throw new ArgumentNullException("listView");
 }
コード例 #30
0
ファイル: ListViewCommandBase.cs プロジェクト: necora/ank_git
 protected abstract void OnUpdate(SmartListView list, CommandUpdateEventArgs e);
コード例 #31
0
 public RepositoryProviderListViewItem(SmartListView view, ScmRepositoryProvider repoProvider)
     : base(view)
 {
     Tag = repoProvider;
     Refresh();
 }
コード例 #32
0
 public CertificateListItem(SmartListView listview)
     : base(listview)
 {
 }
コード例 #33
0
ファイル: ListViewCommandBase.cs プロジェクト: necora/ank_git
 protected abstract void OnExecute(SmartListView list, CommandEventArgs e);