Example #1
0
        private void carte(object sender, RoutedEventArgs e)
        {
            StreamReader sr  = new StreamReader(@"son.txt");
            string       str = sr.ReadLine();

            sr.Close();
            if (str == "Activé")
            {
                MediaPlayer player = new MediaPlayer();
                player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute));
                player.Play();
            }
            accueil ac = new accueil(wilaya, output_out);

            ac.Show();
            this.Close();
        }
        // L'événement du bouton démarrer ---> Accueil
        private void demarrer(object sender, RoutedEventArgs e)
        {
            StreamReader sr  = new StreamReader(@"son.txt");
            string       str = sr.ReadLine();

            sr.Close();
            if (str == "Activé")
            {
                MediaPlayer player = new MediaPlayer();
                player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute));
                player.Play();
            }
            accueil nb = new accueil(wilaya, output_out);

            nb.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            nb.Show();
            this.Close();
        }
Example #3
0
 private void Btn_valid_Click(object sender, RoutedEventArgs e)
 {
     if (output_out.nbreJours != 0)
     {
         StreamReader sr  = new StreamReader(@"son.txt");
         string       str = sr.ReadLine();
         sr.Close();
         if (str == "Activé")
         {
             MediaPlayer player = new MediaPlayer();
             player.Open(new Uri(@"..\..\click.mp3", UriKind.RelativeOrAbsolute));
             player.Play();
         }
         accueil nvl = new accueil(wilaya, output_out);
         nvl.Show();
         this.Close();
     }
 }
Example #4
0
        private void Window_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.A:
            {
                accueil ev = new accueil(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.M:
            {
                meteo_jour ev = new meteo_jour(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.P:
            {
                prevision ev = new prevision(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.E:
            {
                evolution ev = new evolution(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.T:
            {
                Contact ev = new Contact(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.R:
            {
                parametre ev = new parametre(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.O:
            {
                apropos ev = new apropos(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.D:
            {
                credit ev = new credit(wilaya, output_out);
                ev.Show();
                this.Close();
            }
            break;

            case Key.Z:
            {
                mise_a_jour mise = new mise_a_jour(wilaya, output_out);
                mise.Show();
                this.Close();
            }
            break;

            case Key.S:
            {
                StreamReader sr  = new StreamReader(@"son.txt");
                string       str = sr.ReadLine();
                sr.Close();
                if (str == "Activé")
                {
                    MediaPlayer player = new MediaPlayer();
                    player.Open(new Uri(@"..\..\screen.mp3", UriKind.RelativeOrAbsolute));
                    player.Play();
                }
                //déclaration et instanciation de la fenêtre parcourir
                SaveFileDialog parcourir = new SaveFileDialog();
                parcourir.DefaultExt = "png";
                //je spécifie que seul les images .png sont selectionnables
                parcourir.Filter = " Fichier PNG (*.PNG)|*.png";
                //ouverture de la fenêtre parcourir
                parcourir.ShowDialog();
                CreateScreenShot(this, parcourir.FileName);
            }
            break;
            }
        }