private void ClipChanged() { if (IsPaused) { return; } IDataObject iData = Clipboard.GetDataObject(); ClipboardFormat?format = null; foreach (var f in Formats) { if (!iData.GetDataPresent(f)) { continue; } format = (ClipboardFormat)Enum.Parse(typeof(ClipboardFormat), f); break; } object data = iData.GetData(format.ToString()); if (data == null || format == null) { return; } OnClipboardChange?.Invoke((ClipboardFormat)format, data); }
private void ClipChanged() { try { System.Windows.Forms.IDataObject iData = Clipboard.GetDataObject(); ClipboardFormat?format = null; foreach (var f in formats) { if (iData.GetDataPresent(f)) { format = (ClipboardFormat)Enum.Parse(typeof(ClipboardFormat), f); break; } } object data = iData.GetData(format.ToString()); if (data == null || format == null) { return; } OnClipboardChange?.Invoke((ClipboardFormat)format, data); if (data is IDisposable disposable) { disposable.Dispose(); } } catch (Exception) { } }
public static void Start() { ClipboardWatcher.Start(); ClipboardWatcher.OnClipboardChange += (format, data) => { OnClipboardChange?.Invoke(format, data); }; }
public static void Start() { InitializeContext(); ClipboardWatcher.Start(); ClipboardWatcher.OnClipboardChange += (ClipboardFormat format, object data) => { context.Send( o => OnClipboardChange?.Invoke(format, data), null); }; }
private static void WatcherOnChange() { OnClipboardChange?.Invoke(); }
private static void OnClipboardChangeEvent(object sender) { OnClipboardChange?.Invoke(sender); }
private void ClipChanged(object processId) { OnClipboardChange?.Invoke(processId); }
private static void OnClipboardChangeEvent() { OnClipboardChange?.Invoke(); }
private void ClipChanged() { OnClipboardChange?.Invoke(); }