Esempio n. 1
0
        private void LoadSettings()
        {
            _settings = SettingsWriter.ReadSettingsFile();

            if (_settings != null)
            {
                Location    = new Point(_settings.WindowPositionX, _settings.WindowPositionY);
                Size        = new Size(_settings.WindowWidth, _settings.WindowHeight);
                WindowState = _settings.FormWindowState;

                richTextBox.BackColor             = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                richTextBox.ForeColor             = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);
                richTextBox.DetectUrls            = _settings.DetectUrl;
                richTextBox.WordWrap              = _settings.WordWrap;
                wordWrapToolStripMenuItem.Checked = _settings.WordWrap;

                foreach (string fileName in _settings.RecentFileList)
                {
                    AddFileToRecentFileListMenu(fileName);
                }
            }
            else
            {
                SaveSettings();
            }
        }
        private void LoadSettings()
        {
            _settings = SettingsWriter.ReadSettingsFile();

            if (_settings != null)
            {
                Location = new Point(_settings.WindowPositionX, _settings.WindowPositionY);
                Size     = new Size(_settings.WindowWidth, _settings.WindowHeight);

                if (_settings.FormWindowState == FormWindowState.Minimized)
                {
                    _settings.FormWindowState = FormWindowState.Maximized;
                }

                WindowState = _settings.FormWindowState;

                textToEncrypt.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                textToEncrypt.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                encryptedText.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                encryptedText.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                decryptedText.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                decryptedText.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                textToDecrypt.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                textToDecrypt.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                wordWrapToolStripMenuItem.Checked = _settings.WordWrap;
                _upgradeNotice.DontShowThisAgain  = _settings.DisableUpgradeNoticeVersion11;
            }
            else
            {
                SaveSettings();
            }
        }