diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 2144983de..0882267e8 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -29,6 +29,7 @@ using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.Common.Update; using Tango.MachineStudio.UI.StudioApplication; using Tango.MachineStudio.UI.SupervisingController; +using Tango.MachineStudio.UI.TFS; using Tango.MachineStudio.UI.Views; using Tango.MachineStudio.UI.Windows; using Tango.PMR.Stubs; @@ -142,6 +143,11 @@ namespace Tango.MachineStudio.UI.ViewModels /// </summary> public RelayCommand<MachinesEvent> ResolveMachineEventCommand { get; set; } + /// <summary> + /// Gets or sets the report issue command. + /// </summary> + public RelayCommand ReportIssueCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// <summary> /// Gets or sets the authentication provider. @@ -183,6 +189,11 @@ namespace Tango.MachineStudio.UI.ViewModels } /// <summary> + /// Gets or sets the TFS client. + /// </summary> + public TeamFoundationServiceExtendedClient TFSClient { get; set; } + + /// <summary> /// Gets or sets the speech provider. /// </summary> public ISpeechProvider SpeechProvider { get; set; } @@ -247,8 +258,9 @@ namespace Tango.MachineStudio.UI.ViewModels IEventLogger eventLogger, IDiagnosticsFrameProvider frameProvider, ISpeechProvider speechProvider, - IHtmlPresenter htmlPresenter) : base() + IHtmlPresenter htmlPresenter, TeamFoundationServiceExtendedClient tfs) : base() { + TFSClient = tfs; _eventLogger = eventLogger; _navigation = navigationManager; AuthenticationProvider = authenticationProvider; @@ -288,6 +300,8 @@ namespace Tango.MachineStudio.UI.ViewModels ToggleSpeechCommand = new RelayCommand(() => { SpeechProvider.Mute = !SpeechProvider.Mute; }); ResolveMachineEventCommand = new RelayCommand<MachinesEvent>(ResolveMachineEvent); + + ReportIssueCommand = new RelayCommand(ReportIssue); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e) @@ -628,5 +642,17 @@ namespace Tango.MachineStudio.UI.ViewModels _notificationProvider.ShowWarning("Could not locate guidance content for the specified event."); } } + + private void ReportIssue() + { + _notificationProvider.ShowModalDialog<ReportIssueViewVM, ReportIssueView>(new ReportIssueViewVM(TFSClient.Project, TFSClient.CreateBug()), async (vm) => + { + using (_notificationProvider.PushTaskItem("Uploading bug report...")) + { + await TFSClient.UploadWorkItem(vm.WorkItem); + } + + }, null); + } } } |
