/// <summary> /// Copy text in OCR result into clipboard /// </summary> private void CopyTextCommandExecute() { bool copiedText = TranslationVisibility == Visibility.Visible ? ClipboardManager.Copy(TranslatedText) : ClipboardManager.Copy(Text); ToastControl toast = new ToastControl(copiedText ? Resources.Message_CopiedToClipboard : Resources.Message_CopyToClipboardFailed); toast.ShowInMainWindow(); }
private void btnCopy_Click(object sender, EventArgs e) { if (world == null || region == null) { return; } ClipboardManager.Copy(region, imgRegion.Layers[SELECTIONLAYER].Image, imgRegion.SelectionColor); }
public void CopySelection() { var presenter = ServiceLocator.Current.GetInstance <ApplicationPresenter>(); var selection = presenter.Selection; if (selection != null && selection.Count > 0) { _clipboard.Copy(selection); } }
public void GetData() { var t = new MapTree(); var r = new MapNode(t, "root"); var n = new MapNode(r, "node"); n.InsertImage(Image.FromFile(@"Resources\OrangeTestImage.jpg"), false); var nodes = new[] { n }.ToList(); var sut = new MindMateClipboardDataObject(nodes); n.Selected = true; ClipboardManager.Copy(n.Tree.SelectedNodes); Assert.AreEqual("node", Clipboard.GetData(MindMateClipboardFormat)); Assert.IsNotNull(Clipboard.GetData(DataFormats.Bitmap)); Assert.IsNull(Clipboard.GetData(DataFormats.CommaSeparatedValue)); }
public void GetFormats() { var t = new MapTree(); var r = new MapNode(t, "root"); var n = new MapNode(r, "node"); n.InsertImage(Image.FromFile(@"Resources\OrangeTestImage.jpg"), false); var nodes = new[] { n }.ToList(); var sut = new MindMateClipboardDataObject(nodes); n.Selected = true; ClipboardManager.Copy(n.Tree.SelectedNodes); var formats = sut.GetFormats(); Assert.IsTrue(formats.Contains(ClipboardManager.MindMateClipboardFormat)); Assert.IsTrue(formats.Contains(DataFormats.Bitmap)); Assert.IsTrue(formats.Contains(DataFormats.Text)); Assert.IsTrue(sut.GetDataPresent(DataFormats.Text)); }