Here are the examples of the csharp api class System.Windows.Forms.Clipboard.SetDataObject(object, bool, int, int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
82 Examples
0
1. Example
View licensepublic void copy_Click(object sender, RoutedEventArgs e) { //string text = new TextRange(tootText.Document.ContentStart, tootText.Document.ContentEnd).Text; System.Windows.Forms.Clipboard.SetDataObject(rawText, true, 5, 200); }
0
2. Example
View licensepublic void copyLink_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.Clipboard.SetDataObject(tootURL, true, 5, 200); }
0
0
4. Example
View licensevoid CopySubject(object sender, CopySubjectEventArgs e) { Clipboard.SetDataObject(e.Subject); /* Class2SubjectDlg dlg = (Class2SubjectDlg)sender; dlg.DialogResult = DialogResult.OK; dlg.Close(); */ }
0
5. Example
View licenseprivate void copyToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridViewRoute.GetCellCount(DataGridViewElementStates.Selected) > 0) { try { Clipboard.SetDataObject(dataGridViewRoute.GetClipboardContent()); } catch { } } }
0
6. Example
View licenseprivate void menuCopy_Click(object sender, EventArgs e) { if(dgvCESniffer.SelectedRows.Count < 1) { return; } Clipboard.SetDataObject(dgvCESniffer.GetClipboardContent()); }
0
7. Example
View licensepublic virtual void CopyObjectsToClipboard(IList objectsToCopy) { if (objectsToCopy.Count == 0) return; // We don't know where these objects came from, so we can't use the DragSource to create // the data object, like we do with CopySelectionToClipboard() above. var dataObject = new OLVDataObject(this, objectsToCopy); dataObject.CreateTextFormats(); Clipboard.SetDataObject(dataObject); }
0
8. Example
View licensepublic virtual void CopyObjectsToClipboard(IList objectsToCopy) { if (objectsToCopy.Count == 0) return; // We don't know where these objects came from, so we can't use the DragSource to create // the data object, like we do with CopySelectionToClipboard() above. var dataObject = new OLVDataObject(this, objectsToCopy); dataObject.CreateTextFormats(); Clipboard.SetDataObject(dataObject); }
0
0
10. Example
View licenseprivate static bool CopyData(IDataObject data, bool copy = true) { if (data != null) { lock (ClipboardLock) { Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay); } return true; } return false; }
0
11. Example
View licenseprivate void listBoxLog_DoubleClick(object sender, EventArgs e) { if (listBoxLog.SelectedIndex != -1) Clipboard.SetDataObject(listBoxLog.Items[listBoxLog.SelectedIndex].ToString()); }
0
12. Example
View licenseprivate void listBoxFriend_DoubleClick(object sender, EventArgs e) { if (listBoxFriend.SelectedIndex != -1) Clipboard.SetDataObject(listBoxFriend.Items[listBoxFriend.SelectedIndex].ToString()); }
0
13. Example
View licenseprivate void listBoxGroup_DoubleClick(object sender, EventArgs e) { if (listBoxGroup.SelectedIndex != -1) Clipboard.SetDataObject(listBoxGroup.Items[listBoxGroup.SelectedIndex].ToString()); }
0
14. Example
View licensepublic virtual void CopyObjectsToClipboard(IList objectsToCopy) { if (objectsToCopy.Count == 0) return; // We don't know where these objects came from, so we can't use the DragSource to create // the data object, like we do with CopySelectionToClipboard() above. OLVDataObject dataObject = new OLVDataObject(this, objectsToCopy); dataObject.CreateTextFormats(); Clipboard.SetDataObject(dataObject); }
0
15. Example
View licensevoid tsmiCopy_Click(object sender, EventArgs e) { if (this.Bitmap != null) { var dataObj = new ImageDataObject(this.Bitmap, this.ImageFileName); Clipboard.SetDataObject(dataObj, false); } }
0
16. Example
View licenseprivate void copyToClipboardToolStripMenuItem_Click(object sender, EventArgs e) { try { var content = dataGridView1.GetClipboardContent(); if (content != null) Clipboard.SetDataObject(content, true); } catch (Exception ex) { PremadeDialogs.GenericError(ex); } }
0
17. Example
View licensepublic virtual void CopyObjectsToClipboard(IList objectsToCopy) { if (objectsToCopy.Count == 0) return; // We don't know where these objects came from, so we can't use the DragSource to create // the data object, like we do with CopySelectionToClipboard() above. OLVDataObject dataObject = new OLVDataObject(this, objectsToCopy); dataObject.CreateTextFormats(); Clipboard.SetDataObject(dataObject); }
0
18. Example
View licenseprivate void OnCopyLink(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceFile file=(InterfaceFile)SelectedItems[0].Tag; Clipboard.SetDataObject("ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strHash+"|/"); }
0
19. Example
View licenseprivate void OnCopyLinkHTML(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceFile file=(InterfaceFile)SelectedItems[0].Tag; Clipboard.SetDataObject("<a href=\"ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strHash+"|/\">"+file.Name+"</a>"); }
0
20. Example
View licenseprivate void OnCopyLink(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceSearchedFile file=(InterfaceSearchedFile)SelectedItems[0].Tag; Clipboard.SetDataObject("ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strFileHash+"|/"); }
0
21. Example
View licenseprivate void OnCopyLinkHTML(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceSearchedFile file=(InterfaceSearchedFile)SelectedItems[0].Tag; Clipboard.SetDataObject("<a href=\"ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strFileHash+"|/\">"+file.Name+"</a>"); }
0
22. Example
View licenseprivate void OnCopyLink(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceServer server=(InterfaceServer)SelectedItems[0].Tag; Clipboard.SetDataObject("ed2k://|server|"+server.IP+"|"+server.Port.ToString()+"|/"); }
0
23. Example
View licenseprivate void OnCopyLinkHTML(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceServer server=(InterfaceServer)SelectedItems[0].Tag; Clipboard.SetDataObject("<a href=\"ed2k://|server|"+server.IP+"|"+server.Port.ToString()+"|/\">"+server.Name+"</a>"); }
0
24. Example
View licenseprivate void OnCopyLink(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceFile file=(InterfaceFile)SelectedItems[0].Tag; Clipboard.SetDataObject("ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strHash+"|/"); }
0
25. Example
View licenseprivate void OnCopyLinkHTML(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceFile file=(InterfaceFile)SelectedItems[0].Tag; Clipboard.SetDataObject("<a href=\"ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strHash+"|/\">"+file.Name+"</a>"); }
0
26. Example
View licensevoid TextBoxCopy(object sender, EventArgs e) { if (this.textBoxTaskbar.SelectedText != "") { Clipboard.SetDataObject(this.textBoxTaskbar.SelectedText); } }
0
27. Example
View licensepublic void Copy() { if (SelectedList.Count == 0) return; StringBuilder sb = new StringBuilder("<MapItems>"); foreach (XmlNode xn in SelectedList) { sb.Append(xn.OuterXml); } sb.Append("</MapItems>"); Clipboard.SetDataObject(sb.ToString(), true); }
0
28. Example
View licensepublic static void SetData(XmlTreeNode node) { if (node.Node != null) { Clipboard.SetDataObject(new TreeData(node)); } }
0
29. Example
View licenseprivate void toolStripMenuItem1_Click(object sender, EventArgs e) { if (listView3.SelectedItems.Count == 0) return; Clipboard.SetDataObject(listView3.SelectedItems[0].SubItems[1].Text); }
0
30. Example
View licenseprivate void mnuCopyFEN_Click(object sender, EventArgs e) { // Put FEN position string into the clipboard Clipboard.SetDataObject(Fen.GetBoardPosition()); }
0
31. Example
View licenseprivate void btnNameCopy_Click(object sender, EventArgs e) { Clipboard.SetDataObject(GKUtils.GetNameString(fPerson, true, false)); }
0
32. Example
View licenseprivate static bool CopyData(IDataObject data, bool copy = true) { if (data != null) { lock (ClipboardLock) { Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay); } return true; } return false; }
0
33. Example
View licenseprivate void CopySelected(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) return; var text = listView1.SelectedItems[0].SubItems[1].Text; Clipboard.SetDataObject(text, true); }
0
34. Example
View licenseprivate void Main_PlayList_RightClick_Copy_Current_Name_Click(object sender, EventArgs e) { Clipboard.SetDataObject(Core.TmpSet.ToString()); }
0
35. Example
View licenseprivate static bool CopyData(IDataObject data, bool copy = true) { if (data != null) { lock (ClipboardLock) { Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay); } return true; } return false; }
0
36. Example
View licensepublic virtual void CopyObjectsToClipboard(IList objectsToCopy) { if (objectsToCopy.Count == 0) return; // We don't know where these objects came from, so we can't use the DragSource to create // the data object, like we do with CopySelectionToClipboard() above. OLVDataObject dataObject = new OLVDataObject(this, objectsToCopy); dataObject.CreateTextFormats(); Clipboard.SetDataObject(dataObject); }
0
37. Example
View licenseprivate void CopyMenuItem_Click(object sender, EventArgs e) { Clipboard.SetDataObject(dataGridViewEx1.SelectedRows[0].Cells[1].Value); }
0
38. Example
View licenseprivate void CopyItemClick(object sender, EventArgs e) { Clipboard.SetDataObject(dataGridView1.SelectedRows[0].Cells[1].Value); }
0
39. Example
View licenseprivate void copyToolStripMenuItem_Click(object sender, EventArgs e) { if (dataGridView1.GetCellCount(DataGridViewElementStates.Selected) > 0) { Clipboard.SetDataObject(dataGridView1.GetClipboardContent()); } else { MessageBox.Show("Please select the frame", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
0
40. Example
View licenseprivate void button_copySqlServerInfo_Click(object sender, EventArgs e) { if (this._sqlServerInfo != null) { Clipboard.SetDataObject(this._sqlServerInfo.GetSummary(), true); } }
0
41. Example
View licenseprivate void button_copySqlServerInfo_Click(object sender, EventArgs e) { if (this._sqlServerInfo != null) { Clipboard.SetDataObject(this._sqlServerInfo.GetSummary(), true); } }
0
42. Example
View licensevoid menuItem_copy_Click(object sender, EventArgs e) { Cursor oldCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; StringBuilder strTotal = new StringBuilder(4096); foreach (DpRow row in this.dpTable_items.SelectedRows) { strTotal.Append(GetRowText(row) + "\r\n"); } Clipboard.SetDataObject(strTotal.ToString(), true); this.Cursor = oldCursor; }
0
43. Example
View licensepublic virtual void CopySelectionToClipboard() { IList selection = SelectedObjects; if (selection.Count == 0) return; // Use the DragSource object to create the data object, if so configured. // This relies on the assumption that DragSource will handle the selected objects only. // It is legal for StartDrag to return null. object data = null; if (CopySelectionOnControlCUsesDragSource && DragSource != null) data = DragSource.StartDrag(this, MouseButtons.Left, ModelToItem(selection[0])); Clipboard.SetDataObject(data ?? new OLVDataObject(this, selection)); }
0
44. Example
View licensepublic virtual void CopySelectionToClipboard() { IList selection = SelectedObjects; if (selection.Count == 0) return; // Use the DragSource object to create the data object, if so configured. // This relies on the assumption that DragSource will handle the selected objects only. // It is legal for StartDrag to return null. object data = null; if (CopySelectionOnControlCUsesDragSource && DragSource != null) data = DragSource.StartDrag(this, MouseButtons.Left, ModelToItem(selection[0])); Clipboard.SetDataObject(data ?? new OLVDataObject(this, selection)); }
0
45. Example
View licenseprivate void AddFace() { for (int i = 0; i < imglstFace.Images.Count; i++) { PictureBox pb = new PictureBox(); pb.Width = 24; pb.Height = 24; pb.Tag = i; pb.Image = imglstFace.Images[i]; pb.MouseEnter += (o, e1) => { ((PictureBox)o).BorderStyle = BorderStyle.FixedSingle; if (mTmpImg != null) mTmpImg.BorderStyle = BorderStyle.None; mTmpImg = (PictureBox)o; }; pb.MouseLeave += (o, e1) => { ((PictureBox)o).BorderStyle = BorderStyle.None; }; pb.Click += (o, e1) => { int SelectIndex = (int)((PictureBox)o).Tag; Clipboard.SetDataObject(imglstFace.Images[SelectIndex]); DataFormats.Format format = DataFormats.GetFormat(DataFormats.Bitmap); if (richSay.CanPaste(format)) { richSay.Paste(format); } }; flowLayoutPanel1.Controls.Add(pb); } }
0
46. Example
View licensepublic virtual void CopySelectionToClipboard() { IList selection = this.SelectedObjects; if (selection.Count == 0) return; // Use the DragSource object to create the data object, if so configured. // This relies on the assumption that DragSource will handle the selected objects only. // It is legal for StartDrag to return null. object data = null; if (this.CopySelectionOnControlCUsesDragSource && this.DragSource != null) data = this.DragSource.StartDrag(this, MouseButtons.Left, this.ModelToItem(selection[0])); Clipboard.SetDataObject(data ?? new OLVDataObject(this, selection)); }
0
47. Example
View licensepublic virtual void CopySelectionToClipboard() { IList selection = this.SelectedObjects; if (selection.Count == 0) return; // Use the DragSource object to create the data object, if so configured. // This relies on the assumption that DragSource will handle the selected objects only. // It is legal for StartDrag to return null. object data = null; if (this.CopySelectionOnControlCUsesDragSource && this.DragSource != null) data = this.DragSource.StartDrag(this, MouseButtons.Left, this.ModelToItem(selection[0])); Clipboard.SetDataObject(data ?? new OLVDataObject(this, selection)); }
0
48. Example
View licenseprivate void OnCopyLinkSources(object sender, System.EventArgs e) { if (SelectedItems.Count==0) return; InterfaceFile file=(InterfaceFile)SelectedItems[0].Tag; string IP = (new System.Net.IPAddress(m_config.UserID)).ToString(); Clipboard.SetDataObject("ed2k://|file|"+file.Name+"|"+file.Size.ToString()+"|"+file.strHash+"|/|sources,"+IP+":"+m_config.TCPPort+"|/"); }
0
49. Example
View licensepublic void Cut() { if (_DrawPanel.SelectedCount <= 0) return; Clipboard.SetDataObject(GetCopy(), true); _Undo.StartUndoGroup(Strings.DesignCtl_Undo_Cut); _DrawPanel.DeleteSelected(); _Undo.EndUndoGroup(); SelectionChanged(this, new EventArgs()); }
0