mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-08-03 18:19:18 +00:00
c705caac8f
- Compatibility update is completed - Added 'Copy SteamId' menu item in context menu of mafile - Proxy and password automatically saved in mafile after linking - SetCryptPasswordDialog now supports "Enter" hot-key - Loc updates - Added PlannedChanges.txt - Added ClipboardHelper.cs to improved code readability
60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using NebulaAuth.Core;
|
|
using NebulaAuth.Model;
|
|
using System;
|
|
using System.Collections.Specialized;
|
|
using System.Windows;
|
|
|
|
namespace NebulaAuth.Utility;
|
|
|
|
public class ClipboardHelper
|
|
{
|
|
public static bool Set(string text)
|
|
{
|
|
var i = 0;
|
|
while (i < 20)
|
|
{
|
|
try
|
|
{
|
|
Clipboard.SetText(text);
|
|
return true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
if (i == 19)
|
|
{
|
|
Shell.Logger.Error(ex);
|
|
SnackbarController.SendSnackbar(LocManager.GetCommonOrDefault("Error", "Error"));
|
|
}
|
|
|
|
}
|
|
i++;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public static bool SetFiles(StringCollection files)
|
|
{
|
|
var i = 0;
|
|
while (i < 20)
|
|
{
|
|
try
|
|
{
|
|
Clipboard.SetFileDropList(files);
|
|
return true;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
if (i == 19)
|
|
{
|
|
Shell.Logger.Error(ex);
|
|
SnackbarController.SendSnackbar(LocManager.GetCommonOrDefault("Error", "Error"));
|
|
}
|
|
|
|
}
|
|
i++;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
} |