private void HandleResult(ImageInfo result) { if (settings.CopyToClipboard) CopyToClipboard(result); if (settings.ShowPopup) ToasterWrapper.DisplayToaster("URL copied to clipboard!", "Open in browser...", PackageOutput.IconPath, () => Process.Start(result.Url)); if (settings.OpenInBrowser) Process.Start(result.Url); }
private static void CopyToClipboard(ImageInfo result) { try { RunAsSTAThread(() => Clipboard.SetText(result.Url)); } catch(Exception ex) { ex.ToExceptionless() .SetMessage("A thread exception occurred while copying to clipboard") .SetProperty("ThreadAppartment", Thread.CurrentThread.GetApartmentState()) .SetProperty("SynchronizationContext", SynchronizationContext.Current) .SetProperty(".NET45", IsNet45OrNewer()) .SetProperty("Runtime", Environment.Version) .Submit(); } }