Files
FSI.BT.IR.Tools/FSI.BT.Tools/ClipboardMgt/Buisness/App.cs
Stephan Maier 647f938eee v1.2
2024-08-27 08:10:27 +02:00

44 lines
1.3 KiB
C#

namespace FSI.BT.Tools.ClipboardMgt
{
using System;
using FSI.BT.Tools.Global.Utilities;
using FSI.BT.Tools.RadialMenu.Business;
using Microsoft.Win32;
using WK.Libraries.SharpClipboardNS;
/// <summary>
/// App contains the notifyicon, the taskbarform and the menus.
/// </summary>
internal class App : IDisposable
{
SharpClipboard _clipBoard;
public App()
{
AppRestart.BeforeRestarting += Dispose;
SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
_clipBoard = new SharpClipboard();
_clipBoard.ObservableFormats.Texts = true;
_clipBoard.ClipboardChanged += Clipboard_ClipboardChanged;
}
private void Clipboard_ClipboardChanged(object sender, SharpClipboard.ClipboardChangedEventArgs e)
{
var test = e.Content.ToString();
if (e.Content.ToString().StartsWith("\"") && e.Content.ToString().EndsWith("\""))
System.Windows.Forms.Clipboard.SetDataObject(e.Content.ToString().Substring(1, e.Content.ToString().Length - 2));
}
public void Dispose()
{
}
private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
{
}
}
}