コード例 #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
ファイル: ElementGrid.cs プロジェクト: tombogle/saymore
        /// ------------------------------------------------------------------------------------
        protected override void OnHandleDestroyed(EventArgs e)
        {
            if (!DesignMode)
            {
                GridSettings = GridSettings.Create(this);
            }

            base.OnHandleDestroyed(e);
        }
コード例 #5
0
ファイル: FieldsValuesGrid.cs プロジェクト: vkarthim/saymore
        /// ------------------------------------------------------------------------------------
        protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)
        {
            base.OnColumnWidthChanged(e);

            if (!string.IsNullOrEmpty(_model.GridSettingsName))
            {
                Settings.Default[_model.GridSettingsName] = GridSettings.Create(this);
            }
        }
コード例 #6
0
        /// ------------------------------------------------------------------------------------
        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
ファイル: ElementGrid.cs プロジェクト: tombogle/saymore
        /// ------------------------------------------------------------------------------------
        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);
 }
コード例 #16
0
		/// ------------------------------------------------------------------------------------
		public override void SaveSettings()
		{
			Properties.Settings.Default.OptionsDlgFontGrid = GridSettings.Create(_grid);
			base.SaveSettings();
		}