Beispiel #1
0
 private void HisName_GotFocus(object sender, RoutedEventArgs e)
 {
     if (HisName.Text == "His Name")
     {
         HisName.Clear();
     }
 }
Beispiel #2
0
 private void HerName_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (HisName.Text == "His Name" || HisName.Text == "")
         {
             HisName.Focus();
         }
         else
         {
             GoButton_Click(sender, e);
         }
     }
 }
Beispiel #3
0
        void AnimationEngine_Tick(object sender, EventArgs e)
        {
            //for (int i = 0; i < 6; i++)
            //{
            //    LabelMap[i].Opacity = 1;
            //}
            if (CharacterToBeHighlighted - 1 >= 0)
            {
                LabelMap[(CharacterToBeHighlighted - 1) % 6].Opacity = 1;
            }
            else
            {
                LabelMap[5].Opacity = 1;
            }
            LabelMap[CharacterToBeHighlighted % 6].Opacity = 0.5;
            if (CharacterToBeHighlighted < NumberOfIterations)
            {
                CharacterToBeHighlighted++;
            }
            else
            {
                AnimationEngine.Stop();
                NameDisplayer.Text = HisName.Text.ToUpper() + "  and  " + HerName.Text.ToUpper();
                switch (CharacterToBeHighlighted % 6)
                {
                case 0:
                    Result.Text = "Meant to be FRIENDS";
                    break;

                case 1:
                    Result.Text = "Meant to be LOVERS";
                    break;

                case 2:
                    Result.Text = "Meant to be AFFECTIONATE PEOPLE";
                    break;

                case 3:
                    Result.Text = "Meant to be MARRIED";
                    break;

                case 4:
                    Result.Text = "Meant to be ENEMIES";
                    break;

                case 5:
                    Result.Text = "Meant to be SIBLINGS";
                    break;
                }
                FortuneTeller.SpeakAsync(HisName.Text.ToLower() + " and " + HerName.Text.ToLower() + " are " + Result.Text.ToLower());

                HisName.Text = "His Name";
                HerName.Text = "Her Name";

                if (HisName.IsFocused == true)
                {
                    HisName.SelectAll();
                }
                else if (HerName.IsFocused == true)
                {
                    HerName.SelectAll();
                }
            }
        }