mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Added able to auto-clear clipboard on app close
This commit is contained in:
parent
6a2adbbf65
commit
9e18e19eec
5 changed files with 37 additions and 0 deletions
|
|
@ -186,6 +186,9 @@
|
|||
<setting name="statusPanelClipboard" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="clearClipboardAtClose" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="shortcutKeys" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
|
|
|
|||
|
|
@ -905,6 +905,10 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
|||
writer.Write(encryptedText);
|
||||
writer.Close();
|
||||
}
|
||||
if (settings.clearClipboardAtClose)
|
||||
{
|
||||
Clipboard.Clear();
|
||||
}
|
||||
}
|
||||
if (res == DialogResult.Cancel)
|
||||
{
|
||||
|
|
@ -915,6 +919,14 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
if (settings.clearClipboardAtClose)
|
||||
{
|
||||
Clipboard.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void MainForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
Visible = true;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ private void LoadSettings()
|
|||
minimizeToTrayCheckBox.Checked = settings.minimizeToTray;
|
||||
closeToTrayCheckBox.Checked = settings.closeToTray;
|
||||
singleInstanceCheckBox.Checked = settings.singleInstance;
|
||||
clearClipboardCheckBox.Checked = settings.clearClipboardAtClose;
|
||||
integrateCheckBox.Checked = settings.explorerIntegrate;
|
||||
associateCheckBox.Checked = settings.explorerAssociate;
|
||||
sendToCheckBox.Checked = settings.explorerSendTo;
|
||||
|
|
@ -608,6 +609,10 @@ private void ClearClipboardTextBox_TextChanged(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void ClearClipboardCheckBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
settings.clearClipboardAtClose = clearClipboardCheckBox.Checked;
|
||||
}
|
||||
|
||||
private void ShortcutKeysCheckBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
|
|||
14
Crypto Notepad/Properties/Settings.Designer.cs
generated
14
Crypto Notepad/Properties/Settings.Designer.cs
generated
|
|
@ -777,6 +777,20 @@ public bool statusPanelClipboard {
|
|||
this["statusPanelClipboard"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool clearClipboardAtClose {
|
||||
get {
|
||||
return ((bool)(this["clearClipboardAtClose"]));
|
||||
}
|
||||
set {
|
||||
this["clearClipboardAtClose"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider))]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
|
|
|
|||
|
|
@ -176,6 +176,9 @@
|
|||
<Setting Name="statusPanelClipboard" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="clearClipboardAtClose" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="shortcutKeys" Provider="PortableSettingsProvider" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
|
|
|
|||
Loading…
Reference in a new issue