コード例 #1
0
 void mutiSpeaks()
 {
     if (btnTN.Enabled)
     {
         VoiceOX.GirlSpeak(toastNotificationsManager2.Notifications[demTB].Header);
     }
     else
     {
         VoiceOX.GirlSpeak(TracNghiem.label1.Text);
     }
 }
コード例 #2
0
 private void label2_TextChanged(object sender, EventArgs e)
 {
     if (Form1.demTB > Form1.iTB)
     {
         Form1.demTB = 0;
     }
     if (cbbSelect.SelectedIndex == 0)
     {
         try
         {
             List <int> ramdom = new List <int>();
             ramdom = UniqueRandomGenerator(0, 3);
             int a = Form1.demTB;
             label1.Text = Form1.toastNotificationsManager2.Notifications[a - 1].Header;
             lbDA.Text   = Form1.toastNotificationsManager2.Notifications[a - 1].Body;
             VoiceOX.GirlSpeak(label1.Text);
             radioButton1.Text = radomTracNghiem(Form1.demTB)[ramdom[0]];
             radioButton2.Text = radomTracNghiem(Form1.demTB)[ramdom[1]];
             radioButton3.Text = radomTracNghiem(Form1.demTB)[ramdom[2]];
             radioButton4.Text = radomTracNghiem(Form1.demTB)[ramdom[3]];
         }
         catch
         {
             List <int> ramdom = new List <int>();
             ramdom = UniqueRandomGenerator(0, 3);
             int a = Form1.demTB;
             label1.Text = Form1.toastNotificationsManager2.Notifications[a].Header;
             lbDA.Text   = Form1.toastNotificationsManager2.Notifications[a].Body;
             VoiceOX.GirlSpeak(label1.Text);
             radioButton1.Text = radomTracNghiem(Form1.demTB)[ramdom[0]];
             radioButton2.Text = radomTracNghiem(Form1.demTB)[ramdom[1]];
             radioButton3.Text = radomTracNghiem(Form1.demTB)[ramdom[2]];
             radioButton4.Text = radomTracNghiem(Form1.demTB)[ramdom[3]];
             Form1.demTB++;
         }
     }
     else
     {
         try
         {
             List <int> ramdom = new List <int>();
             ramdom = UniqueRandomGenerator(0, 3);
             int a = Form1.demTB;
             label1.Text = Form1.toastNotificationsManager2.Notifications[a - 1].Body;
             lbDA.Text   = Form1.toastNotificationsManager2.Notifications[a - 1].Header;
             // VoiceOX.GirlSpeak(label1.Text);
             radioButton1.Text = radomTracNghiemViet(Form1.demTB)[ramdom[0]];
             radioButton2.Text = radomTracNghiemViet(Form1.demTB)[ramdom[1]];
             radioButton3.Text = radomTracNghiemViet(Form1.demTB)[ramdom[2]];
             radioButton4.Text = radomTracNghiemViet(Form1.demTB)[ramdom[3]];
         }
         catch
         {
             List <int> ramdom = new List <int>();
             ramdom = UniqueRandomGenerator(0, 3);
             int a = Form1.demTB;
             label1.Text = Form1.toastNotificationsManager2.Notifications[a].Header;
             lbDA.Text   = Form1.toastNotificationsManager2.Notifications[a].Body;
             //VoiceOX.GirlSpeak(label1.Text);
             radioButton1.Text = radomTracNghiemViet(Form1.demTB)[ramdom[0]];
             radioButton2.Text = radomTracNghiemViet(Form1.demTB)[ramdom[1]];
             radioButton3.Text = radomTracNghiemViet(Form1.demTB)[ramdom[2]];
             radioButton4.Text = radomTracNghiemViet(Form1.demTB)[ramdom[3]];
             Form1.demTB++;
         }
     }
 }