예제 #1
0
 protected void SetSavedLocationName(string name)
 {
     _settingsWindowName = name;
     if (_settings != null)
     {
         _settings = Settings.Current.SavedWindows[_settingsWindowName];
     }
 }
예제 #2
0
        protected override void OnLoad(EventArgs e)
        {
            if (_settingsWindowName == null)
            {
                _settingsWindowName = this.GetType().Name + "-" + this.Name;
            }
            if (this.DesignMode)
            {
                _settings = new SettingsData.SavedWindowSettings();
            }
            else
            {
                _settings = Settings.Current.SavedWindows[_settingsWindowName];
            }
            base.OnLoad(e);

            if (StartPosition == FormStartPosition.WindowsDefaultLocation)
            {
                if (_settings.RememberLocation)
                {
                    this.Location = _settings.Location;
                }
                if (_settings.RememberLocation)
                {
                    this.Size = _settings.Size;
                }
                if (_settings.Maximised)
                {
                    this.WindowState = FormWindowState.Maximized;
                }
            }

            foreach (var splitter in _splitters)
            {
                LoadSplitContainer(splitter);
            }
            foreach (var listView in _columnListViews)
            {
                LoadObjectListViewColumns(listView);
            }

            _initialised = true;
        }