private void listView1_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { bool singleSelection = e.EndIndex == e.StartIndex; this.buttonDown.Enabled = singleSelection; this.buttonUp.Enabled = singleSelection; }
private void listView1_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { for (int i = e.StartIndex; i <= e.EndIndex; i++) { messages[i].selected = e.IsSelected; } }
/// <summary> /// ListView virtual mode handler /// </summary> /// <param name="e">EventArgs object</param> protected override void OnVirtualItemsSelectionRangeChanged(ListViewVirtualItemsSelectionRangeChangedEventArgs e) { //if (locked) return; base.OnVirtualItemsSelectionRangeChanged(e); // Stupid Event, e.EndIndex is always one index too low. // http://mrdotnet.wordpress.com/2005/01/19/getting-along-with-listview’s-virtuallist-mode-part-3/ // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97026 bool selectionChanged = false; for (int idx = e.StartIndex; idx <= e.EndIndex + 1 /* !!! */; idx++) { if (updateSelection(idx, e.IsSelected)) { selectionChanged = true; } } if (selectionChanged) { OnSelectedIndexChanged(new EventArgs()); } }
/// <summary> /// Handle a state change for a range of items. /// </summary> public void VirtualItemsSelectionRangeChanged( ListViewVirtualItemsSelectionRangeChangedEventArgs e) { //Debug.WriteLine("VirtualRangeChange: " + e.StartIndex + " - " + e.EndIndex + // " (" + e.IsSelected + ")"); if (e.StartIndex == 0 && e.EndIndex == mSelection.Length - 1) { // Set all elements. The list view control seems to like to set all elements // to false whenever working with multi-select, so this should be fast. //Debug.WriteLine("VirtualRangeChange: set all to " + e.IsSelected); mSelection.SetAll(e.IsSelected); } else { if (e.EndIndex >= mSelection.Length) { Debug.WriteLine("GLITCH: selection end index " + e.EndIndex + " out of range"); Debug.Assert(false); return; } bool val = e.IsSelected; for (int i = e.StartIndex; i <= e.EndIndex; i++) { mSelection.Set(i, val); } } }
private void WatchListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { PokeAddressToolBarItem.Enabled = FreezeAddressToolBarItem.Enabled = SelectedIndices.Any() && SelectedWatches.All(w => w.Domain.CanPoke()); }
public void Ctor_Int_Int_Bool(int startIndex, int endIndex, bool isSelected) { var e = new ListViewVirtualItemsSelectionRangeChangedEventArgs(startIndex, endIndex, isSelected); Assert.Equal(startIndex, e.StartIndex); Assert.Equal(endIndex, e.EndIndex); Assert.Equal(isSelected, e.IsSelected); }
private void listViewFiles_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { if (e.IsSelected) { mSelectedItem = mFilteredItems[e.StartIndex]; } else { mSelectedItem = null; } }
void virtualList_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { try { if (e.IsSelected) { OnSelectedLogIndexChange( ); } } catch {} }
public void TestListViewVirtualItemsSelectionRangeChangedEventArgs() { bool selected = false; int start = 3; int end = 76; ListViewVirtualItemsSelectionRangeChangedEventArgs e = new ListViewVirtualItemsSelectionRangeChangedEventArgs(start, end, selected); Assert.AreEqual(selected, e.IsSelected, "A1"); Assert.AreEqual(start, e.StartIndex, "A2"); Assert.AreEqual(end, e.EndIndex, "A3"); }
private void listView1_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { // On reaffecte toutes les selections... foreach (parametresOGSpy p in listeDesComptes) { p.Selected = false; } for (int i = 0; i < listView1.SelectedIndices.Count; ++i) { listeDesComptes[listView1.SelectedIndices[i]].Selected = true; } mettreAJourLEtatDesControlesSelonLaSelection(); }
private void log_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { for (int i = e.StartIndex; i <= e.EndIndex; ++i) { if (e.IsSelected) { SelectedEntries.Add(i, EntryCache[i]); } else { SelectedEntries.Remove(i); } } }
private void UpdateSubRecordSelection(ListViewVirtualItemsSelectionRangeChangedEventArgs e) { var n = listSubrecord.SelectedIndices.Count; var oldSel = Selection.SubRecord; var newSel = GetSelectedSubrecord(); if (oldSel == newSel) { return; } // Update the current selection Selection.SubRecord = newSel; FireSelectionChanged(); UpdateToolStripSelection(); }
private void logListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { if (e.IsSelected) { if (logListView.SelectedIndices.Count > 1) { for (int i = this.logListView.SelectedIndices.Count - 2; i > 0; i--) { this.logListView.Items[this.logListView.SelectedIndices[i]].Selected = false; } ListViewItem item = this.logListView.Items[e.EndIndex]; this.logListView_ItemSelectionChanged(this.logListView, new ListViewItemSelectionChangedEventArgs(item, item.Index, true)); } } }
protected override void OnVirtualItemsSelectionRangeChanged(ListViewVirtualItemsSelectionRangeChangedEventArgs e) { base.OnVirtualItemsSelectionRangeChanged(e); if (e.IsSelected) { ItemSelectBusy = true; SelectedIndices.Clear(); for (var index = e.StartIndex; index <= e.EndIndex; index++) { SelectedIndices.Add(index); } ItemSelectBusy = false; OnSelectedIndexChanged(EventArgs.Empty); } }
protected override void OnVirtualItemsSelectionRangeChanged( ListViewVirtualItemsSelectionRangeChangedEventArgs e) { try { int start = _lastItemIndexClicked1; int end = _lastItemIndexClicked2; if (end < start) { int temp = start; start = end; end = temp; } if ((start >= 0) && (end >= 0)) { ArrayList toRemove = new ArrayList(); foreach (int index in SelectedIndices) { if ((index < start) || (index > end)) { toRemove.Add(index); } } if (toRemove.Count > 0) { foreach (int index in toRemove) { SelectedIndices.Remove(index); } } } ListViewVirtualItemsSelectionRangeChangedEventArgs te = new ListViewVirtualItemsSelectionRangeChangedEventArgs(start, end, e.IsSelected); base.OnVirtualItemsSelectionRangeChanged(te); } catch { } }
private void c_messageList_VirtualSelectedIndexChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { if (c_messageList.SelectedIndices.Count == 0) { printDialog.AllowSelection = false; } else { printDialog.AllowSelection = true; c_messageDisplay.SuspendLayout(); for (int i = 0; i < c_messageList.SelectedIndices.Count; i++) { String template = "Timestamp: {0} From: {1} To: {2}{3}{4}{3}{3}"; int selectedIndex = c_messageList.SelectedIndices[i]; MyMessage selected = getVirtualItem(selectedIndex); c_messageDisplay.Text += String.Format(template, selected.TimeStamp, selected.From, selected.To, Environment.NewLine, selected.Text); } c_messageDisplay.ResumeLayout(); } }
/// <summary> /// Method called after the selection range of virtual items changed</summary> /// <param name="sender">Sender</param> /// <param name="e">Event args</param> void listView1_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { UpdateSelectedFiles(); }
private void lv_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { //PrintStats("VirtualItemsSelectionRangeChanged"); SignalSelectionChanged(); }
private void PreviewListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { // Keep track of what image/s are selected. ListView.SelectedIndexCollection _col = PreviewListView.SelectedIndices; if (_col.Count > 1) { toolStripStatusLabel.ForeColor = Color.Red; toolStripStatusLabel.Text = "Multiple images selected."; } }
private void MyVirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { ListViewItemSelectionChanged(); }
protected override void OnVirtualItemsSelectionRangeChanged(ListViewVirtualItemsSelectionRangeChangedEventArgs e) { base.OnVirtualItemsSelectionRangeChanged(e); base.OnSelectedIndexChanged(e); }
private void EnCambioDeItemsSeleccionados(object laLista, ListViewVirtualItemsSelectionRangeChangedEventArgs losArgumentos) { EnCambioDeItemsSeleccionados(laLista, (EventArgs)losArgumentos); }
private void annotationsListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { annotationsListView_SelectedIndexChanged(sender, e); }
protected override void OnVirtualItemsSelectionRangeChanged(ListViewVirtualItemsSelectionRangeChangedEventArgs e) { base.OnVirtualItemsSelectionRangeChanged(e); ///UpdateColumnWidths(); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// listviewvirtualitemsselectionrangechangedeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this ListViewVirtualItemsSelectionRangeChangedEventHandler listviewvirtualitemsselectionrangechangedeventhandler, Object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e, AsyncCallback callback) { if (listviewvirtualitemsselectionrangechangedeventhandler == null) { throw new ArgumentNullException("listviewvirtualitemsselectionrangechangedeventhandler"); } return(listviewvirtualitemsselectionrangechangedeventhandler.BeginInvoke(sender, e, callback, null)); }
private void PreviewListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { // 跟踪所选的图像. ListView.SelectedIndexCollection _col = PreviewListView.SelectedIndices; if (_col.Count > 1) { toolStripStatusLabel.ForeColor = Color.Red; toolStripStatusLabel.Text = "选择了多个图像."; } }
private void DisplayListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { /*if (e.IsSelected) * { * ListView listView = sender as ListView; * if (listView != null) * { * listView.SelectedIndices.Clear(); * for (int index = e.StartIndex; index <= e.EndIndex; index++) * listView.SelectedIndices.Add(index); * DisplayListView_SelectedIndexChanged(sender, null); * } * }*/ }
void listView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { }
private void GameDataList_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { this.OnSelectedIndexChanged(e); }
private void _culturesList_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e) { SetDelButtonState(); }