Ejemplo n.º 1
0
 void Option3Clicked()
 {
     ButtonOption1Color = "#262c36";
     ButtonOption2Color = "#262c36";
     ButtonOption3Color = "#0594d6";
     SelectedOptionItem = Option3Item;
 }
Ejemplo n.º 2
0
 void PlaySound3()
 {
     ButtonOption1Color = "#262c36";
     ButtonOption2Color = "#262c36";
     ButtonOption3Color = "#0594d6";
     SelectedOptionItem = Option3Item;
     PlaySound(SelectedOptionItem.SoundName);
 }
Ejemplo n.º 3
0
        void ShowNextItem()
        {
            //TODO - Prepare to show it!
            CurrentItem = Data[0];
            switch (CurrentItem.Type)
            {
            case HiraganaExamType.CharacterToSound:
            {
                JapaneseCharacterText = CurrentItem.JapanCharacter;
                ShowEnglishToJapan    = false;
                ShowJapanToEnglish    = false;
                ShowSoundToCharacter  = false;
                ShowCharacterToSound  = true;
                int rightSample = new Random().Next(1, 10000);    //Just to generate more chances.
                if (rightSample < 3333)
                {
                    rightSample = 1;
                }
                else if (rightSample < 6666)
                {
                    rightSample = 2;
                }
                else
                {
                    rightSample = 3;
                }
                switch (rightSample)
                {
                case 1:
                {
                    Option1Item = CurrentItem;
                    Option2Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option3Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option2Item.JapanCharacter);
                }
                break;

                case 2:
                {
                    Option1Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option2Item = CurrentItem;
                    Option3Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option1Item.JapanCharacter);
                }
                break;

                case 3:
                {
                    Option1Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option2Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option1Item.JapanCharacter);
                    Option3Item = CurrentItem;
                }
                break;
                }
                SelectedOptionItem = null;
                ButtonOption1Color = "#262c36";
                ButtonOption2Color = "#262c36";
                ButtonOption3Color = "#262c36";
            }
            break;

            case HiraganaExamType.EnglishToJapan:
            {
                EnglishCharacterText = CurrentItem.EnglishCharacter;
                ShowCharacterToSound = false;
                ShowJapanToEnglish   = false;
                ShowSoundToCharacter = false;
                ShowEnglishToJapan   = true;
                int rightSample = new Random().Next(1, 10000);    //Just to generate more chances.
                if (rightSample < 3333)
                {
                    rightSample = 1;
                }
                else if (rightSample < 6666)
                {
                    rightSample = 2;
                }
                else
                {
                    rightSample = 3;
                }
                switch (rightSample)
                {
                case 1:
                {
                    Option1Item = CurrentItem;
                    Option2Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option3Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option2Item.JapanCharacter);
                }
                break;

                case 2:
                {
                    Option1Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option2Item = CurrentItem;
                    Option3Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option1Item.JapanCharacter);
                }
                break;

                case 3:
                {
                    Option1Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter);
                    Option2Item = Items.RandomOrDefault(x => x.JapanCharacter != CurrentItem.JapanCharacter && x.JapanCharacter != Option1Item.JapanCharacter);
                    Option3Item = CurrentItem;
                }
                break;
                }
                Option1Text        = Option1Item.JapanCharacter;
                Option2Text        = Option2Item.JapanCharacter;
                Option3Text        = Option3Item.JapanCharacter;
                SelectedOptionItem = null;
                ButtonOption1Color = "#262c36";
                ButtonOption2Color = "#262c36";
                ButtonOption3Color = "#262c36";
            }
            break;

            case HiraganaExamType.JapanToEnglish:
            {
                JapaneseCharacterText = CurrentItem.JapanCharacter;
                ShowCharacterToSound  = false;
                ShowEnglishToJapan    = false;
                ShowSoundToCharacter  = false;
                ShowJapanToEnglish    = true;
                int rightSample = new Random().Next(1, 10000);    //Just to generate more chances.
                if (rightSample < 3333)
                {
                    rightSample = 1;
                }
                else if (rightSample < 6666)
                {
                    rightSample = 2;
                }
                else
                {
                    rightSample = 3;
                }
                switch (rightSample)
                {
                case 1:
                {
                    Option1Item = CurrentItem;
                    Option2Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option3Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option2Item.EnglishCharacter);
                }
                break;

                case 2:
                {
                    Option1Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option2Item = CurrentItem;
                    Option3Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option1Item.EnglishCharacter);
                }
                break;

                case 3:
                {
                    Option1Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option2Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option1Item.EnglishCharacter);
                    Option3Item = CurrentItem;
                }
                break;
                }
                Option1Text        = Option1Item.EnglishCharacter;
                Option2Text        = Option2Item.EnglishCharacter;
                Option3Text        = Option3Item.EnglishCharacter;
                SelectedOptionItem = null;
                ButtonOption1Color = "#262c36";
                ButtonOption2Color = "#262c36";
                ButtonOption3Color = "#262c36";
            }
            break;

            case HiraganaExamType.SoundToCharacter:
            {
                ShowCharacterToSound = false;
                ShowEnglishToJapan   = false;
                ShowJapanToEnglish   = false;
                ShowSoundToCharacter = true;
                int rightSample = new Random().Next(1, 10000);    //Just to generate more chances.
                if (rightSample < 3333)
                {
                    rightSample = 1;
                }
                else if (rightSample < 6666)
                {
                    rightSample = 2;
                }
                else
                {
                    rightSample = 3;
                }
                switch (rightSample)
                {
                case 1:
                {
                    Option1Item = CurrentItem;
                    Option2Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option3Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option2Item.EnglishCharacter);
                }
                break;

                case 2:
                {
                    Option1Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option2Item = CurrentItem;
                    Option3Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option1Item.EnglishCharacter);
                }
                break;

                case 3:
                {
                    Option1Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter);
                    Option2Item = Items.RandomOrDefault(x => x.EnglishCharacter != CurrentItem.EnglishCharacter && x.EnglishCharacter != Option1Item.EnglishCharacter);
                    Option3Item = CurrentItem;
                }
                break;
                }
                Option1Text        = Option1Item.EnglishCharacter;
                Option2Text        = Option2Item.EnglishCharacter;
                Option3Text        = Option3Item.EnglishCharacter;
                SelectedOptionItem = null;
                ButtonOption1Color = "#262c36";
                ButtonOption2Color = "#262c36";
                ButtonOption3Color = "#262c36";
                PlaySound(CurrentItem.SoundName);
            }
            break;
            }
            Data.Remove(CurrentItem);
        }
Ejemplo n.º 4
0
 public HiraganaExamsDataItem(HiraganaExamsDataItem item)
 {
     JapanCharacter   = item.JapanCharacter;
     EnglishCharacter = item.EnglishCharacter;
     SoundName        = item.SoundName;
 }