Example #1
0
        private void SaveWindowsToINI()
        {
            int           formIDX       = 0;
            bool          saveErr       = false;
            tclsIniParser mclsIniParser = new tclsIniParser(AppDomain.CurrentDomain.BaseDirectory + "Database\\GUI Layout Databases\\GUI Layout Rabbit 1_0 ECU.INI");

            foreach (Form clsForm in this.MdiChildren)
            {
                String szFormName = clsForm.Name;

                try
                {
                    mclsIniParser.AddSetting("Window Layout", szFormName + formIDX.ToString() + ".Left", clsForm.Left.ToString());
                    mclsIniParser.AddSetting("Window Layout", szFormName + formIDX.ToString() + ".Width", clsForm.Width.ToString());
                    mclsIniParser.AddSetting("Window Layout", szFormName + formIDX.ToString() + ".Top", clsForm.Top.ToString());
                    mclsIniParser.AddSetting("Window Layout", szFormName + formIDX.ToString() + ".Height", clsForm.Height.ToString());
                }
                catch
                {
                    if (false == saveErr)
                    {
                        MessageBox.Show("Error saving view context");
                    }

                    saveErr = true;
                }

                formIDX++;
            }

            mclsIniParser.SaveSettings();
        }
Example #2
0
        private void SaveColorsToINI()
        {
            int           iColorIDX;
            tclsIniParser mclsIniParser = new tclsIniParser(AppDomain.CurrentDomain.BaseDirectory + "Database\\GUI Layout Databases\\GUI Layout Rabbit 1_0 ECU.INI");

            //UInt32 u32ARGB;
            //string szSetting;
            //byte u8ColorByte;

            for (iColorIDX = 1; iColorIDX < 20; iColorIDX++)
            {
                //szSetting = "";
                //u32ARGB = maclsLoggingColor[iColorIDX - 1].ToArgb();
                //u8ColorByte = (byte)(u32ARGB >> 24);
                //szSetting += u8ColorByte.ToString();
            }

            foreach (Form clsForm in this.MdiChildren)
            {
                String szFormTitle = clsForm.Text;

                mclsIniParser.AddSetting("Window Layout", szFormTitle + ".Left", clsForm.Left.ToString());
                mclsIniParser.AddSetting("Window Layout", szFormTitle + ".Width", clsForm.Width.ToString());
                mclsIniParser.AddSetting("Window Layout", szFormTitle + ".Top", clsForm.Top.ToString());
                mclsIniParser.AddSetting("Window Layout", szFormTitle + ".Height", clsForm.Height.ToString());
            }

            mclsIniParser.SaveSettings();
        }