/* * Get the option selected by user and perform an action */ private void activation(object sender, ActivationRoutedEventArgs e) { String name = ((Rectangle)sender).Name; switch (name) { case "save": //Save the document this.parent.SendCommand("save", null); break; case "load": //Open an other document this.parent.SendCommand("load", null); break; case "style": //Open style window this.parent.SendCommand("style", null); break; case "spell": //Open spell checker this.parent.SendCommand("spell", null); break; case "exit": //Exit the application this.parent.SendCommand("exit", null);; break; } }
private void BtnNext_OnActivated(object sender, ActivationRoutedEventArgs e) { if (!_mainPanelSet1Manager.HasPanel()) { return; } MainPanel.Content = _mainPanelSet1Manager.GetNextPanel(true); }
/** * Trigger with the user validate a button on the spelling window with eye */ public void SpellButton(object sender, ActivationRoutedEventArgs e) { string bt_name = ((Button)sender).Name; switch (bt_name) { case "bt_quit": //Quit the splelling correction this.Close(); break; case "bt_ignore": //Ignore on go to the next available error this.spErr.IgnoreAll(); try { this.nextError = this.parent.TextEdit.GetNextSpellingErrorPosition(this.nextError, LogicalDirection.Forward); if (this.nextError == null) { this.Close(); } else { this.NextCorrection(); this.ToCorrect(); } } catch (ArgumentNullException) { this.Close(); } break; case "bt_ok": //Validation of the correction if (this.suggestions.SelectedItem != null) { string choice = ((TextBlock)this.suggestions.SelectedItem).Text; this.spErr.Correct(choice); try { this.nextError = this.parent.TextEdit.GetNextSpellingErrorPosition(this.nextError, LogicalDirection.Forward); if (this.nextError == null) { this.Close(); } else { this.NextCorrection(); this.ToCorrect(); } } catch (ArgumentNullException) { this.Close(); } } break; } }
/* * Get the button activated by the user and perform an action */ private void ValidButton(object sender, ActivationRoutedEventArgs e) { string bt_name = ((Button)sender).Name; switch (bt_name) { case "bt_ok": //Valide the user choice and send to the text box the change String family = ((String)((ListBoxItem)this.fontfamily.SelectedItem).Content); String size = ((TextBlock)(this.fontsize.SelectedItem)).Text.ToString(); this.parent.SendCommand("fontsize", size); this.parent.SendCommand("fontfamily", family); this.Close(); break; case "bt_quit": //Exit the font change without modification this.Close(); break; } }
private void Btn3_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("It doesn't matter!"); }
private void Btn2_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("I dont like that!"); }
private void Key_A_Click(object sender, ActivationRoutedEventArgs e) { typingResults.Text += "A"; }
private void BtnTired_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("I'm Tired"); }
//Activation Events private void BtnYes_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("Yes!"); }
private void Btn3_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("I\'ve no Idea!"); }
private void Btn2_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("That is bad!"); }
private void GazeArea_Activated(object sender, ActivationRoutedEventArgs e) { }
private void BtnHowIsEveryone_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("How is everyone?"); }
private void BtnHowAreYou_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("How are you?"); }
/* * Get the font family selected by user */ private void fontFamilyActiv(object sender, ActivationRoutedEventArgs e) { this.fontfamily.SelectedItem = ((ListBoxItem)sender); }
private void BtnMaybe_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("Maybe!"); }
private void BtnHungry_OnActivated(object sender, ActivationRoutedEventArgs e) { TextToSpeech.Speak("I'm Hungry"); }