Esempio n. 1
0
        private void apropo(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();
            }
            apropos ap = new apropos(wilaya, output_out);

            ap.Show();
            this.Close();
        }
Esempio n. 2
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;
            }
        }