protected override void OnActivated(IActivatedEventArgs args) { base.OnActivated(args); { SetStatusBar(); } if (args.Kind == ActivationKind.ToastNotification) { //Get the pre-defined arguments and user inputs from the eventargs; var toastArgs = args as ToastNotificationActivatedEventArgs; var splash = toastArgs.SplashScreen; var arguments = toastArgs.Argument; if (Window.Current.Content == null) { if (toastArgs.PreviousExecutionState != ApplicationExecutionState.Running) { SplashScreenEx extendedSplash = new SplashScreenEx(splash, arguments); Window.Current.Content = extendedSplash; } } } else if (args.Kind == ActivationKind.VoiceCommand) { var tArgs = args as VoiceCommandActivatedEventArgs; var splash = tArgs.SplashScreen; var arguments = tArgs.Result.Text; if (Window.Current.Content == null) { if (tArgs.PreviousExecutionState != ApplicationExecutionState.Running) { SplashScreenEx extendedSplash = new SplashScreenEx(splash, arguments); Window.Current.Content = extendedSplash; } } //Window.Current.Content = spl; //// Event args can represent many different activation types. //// Cast it so we can get the parameters we care about out. //var commandArgs = args as VoiceCommandActivatedEventArgs; //Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = commandArgs.Result; //// Get the name of the voice command and the text spoken. //// See VoiceCommands.xml for supported voice commands. //string voiceCommandName = speechRecognitionResult.RulePath[0]; //string textSpoken = speechRecognitionResult.Text; //// commandMode indicates whether the command was entered using speech or text. //// Apps should respect text mode by providing silent (text) feedback. //string commandMode = this.SemanticInterpretation("commandMode", speechRecognitionResult); } }
protected override void OnActivated(IActivatedEventArgs args) { base.OnActivated(args); SetStatusBar(); if (args.Kind == ActivationKind.ToastNotification) { //Get the pre-defined arguments and user inputs from the eventargs; var toastArgs = args as ToastNotificationActivatedEventArgs; var splash = toastArgs.SplashScreen; var arguments = toastArgs.Argument; if (Window.Current.Content == null) { if (toastArgs.PreviousExecutionState != ApplicationExecutionState.Running) { SplashScreenEx extendedSplash = new SplashScreenEx(splash, arguments); Window.Current.Content = extendedSplash; } } } else if (args.Kind == ActivationKind.VoiceCommand) { var tArgs = args as VoiceCommandActivatedEventArgs; var splash = tArgs.SplashScreen; var arguments = tArgs.Result.Text; if (Window.Current.Content == null) { if (tArgs.PreviousExecutionState != ApplicationExecutionState.Running) { SplashScreenEx extendedSplash = new SplashScreenEx(splash, arguments); Window.Current.Content = extendedSplash; } } //Window.Current.Content = spl; //// Event args can represent many different activation types. //// Cast it so we can get the parameters we care about out. //var commandArgs = args as VoiceCommandActivatedEventArgs; //Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult = commandArgs.Result; //// Get the name of the voice command and the text spoken. //// See VoiceCommands.xml for supported voice commands. //string voiceCommandName = speechRecognitionResult.RulePath[0]; //string textSpoken = speechRecognitionResult.Text; //// commandMode indicates whether the command was entered using speech or text. //// Apps should respect text mode by providing silent (text) feedback. //string commandMode = this.SemanticInterpretation("commandMode", speechRecognitionResult); } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { var task = ThreadPool.RunAsync(async(x) => { var storageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/CortanaCommands.xml")); await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(storageFile); }); if (Window.Current.Content == null) { if (e.PreviousExecutionState != ApplicationExecutionState.Running) { if (e.Arguments == "Com.Aurora.AuWeather.Calculator") { Calculator.MainPage m = new Calculator.MainPage(); Window.Current.Content = m; Window.Current.Activate(); } else { SplashScreenEx extendedSplash = new SplashScreenEx(e.SplashScreen, e.Arguments); Window.Current.Content = extendedSplash; } } } #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { //this.DebugSettings.IsTextPerformanceVisualizationEnabled = true; //this.DebugSettings.EnableFrameRateCounter = true; //this.DebugSettings.IsOverdrawHeatMapEnabled = true; //this.DebugSettings.EnableRedrawRegions = true; } #endif if (e.Arguments != "Com.Aurora.AuWeather.Calculator") { SetStatusBar(); } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { var task = ThreadPool.RunAsync(async (x) => { var storageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/CortanaCommands.xml")); await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(storageFile); }); if (Window.Current.Content == null) { if (e.PreviousExecutionState != ApplicationExecutionState.Running) { if (e.Arguments == "Com.Aurora.AuWeather.Calculator") { Calculator.MainPage m = new Calculator.MainPage(); Window.Current.Content = m; Window.Current.Activate(); } else { SplashScreenEx extendedSplash = new SplashScreenEx(e.SplashScreen, e.Arguments); Window.Current.Content = extendedSplash; } } } #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { //this.DebugSettings.IsTextPerformanceVisualizationEnabled = true; //this.DebugSettings.EnableFrameRateCounter = true; //this.DebugSettings.IsOverdrawHeatMapEnabled = true; //this.DebugSettings.EnableRedrawRegions = true; } #endif if (e.Arguments != "Com.Aurora.AuWeather.Calculator") { SetStatusBar(); } }