private void listViewCabs_SelectionChanged(object sender, SelectionChangedEventArgs e) { ClientLogic clientLogic = this.DataContext as ClientLogic; Debug.Assert(clientLogic != null); DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if (selectedCab != null) { clientLogic.CurrentCab = selectedCab; } }
private void listViewCabs_ContextMenuOpening(object sender, ContextMenuEventArgs e) { DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if (selectedCab != null) { menuItemSendCabToPlugin.IsEnabled = true; menuItemCopyCabUrl.IsEnabled = true; } else { menuItemSendCabToPlugin.IsEnabled = false; menuItemCopyCabUrl.IsEnabled = false; } }
private void LoadCabDetails() { ClientLogic clientLogic = this.DataContext as ClientLogic; Debug.Assert(clientLogic != null); DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if (selectedCab != null) { clientLogic.CurrentCab = selectedCab; clientLogic.AdminGetResultFiles(); clientLogic.CurrentView = ClientLogicView.CabDetail; } }
private void menuItemCopyCabUrl_Click(object sender, RoutedEventArgs e) { ClientLogic clientLogic = this.DataContext as ClientLogic; Debug.Assert(clientLogic != null); DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if ((selectedCab != null) && (clientLogic.CurrentEventPackage != null)) { Clipboard.SetText(StackHashUri.CreateUriString(UserSettings.Settings.CurrentContextId, clientLogic.CurrentEventPackage.ProductId, clientLogic.CurrentEventPackage.Id, clientLogic.CurrentEventPackage.EventTypeName, selectedCab.Id)); } }
private void menuItemSendCabToPlugin_Click(object sender, RoutedEventArgs e) { ClientLogic clientLogic = this.DataContext as ClientLogic; Debug.Assert(clientLogic != null); MenuItem menuItem = e.OriginalSource as MenuItem; if (menuItem != null) { StackHashBugTrackerPlugIn plugin = menuItem.Tag as StackHashBugTrackerPlugIn; if (plugin != null) { DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if ((selectedCab != null) && (clientLogic.CurrentEventPackage != null)) { clientLogic.SendCabToPlugin(selectedCab, clientLogic.CurrentEventPackage, plugin.Name); } } } }
void clientLogic_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (this.Dispatcher.CheckAccess()) { ClientLogic clientLogic = this.DataContext as ClientLogic; if ((e.PropertyName == "CurrentView") && (clientLogic.CurrentView == ClientLogicView.EventDetail)) { _listViewCabsSorter.SortLastColumn(); _listViewEventInfosSorter.SortLastColumn(); DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab; if (selectedCab != null) { clientLogic.CurrentCab = selectedCab; } } } else { this.Dispatcher.BeginInvoke(new Action <object, PropertyChangedEventArgs>(clientLogic_PropertyChanged), sender, e); } }
/// <summary> /// Selects a cab /// </summary> /// <param name="cab">DisplayCab to select</param> public void SelectCab(DisplayCab cab) { listViewCabs.SelectedItem = cab; }