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 | 40 |
1 files changed, 39 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 c9f4b3441..3cb728395 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -20,10 +20,12 @@ using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Diagnostics; using Tango.MachineStudio.Common.EventLogging; +using Tango.MachineStudio.Common.Html; using Tango.MachineStudio.Common.Messages; using Tango.MachineStudio.Common.Modules; using Tango.MachineStudio.Common.Navigation; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.Common.Speech; using Tango.MachineStudio.Common.StudioApplication; using Tango.MachineStudio.Common.Update; using Tango.MachineStudio.UI.StudioApplication; @@ -49,6 +51,7 @@ namespace Tango.MachineStudio.UI.ViewModels private bool _isDisconnecting; private Thread _updateCheckThread; private IEventLogger _eventLogger; + private IHtmlPresenter _htmlPresenter; /// <summary> /// Gets or sets the current loaded module. @@ -129,6 +132,16 @@ namespace Tango.MachineStudio.UI.ViewModels /// </summary> public RelayCommand UpdateCenterCommand { get; set; } + /// <summary> + /// Gets or sets the toggle speech command. + /// </summary> + public RelayCommand ToggleSpeechCommand { get; set; } + + /// <summary> + /// Gets or sets the display HTML command. + /// </summary> + public RelayCommand<MachinesEvent> ResolveMachineEventCommand { get; set; } + private IAuthenticationProvider _authenticationProvider; /// <summary> /// Gets or sets the authentication provider. @@ -169,6 +182,11 @@ namespace Tango.MachineStudio.UI.ViewModels set { _applicationManager = value; RaisePropertyChangedAuto(); } } + /// <summary> + /// Gets or sets the speech provider. + /// </summary> + public ISpeechProvider SpeechProvider { get; set; } + private bool _isUpdateAvailable; /// <summary> /// Gets or sets a value indicating whether a new version update is available. @@ -228,7 +246,9 @@ namespace Tango.MachineStudio.UI.ViewModels IStudioApplicationManager applicationManager, INavigationManager navigationManager, IEventLogger eventLogger, - IDiagnosticsFrameProvider frameProvider) : base(view) + IDiagnosticsFrameProvider frameProvider, + ISpeechProvider speechProvider, + IHtmlPresenter htmlPresenter) : base(view) { _eventLogger = eventLogger; _navigation = navigationManager; @@ -237,6 +257,8 @@ namespace Tango.MachineStudio.UI.ViewModels NotificationProvider = notificationProvider; ApplicationManager = applicationManager; DiagnosticsFrameProvider = frameProvider; + SpeechProvider = speechProvider; + _htmlPresenter = htmlPresenter; StartModuleCommand = new RelayCommand<IStudioModule>(StartModule); @@ -263,6 +285,10 @@ namespace Tango.MachineStudio.UI.ViewModels machine.MachineEventsStateProvider.EventsResolved += MachineEventsStateProvider_EventsResolved; } }; + + ToggleSpeechCommand = new RelayCommand(() => { SpeechProvider.Mute = !SpeechProvider.Mute; }); + + ResolveMachineEventCommand = new RelayCommand<MachinesEvent>(ResolveMachineEvent); } private void MachineEventsStateProvider_EventsResolved(object sender, IEnumerable<MachinesEvent> e) @@ -542,5 +568,17 @@ namespace Tango.MachineStudio.UI.ViewModels { _applicationManager.ShutDown(); } + + /// <summary> + /// Displays the HTML. + /// </summary> + /// <param name="machineEvent">The HTML page.</param> + private void ResolveMachineEvent(MachinesEvent machineEvent) + { + if (_htmlPresenter.DisplayHtml(machineEvent.EventType.HtmlPage)) + { + //Send resolved to embedded ! + } + } } } |
