Example #1
0
 private void DefinirProfil(Profil pProfil)
 {
     //-----------------------------------------------
     // Enregistre que c'est le dernier profil selectionné
     IniConfig.WriteKey("Options", "LastProfilSelected", pProfil.FichierIni);
     CurrentProfil = pProfil;
     //-----------------------------------------------
 }
Example #2
0
        //=====================================================================



        //=====================================================================
        private void ModifierProfil()
        {
            //-----------------------------------------------
            // Met à jour les informations
            Ini ini = new Ini(CurrentProfil.FichierIni);

            ini.WriteKey("Settings", "Name", TextBoxName.Text);
            ini.WriteKey("Settings", "Wallpaper", TextBoxWallpaper.Text);
            ini.WriteKey("Settings", "Description", TextBoxDesc.Text);
            ini.WriteKey("Settings", "Opacity", (255 / 10 * ((TrackBar)TrackOpacity).Value).ToString());
            ini.WriteKey("Settings", "CommandCmd", TextBoxCommandCmd.Text);
            ini.WriteKey("Settings", "CommandPS", TextBoxCommandPS.Text);
            ini.WriteKey("Settings", "Directory", TextBoxDirectory.Text);

            CurrentProfil.Name        = TextBoxName.Text;
            CurrentProfil.Wallpaper   = TextBoxWallpaper.Text;
            CurrentProfil.Description = TextBoxDesc.Text;
            CurrentProfil.Opacity     = (int)Math.Round(255.0 / 10.0 * ((TrackBar)TrackOpacity).Value, 0);
            CurrentProfil.CommandCmd  = TextBoxCommandCmd.Text;
            CurrentProfil.CommandPS   = TextBoxCommandPS.Text;
            CurrentProfil.Directory   = TextBoxDirectory.Text;

            // Actualise l'affichage (fond d'écran)
            ((Menu)Owner).AfficherInstance();
            //-----------------------------------------------
        }
Example #3
0
        private void CreerProfil()
        {
            //-----------------------------------------------
            // Cherche un nom de fichier inexistant
            int count = 0;

            while (File.Exists(Winuntu.Menu.FOLDER_PROFILS + @"\" + count + ".ini"))
            {
                count++;
            }
            string file = (Winuntu.Menu.FOLDER_PROFILS + @"\" + count + ".ini");

            // Enregistre le profil
            Ini ini = new Ini(file);

            ini.WriteKey("Settings", "Name", TextBoxName.Text);
            ini.WriteKey("Settings", "Wallpaper", TextBoxWallpaper.Text);
            ini.WriteKey("Settings", "Description", TextBoxDesc.Text);
            ini.WriteKey("Settings", "Opacity", (255 / 10 * ((TrackBar)TrackOpacity).Value).ToString());
            ini.WriteKey("Settings", "CommandCmd", TextBoxCommandCmd.Text);
            ini.WriteKey("Settings", "CommandPS", TextBoxCommandPS.Text);
            ini.WriteKey("Settings", "Directory", TextBoxDirectory.Text);

            ((Menu)Owner).AjouterProfil(
                TextBoxName.Text,
                TextBoxWallpaper.Text,
                TextBoxDesc.Text,
                (255 / 10 * ((TrackBar)TrackOpacity).Value),
                TextBoxCommandCmd.Text,
                TextBoxCommandPS.Text,
                TextBoxDirectory.Text,
                file,
                true);

            ((Menu)Owner).AjouterInstanceCmd();
            ((Menu)Owner).AjouterInstancePS();
            //-----------------------------------------------
        }