mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Code review
- Events was moved to own sections - Removed line breaks - Added #region instead of comments
This commit is contained in:
parent
5a710116db
commit
41bc4a75cd
1 changed files with 23 additions and 36 deletions
|
|
@ -18,7 +18,7 @@ public SettingsForm()
|
|||
}
|
||||
|
||||
|
||||
/*Methods*/
|
||||
#region Methods
|
||||
private void LoadSettings()
|
||||
{
|
||||
editorFontColor.BackColor = settings.editroForeColor;
|
||||
|
|
@ -28,7 +28,6 @@ private void LoadSettings()
|
|||
editorOpenLinksWithComboBox.Text = settings.openLinks;
|
||||
editorBorderComboBox.Text = settings.editorBorder;
|
||||
fontDialog.Font = settings.editorFont;
|
||||
|
||||
autoLockOnMinimizeCheckBox.Checked = settings.autoLock;
|
||||
autoCheckUpdatesCheckBox.Checked = settings.autoCheckUpdate;
|
||||
mainMenuCheckBox.Checked = settings.mainMenuVisible;
|
||||
|
|
@ -36,25 +35,20 @@ private void LoadSettings()
|
|||
minimizeToTrayCheckBox.Checked = settings.minimizeToTray;
|
||||
closeToTrayCheckBox.Checked = settings.closeToTray;
|
||||
singleInstanceCheckBox.Checked = settings.singleInstance;
|
||||
|
||||
integrateCheckBox.Checked = settings.explorerIntegrate;
|
||||
associateCheckBox.Checked = settings.explorerAssociate;
|
||||
sendToCheckBox.Checked = settings.explorerSendTo;
|
||||
|
||||
hashAlgorithmComboBox.Text = settings.HashAlgorithm;
|
||||
keySizeComboBox.Text = settings.KeySize;
|
||||
passwordIterationsTextBox.Text = settings.PasswordIterations;
|
||||
|
||||
searchBackColor.BackColor = settings.searchPanelBackColor;
|
||||
searchFontColor.BackColor = settings.searchPanelForeColor;
|
||||
searchBorderComboBox.Text = settings.searchPanelBorder;
|
||||
|
||||
toolbarBackColor.BackColor = settings.toolbarBackColor;
|
||||
toolbarBorderCheckBox.Checked = settings.toolbarBorder;
|
||||
toolbarVisibleCheckBox.Checked = settings.toolbarVisible;
|
||||
toolbarOldIconsCheckBox.Checked = settings.oldToolbarIcons;
|
||||
toolbarCloseButtonCheckBox.Checked = settings.toolbarCloseButton;
|
||||
|
||||
statusPanelBackColor.BackColor = settings.statusPanelBackColor;
|
||||
statusPanelFontColor.BackColor = settings.statusPanelFontColor;
|
||||
statusPanelVisibleCheckBox.Checked = settings.statusPanelVisible;
|
||||
|
|
@ -113,7 +107,6 @@ private static void MenuIntegrate(string action)
|
|||
key.CreateSubKey(@"Crypto Notepad\shell\cmd2\command").SetValue(string.Empty, "\"" + appExePath + "\" \"%1\" /o");
|
||||
|
||||
}
|
||||
|
||||
if (action == "disable")
|
||||
{
|
||||
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Classes\*\shell\", true);
|
||||
|
|
@ -141,10 +134,10 @@ private void SendToShortcut()
|
|||
shortcut.Arguments = "/s";
|
||||
shortcut.Save();
|
||||
}
|
||||
/*Methods*/
|
||||
#endregion
|
||||
|
||||
|
||||
/*Form Events*/
|
||||
#region Form Events
|
||||
private void SettingsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
string custom_colors = settings.customColor;
|
||||
|
|
@ -180,10 +173,25 @@ private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e)
|
|||
}
|
||||
settings.Save();
|
||||
}
|
||||
/*Form Events*/
|
||||
|
||||
private void EditorPaddingLeftTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
private void PasswordIterationsTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/*Settings Section*/
|
||||
#region Settings Section
|
||||
private void EditorFontColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
colorDialog.Color = editorFontColor.BackColor;
|
||||
|
|
@ -240,9 +248,7 @@ private void SettingsNavigation_Click(object sender, EventArgs e)
|
|||
case 6:
|
||||
settingsTabControl.SelectedTab = integrationTabPage;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsTabControl_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
@ -269,7 +275,6 @@ private void AssociateCheckBox_Click(object sender, EventArgs e)
|
|||
DissociateExtension(Assembly.GetEntryAssembly().Location, "cnp");
|
||||
}
|
||||
settings.explorerAssociate = associateCheckBox.Checked;
|
||||
|
||||
}
|
||||
|
||||
private void IntegrateCheckBox_Click(object sender, EventArgs e)
|
||||
|
|
@ -296,8 +301,7 @@ private void EditorPaddingLeftTextBox_TextChanged(object sender, EventArgs e)
|
|||
main.richTextBox.Refresh();
|
||||
settings.editorPaddingLeft = editorPaddingLeftTextBox.Text;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void SendToCheckBox_Click(object sender, EventArgs e)
|
||||
|
|
@ -315,7 +319,6 @@ private void SendToCheckBox_Click(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
settings.explorerSendTo = sendToCheckBox.Checked;
|
||||
|
||||
}
|
||||
|
||||
private void EditorInsertKeyComboBox_DropDownClosed(object sender, EventArgs e)
|
||||
|
|
@ -372,22 +375,6 @@ private void HashAlgorithmComboBox_DropDownClosed(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void EditorPaddingLeftTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void PasswordIterationsTextBox_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void FontDialog_Apply(object sender, EventArgs e)
|
||||
{
|
||||
MainForm main = Owner as MainForm;
|
||||
|
|
@ -600,7 +587,7 @@ private void SingleInstanceCheckBox_Click(object sender, EventArgs e)
|
|||
{
|
||||
settings.singleInstance = singleInstanceCheckBox.Checked;
|
||||
}
|
||||
/*Settings Section*/
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue