Esempio n. 1
0
        public FormMain()
        {
            InitializeComponent();

            HashIni ini = Profile.ReadAll(IniFile);

            bool bval;

            Profile.GetBool(SECTION_OPTION, KEY_LOCATIONSAVED, false, out bval, ini);
            if (bval)
            {
                int x, y, width, height;
                Profile.GetInt(SECTION_OPTION, KEY_X, this.Location.X, out x, ini);
                Profile.GetInt(SECTION_OPTION, KEY_Y, this.Location.Y, out y, ini);

                Profile.GetInt(SECTION_OPTION, KEY_Width, this.Size.Width, out width, ini);
                Profile.GetInt(SECTION_OPTION, KEY_Height, this.Size.Height, out height, ini);

                LoadOptionData(ini);

                if (AmbLib.IsRectAppearInScreen(new Rectangle(x, y, width, height)))
                {
                    this.StartPosition = FormStartPosition.Manual;
                    this.Location      = new Point(x, y);
                    this.Size          = new Size(width, height);
                }
            }
        }