mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Fix Sonar issues
This commit is contained in:
@@ -11,7 +11,6 @@ namespace ModernKeePass.Actions
|
|||||||
{
|
{
|
||||||
public class ClipboardAction : DependencyObject, IAction
|
public class ClipboardAction : DependencyObject, IAction
|
||||||
{
|
{
|
||||||
private DispatcherTimer _dispatcher;
|
|
||||||
private bool _isWindowActivated = true;
|
private bool _isWindowActivated = true;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
@@ -40,14 +39,14 @@ namespace ModernKeePass.Actions
|
|||||||
|
|
||||||
CoreWindow.GetForCurrentThread().Activated += ClipboardAction_Activated;
|
CoreWindow.GetForCurrentThread().Activated += ClipboardAction_Activated;
|
||||||
|
|
||||||
_dispatcher = new DispatcherTimer {Interval = TimeSpan.FromSeconds(settings.GetSetting(Constants.Settings.ClipboardTimeout, 10))};
|
var dispatcher = new DispatcherTimer {Interval = TimeSpan.FromSeconds(settings.GetSetting(Constants.Settings.ClipboardTimeout, 10))};
|
||||||
_dispatcher.Tick += Dispatcher_Tick;
|
dispatcher.Tick += Dispatcher_Tick;
|
||||||
|
|
||||||
var dataPackage = new DataPackage { RequestedOperation = DataPackageOperation.Copy };
|
var dataPackage = new DataPackage { RequestedOperation = DataPackageOperation.Copy };
|
||||||
dataPackage.SetText(IsProtected ? cryptography.UnProtect(Text).GetAwaiter().GetResult() : Text);
|
dataPackage.SetText(IsProtected ? cryptography.UnProtect(Text).GetAwaiter().GetResult() : Text);
|
||||||
Clipboard.SetContent(dataPackage);
|
Clipboard.SetContent(dataPackage);
|
||||||
Clipboard.Flush();
|
Clipboard.Flush();
|
||||||
_dispatcher.Start();
|
dispatcher.Start();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user