示例#1
0
        private void OK_Button_Click(object sender, RoutedEventArgs e)
        {
            function functionIn = new function();
            string   str        = Zahl_Textbox.Text;

            ///validate Input
            functionIn.AnalyseZahl(str);

            ///Output Messages...Start
            if (Globals.bNumber && str == "42")
            {
                MBox.FortyTwo();
                output.Text = "Nerd!";
            }
            else if (Globals.bNumber && str != string.Empty)
            {
                output.Text = str + " ist eine Zahl";
                MBox.Congratulations();
            }
            else if (!Globals.bNumber && str != string.Empty)
            {
                output.Text = str + " ist keine Zahl. kannst du nicht lesen?";
                MBox.NotANumber();
            }

            else
            {
                MBox.NoInput();
            }
            ///Output Messages...End

            ///clear text fiel after check
            str = string.Empty;
        }
示例#2
0
 public MainWindow()
 {
     InitializeComponent();
     MBox.InfoBox();
 }