コード例 #1
0
ファイル: SavedLocationForm.cs プロジェクト: rvs76/Maranate
 protected void SetSavedLocationName(string name)
 {
     _settingsWindowName = name;
     if (_settings != null)
     {
         _settings = Settings.Current.SavedWindows[_settingsWindowName];
     }
 }
コード例 #2
0
ファイル: SavedLocationForm.cs プロジェクト: rvs76/Maranate
        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;
        }