Exemple #1
0
        private void InitializeSettings()
        {
            SuspendLayout();
            if (Settings.Default["CalculatorLocation"] != null)
            {
                Location = Settings.Default.CalculatorLocation;
            }
            if (Settings.Default["CalculatorSize"] != null)
            {
                Size = Settings.Default.CalculatorSize;
            }
            if (Settings.Default["CalculatorWindowState"] != null)
            {
                WindowState = Settings.Default.CalculatorWindowState;
            }
            if (Settings.Default["HistoryFont"] != null)
            {
                historyRichTextBox.Font = Settings.Default.HistoryFont;
            }
            if (Settings.Default["InputFont"] != null)
            {
                inputTextBox.Font = Settings.Default.InputFont;
            }

            replaceCalculatorToolStripMenuItem.Checked = (Application.ExecutablePath.Equals(
                                                              ImageFileOptions.GetDebugger(CalculatorConstants.WindowsCalculatorName),
                                                              StringComparison.OrdinalIgnoreCase));

            allowOnlyOneInstanceToolStripMenuItem.Checked = Settings.Default.IsSingleInstance;

            ResumeLayout(true);
        }
Exemple #2
0
 private void replaceCalculatorToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (replaceCalculatorToolStripMenuItem.Checked)
     {
         ImageFileOptions.SetDebugger(
             CalculatorConstants.WindowsCalculatorName,
             Application.ExecutablePath);
     }
     else
     {
         ImageFileOptions.ClearDebugger(
             CalculatorConstants.WindowsCalculatorName);
     }
 }