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(); } }
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); }
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; } }
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(); } }
public SmartListViewItem(SmartListView listView) { if (listView == null) throw new ArgumentNullException("listView"); _view = listView; }
public PropertyEditItem(SmartListView listView, string name) : base(listView) { if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name"); Text = _name = name; }
public PropertyEditItem(SmartListView listView, string name) : base(listView) { if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } Text = _name = name; }
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(); }
public virtual void OnExecute(CommandEventArgs e) { SmartListView list = GetListView(e); if (list == null) { return; } OnExecute(list, e); }
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; }
public virtual void OnUpdate(CommandUpdateEventArgs e) { SmartListView list = GetListView(e); if (list == null) { e.Enabled = false; return; } OnUpdate(list, e); }
public FileSystemListViewItem(SmartListView view, SvnItem item) : base(view) { if (item == null) throw new ArgumentNullException("item"); _svnItem = item; ImageIndex = View.IconMapper.GetIcon(item.FullPath); RefreshValues(); }
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); } }
public FileSystemListViewItem(SmartListView view, SvnItem item) : base(view) { if (item == null) { throw new ArgumentNullException("item"); } _svnItem = item; ImageIndex = View.IconMapper.GetIcon(item.FullPath); RefreshValues(); }
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)); } } } } }
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)); } } } }
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(); }
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); }
protected abstract void OnExecute(SmartListView list, CommandEventArgs e);
protected abstract void OnUpdate(SmartListView list, CommandUpdateEventArgs e);
public AuthenticationListItem(SmartListView listview) : base(listview) { }
public SmartGroup(SmartListView listView, string key, string headerText) : this(listView, new ListViewGroup(key, headerText)) { }
public SmartGroup(SmartListView listView, string header, HorizontalAlignment headerAlignment) : this(listView, new ListViewGroup(header, headerAlignment)) { }
public SmartGroup(SmartListView listView, string header) : this(listView, new ListViewGroup(header)) { }
public SmartGroup(SmartListView listView) : this(listView, new ListViewGroup()) { if (listView == null) throw new ArgumentNullException("listView"); }
public RepositoryProviderListViewItem(SmartListView view, ScmRepositoryProvider repoProvider) : base(view) { Tag = repoProvider; Refresh(); }
public CertificateListItem(SmartListView listview) : base(listview) { }