Example #1
0
        private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            HashIni ini = Profile.ReadAll(IniPath);

            AmbLib.SaveFormXYWH(this, SECTION_LOCATION, ini);
            AmbLib.SaveListViewColumnWidth(listMain, SECTION_OPTION, KEY_COLUMN_WIDTH, ini);
            AmbLib.SaveComboBox(cmbApplication, SECTION_APP_COMBO, MAX_COMBO_SAVE, ini);
            AmbLib.SaveComboBox(cmbArguments, SECTION_ARG_COMBO, MAX_COMBO_SAVE, ini);
            if (!Profile.WriteAll(ini, IniPath))
            {
                CppUtils.Alert("Failed to save ini");
            }
        }
Example #2
0
        private void FormMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            bool failed = false;

            HashIni ini = Profile.ReadAll(IniPath);

            failed |= !Ambiesoft.Profile.WriteString("option", "ffmpeg", ffmpeg_, ini);
            failed |= !AmbLib.SaveListViewColumnWidth(lvMain, SECTION_OPTION, KEY_COLUMN_WIDTH, ini);
            failed |= !AmbLib.SaveFormXYWH(this, SECTION_OPTION, ini);
            failed |= !Profile.WriteAll(ini, IniPath);
            if (failed)
            {
                CppUtils.CenteredMessageBox(this,
                                            Properties.Resources.S_INISAVE_FAILED,
                                            Application.ProductName,
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
            }
        }
Example #3
0
        private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            HashIni ini = Profile.ReadAll(Program.IniFile);

            if (WindowState == FormWindowState.Normal)
            {
                Profile.WriteInt(SECTION_OPTION, KEY_X, Location.X, ini);
                Profile.WriteInt(SECTION_OPTION, KEY_Y, Location.Y, ini);
                Profile.WriteInt(SECTION_OPTION, KEY_WIDTH, this.Size.Width, ini);
                Profile.WriteInt(SECTION_OPTION, KEY_HEIGHT, this.Size.Height, ini);
            }

            AmbLib.SaveListViewColumnWidth(lvMain, SECTION_OPTION, KEY_COLUMN, ini);


            Profile.WriteInt(SECTION_OPTION, KEY_LISTVIEWCOLOR1, option_.btnLVColor1.BackColor.ToArgb(), ini);
            Profile.WriteInt(SECTION_OPTION, KEY_LISTVIEWCOLOR2, option_.btnLVColor2.BackColor.ToArgb(), ini);

            if (!Profile.WriteAll(ini, Program.IniFile))
            {
                Alert(Properties.Resources.FAILED_TO_SAVE_SETTING);
            }
        }