Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        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));
            }
        }
Beispiel #5
0
        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);
                    }
                }
            }
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
 /// <summary>
 /// Selects a cab
 /// </summary>
 /// <param name="cab">DisplayCab to select</param>
 public void SelectCab(DisplayCab cab)
 {
     listViewCabs.SelectedItem = cab;
 }