Пример #1
0
 /// ------------------------------------------------------------------------------------
 protected override void SaveSettings()
 {
     Properties.Settings.Default.SFDataSourcePropertiesDlgMappingGrid = GridSettings.Create(m_fieldsGrid);
     Properties.Settings.Default.SFDataSourcePropertiesDlgSplitLoc    = scImport.SplitterDistance;
     Properties.Settings.Default.ShowSFMappingsInformation            = lblInformation.Visible;
     base.SaveSettings();
 }
Пример #2
0
        /// <summary>
        /// To enable remembering and restoring grid properties, add an entry in Settings.Settings for the grid.
        /// The name of the entry should be the name of the grid followed by "GridSettings" and the type should
        /// be "SIL.Windows.Forms.PortableSettingsProvider.GridSettings"
        /// </summary>
        /// <param name="control"></param>
        private static void RestoreGridSettings(Control control)
        {
            var grid = control as DataGridView;

            if (grid != null)
            {
                var settingName = GetGridSettingsName(grid);

                if (!string.IsNullOrEmpty(settingName))
                {
                    if (Settings.Default[settingName] == null)
                    {
                        Settings.Default[settingName] = GridSettings.Create(grid);
                        Settings.Default.Save();
                    }
                    else
                    {
                        var gridSettings = (GridSettings)Settings.Default[settingName];
                        if (gridSettings.Columns.Length == grid.Columns.Count)
                        {
                            gridSettings.InitializeGrid(grid);
                        }
                    }
                }
            }

            foreach (Control child in control.Controls)
            {
                RestoreGridSettings(child);
            }
        }
Пример #3
0
        /// ------------------------------------------------------------------------------------
        protected override void OnHandleDestroyed(EventArgs e)
        {
            if (!DesignMode)
            {
                _model.ContributorsGridSettings = GridSettings.Create(_grid);
            }

            base.OnHandleDestroyed(e);
        }
Пример #4
0
        /// ------------------------------------------------------------------------------------
        protected override void OnHandleDestroyed(EventArgs e)
        {
            if (!DesignMode)
            {
                GridSettings = GridSettings.Create(this);
            }

            base.OnHandleDestroyed(e);
        }
Пример #5
0
        /// ------------------------------------------------------------------------------------
        protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)
        {
            base.OnColumnWidthChanged(e);

            if (!string.IsNullOrEmpty(_model.GridSettingsName))
            {
                Settings.Default[_model.GridSettingsName] = GridSettings.Create(this);
            }
        }
        /// ------------------------------------------------------------------------------------
        protected override void SaveSettings()
        {
            if (_chkMakeFolder.Visible)
            {
                Properties.Settings.Default.CreateProjectFolderForNewProject = _chkMakeFolder.Checked;
            }

            Properties.Settings.Default.ProjectSettingsDlgGrid = GridSettings.Create(m_grid);
            base.SaveSettings();
        }
Пример #7
0
        /// ------------------------------------------------------------------------------------
        protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)
        {
            base.OnColumnWidthChanged(e);

            AutoResizeColumnHeadersHeight();
            ColumnHeadersHeight += 8;

            if (!DesignMode)
            {
                GridSettings = GridSettings.Create(this);
            }
        }
Пример #8
0
        private static void SaveGridSettings(Control control)
        {
            var grid = control as DataGridView;

            if (grid != null)
            {
                var settingName = GetGridSettingsName(grid);

                if (!string.IsNullOrEmpty(settingName))
                {
                    Settings.Default[settingName] = GridSettings.Create(grid);
                }
            }

            foreach (Control child in control.Controls)
            {
                SaveGridSettings(child);
            }
        }
Пример #9
0
        /// ------------------------------------------------------------------------------------
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            Properties.Settings.Default.UndefinedPhoneticCharactersDlgCharsGrid = GridSettings.Create(m_gridChars);
            Properties.Settings.Default.UndefinedPhoneticCharactersDlgWhereGrid = GridSettings.Create(m_gridWhere);
            Properties.Settings.Default.UndefinedPhoneticCharactersDlgSplitLoc  = splitContainer1.SplitterDistance;

            if (m_project != null)
            {
                if (m_project.ShowUndefinedCharsDlg != chkShowUndefinedCharDlg.Checked ||
                    m_project.IgnoreUndefinedCharsInSearches != chkIgnoreInSearches.Checked)
                {
                    m_project.ShowUndefinedCharsDlg          = chkShowUndefinedCharDlg.Checked;
                    m_project.IgnoreUndefinedCharsInSearches = chkIgnoreInSearches.Checked;
                    m_project.Save();
                }
            }

            base.OnFormClosing(e);
        }
Пример #10
0
        /// ------------------------------------------------------------------------------------
        public ContributorsEditor(ComponentFile file, string imageKey,
                                  AutoCompleteValueGatherer autoCompleteProvider, PersonInformant personInformant) :
            base(file, null, imageKey)
        {
            InitializeComponent();
            Name = "Contributors";

            _model = new ContributorsListControlViewModel(autoCompleteProvider, SaveContributors);
            var dataGridView = new DataGridView();

            dataGridView.Columns[dataGridView.Columns.Add("date", "date")].Visible = false;
            _model.ContributorsGridSettings = GridSettings.Create(dataGridView);

            // ReSharper disable once UseObjectOrCollectionInitializer
            _contributorsControl      = new ContributorsListControl(_model);
            _contributorsControl.Dock = DockStyle.Fill;
            _contributorsControl.ValidatingContributor += HandleValidatingContributor;

            InitializeGrid();

            // imageKey == "Contributor" when ContributorsEditor is lazy loaded for the session file type
            if (imageKey != null)
            {
                AddSessionControls();
            }
            else
            {
                Controls.Add(_contributorsControl);
            }

            file.AfterSave += file_AfterSave;

            SetComponentFile(file);

            if (personInformant != null)
            {
                personInformant.PersonUiIdChanged += HandlePersonsUiIdChanged;
            }
        }
Пример #11
0
 /// ------------------------------------------------------------------------------------
 protected override void SaveSettings()
 {
     Properties.Settings.Default.Fw7DataSourcePropertiesDlgFieldsGrid = GridSettings.Create(m_grid);
     base.SaveSettings();
 }
Пример #12
0
 /// ------------------------------------------------------------------------------------
 protected override void SaveSettings()
 {
     Properties.Settings.Default.DistinctiveFeaturesDlgPhoneGrid = GridSettings.Create(_gridPhones);
     Properties.Settings.Default.DistinctiveFeaturesDlgSplitLoc  = _splitFeatures.SplitterDistance;
     base.SaveSettings();
 }
Пример #13
0
 /// ------------------------------------------------------------------------------------
 protected override void SaveSettings()
 {
     Properties.Settings.Default.AmbiguousSequencesDlgGrid = GridSettings.Create(_grid);
     base.SaveSettings();
 }
Пример #14
0
 /// ------------------------------------------------------------------------------------
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     Properties.Settings.Default.OpenProjectDlgGrid = GridSettings.Create(_grid);
     Properties.Settings.Default.OpenProjectsInNewWindowCheckedValue = _checkBoxOpenInNewWindow.Checked;
     base.OnFormClosing(e);
 }
Пример #15
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Save the form's state.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     Settings.Default.GridSettings = GridSettings.Create(Grid);
     Settings.Default.Save();
     base.OnFormClosing(e);
 }
		/// ------------------------------------------------------------------------------------
		public override void SaveSettings()
		{
			Properties.Settings.Default.OptionsDlgFontGrid = GridSettings.Create(_grid);
			base.SaveSettings();
		}