public void Dispose() { if (!isClipboardOpen) { return; } if (!clipboardNativeApi.CloseClipboard()) { throw new InvalidOperationException("Could not close the clipboard."); } }
public byte[] UnwrapStructure(uint format) { //HACK: we close the clipboard here to avoid it being already open. should definitely be fixed for final release. try { clipboardNativeApi.CloseClipboard(); var image = Clipboard.GetImage(); return(imagePersistenceService .ConvertBitmapSourceToByteArray(image)); } finally { clipboardNativeApi .OpenClipboard(mainWindowHandleContainer.Handle); } }
public void Dispose() { clipboardNativeApi.CloseClipboard(); }