@@ -620,6 +620,7 @@ private void LoadSettings()
620620 statusPanelSizeLabel . Visible = settings . statusPanelSize ;
621621 statusPanelReadonlyLabel . Visible = settings . statusPanelReadonly ;
622622 statusPanelWordwrapLabel . Visible = settings . statusPanelWordWrap ;
623+ statusPanelPasteboardLabel . Visible = settings . statusPanelPasteboard ;
623624 richTextBox . WordWrap = settings . editorWrap ;
624625 richTextBox . ForeColor = settings . editorForeColor ;
625626 richTextBox . BackColor = settings . editorBackColor ;
@@ -681,6 +682,7 @@ public void MenuIcons(bool menuIcons)
681682 changePasswordMainMenu . Image = Resources . key ;
682683 lockMainMenu . Image = Resources . lock_warning ;
683684 settingsMainMenu . Image = Resources . gear ;
685+ pasteBoardMainMenu . Image = Resources . clipboard_text ;
684686 documentationMainMenu . Image = Resources . document_text ;
685687 checkForUpdatesMainMenu . Image = Resources . upload_cloud ;
686688 aboutMainMenu . Image = Resources . information ;
@@ -961,8 +963,11 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
961963 using ( StreamWriter writer = new StreamWriter ( filePath ) )
962964 {
963965 string encryptedText = richTextBox . Text ;
964- Task . Run ( async ( ) => { encryptedText = await AES . Encrypt ( encryptedText , PublicVar . password . Get ( ) , null , settings . HashAlgorithm ,
965- Convert . ToInt32 ( settings . PasswordIterations ) , Convert . ToInt32 ( settings . KeySize ) ) ; } ) . Wait ( ) ;
966+ Task . Run ( async ( ) =>
967+ {
968+ encryptedText = await AES . Encrypt ( encryptedText , PublicVar . password . Get ( ) , null , settings . HashAlgorithm ,
969+ Convert . ToInt32 ( settings . PasswordIterations ) , Convert . ToInt32 ( settings . KeySize ) ) ;
970+ } ) . Wait ( ) ;
966971 writer . Write ( encryptedText ) ;
967972 writer . Close ( ) ;
968973 }
@@ -1022,6 +1027,7 @@ private async void MainWindow_Load(object sender, EventArgs e)
10221027 ShortcutKeys ( settings . shortcutKeys ) ;
10231028 statusPanelReadonlyLabel . Text = "Readonly: " + readOnlyMainMenu . Checked . ToString ( ) ;
10241029 statusPanelWordwrapLabel . Text = "Word Wrap: " + wordWrapMainMenu . Checked . ToString ( ) ;
1030+ statusPanelPasteboardLabel . Text = "Paste Board: " + pasteBoardMainMenu . Checked . ToString ( ) ;
10251031 if ( args . Length == 2 ) /*drag & drop to executable*/
10261032 {
10271033 OpenAsotiations ( ) ;
@@ -1503,6 +1509,7 @@ private void ToolsMainMenu_DropDownOpening(object sender, EventArgs e)
15031509 {
15041510 changePasswordMainMenu . Enabled = true ;
15051511 lockMainMenu . Enabled = true ;
1512+
15061513 }
15071514 }
15081515
@@ -1683,6 +1690,43 @@ private void SettingsMainMenu_Click(object sender, EventArgs e)
16831690 }
16841691 /*Tools*/
16851692
1693+ /*Paste Board*/
1694+ string clipboardLastText = "" ;
1695+ private void PasteBoardTimer_Tick ( object sender , EventArgs e )
1696+ {
1697+ string clipboardText = Clipboard . GetText ( ) ;
1698+ if ( ! string . IsNullOrEmpty ( clipboardText ) && clipboardLastText != clipboardText )
1699+ {
1700+ clipboardLastText = clipboardText ;
1701+ if ( richTextBox . Text . Length > 0 )
1702+ {
1703+ richTextBox . AppendText ( "\n \n " + clipboardText ) ;
1704+ richTextBox . SelectionStart = richTextBox . Text . Length ;
1705+ richTextBox . ScrollToCaret ( ) ;
1706+ }
1707+ else
1708+ {
1709+ richTextBox . AppendText ( clipboardText ) ;
1710+ }
1711+ }
1712+ }
1713+
1714+ private void PasteBoardMainMenu_Click ( object sender , EventArgs e )
1715+ {
1716+ if ( pasteBoardMainMenu . Checked )
1717+ {
1718+ Clipboard . Clear ( ) ;
1719+ pasteBoardTimer . Start ( ) ;
1720+ statusPanelPasteboardLabel . Text = "Paste Board: " + pasteBoardMainMenu . Checked . ToString ( ) ;
1721+ }
1722+ else
1723+ {
1724+ pasteBoardTimer . Stop ( ) ;
1725+ statusPanelPasteboardLabel . Text = "Paste Board: " + pasteBoardMainMenu . Checked . ToString ( ) ;
1726+ }
1727+ }
1728+ /*Paste Board*/
1729+
16861730 /*Help*/
16871731 private void DocumentationMainMenu_Click ( object sender , EventArgs e )
16881732 {
@@ -2228,7 +2272,7 @@ private void VariablesMainMenu_Click(object sender, EventArgs e)
22282272 string formattedTime = DateTime . Now . ToString ( "yyyy.MM.dd hh:mm:ss" ) ;
22292273 Debug . WriteLine ( "\n Time: " + formattedTime ) ;
22302274 Debug . WriteLine ( "PublicVar.openFileName: " + PublicVar . openFileName ) ;
2231- Debug . WriteLine ( "openFileDialog.FileName " + openFileDialog . FileName ) ;
2275+ Debug . WriteLine ( "openFileDialog.FileName " + openFileDialog . FileName ) ;
22322276 Debug . WriteLine ( "filePath: " + filePath ) ;
22332277 Debug . WriteLine ( "encryptionKey: " + PublicVar . password . Get ( ) ) ;
22342278 Debug . WriteLine ( "TypedPassword: " + TypedPassword . Value ) ;
@@ -2241,9 +2285,12 @@ private void VariablesMainMenu_Click(object sender, EventArgs e)
22412285 }
22422286
22432287
2288+
2289+
22442290 #endregion
22452291
22462292
22472293
2294+
22482295 }
22492296}
0 commit comments