System.Windows.Forms.Clipboard.SetDataObject(object, bool, int, int)

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 7

1. Example

Project: Capella
Source File: Toot.cs
View license
public 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);
        }

2. Example

Project: Capella
Source File: Toot.cs
View license
public void copyLink_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.Clipboard.SetDataObject(tootURL, true, 5, 200);
        }

3. Example

Project: dp2
Source File: SerialCodeForm.cs
View license
void threadAction()
        {
            Clipboard.SetDataObject(this._content, true);
        }

4. Example

Project: dp2
Source File: MainForm.cs
View license
void CopySubject(object sender, CopySubjectEventArgs e)
        {
            Clipboard.SetDataObject(e.Subject);
            /*
            Class2SubjectDlg dlg = (Class2SubjectDlg)sender;
            dlg.DialogResult = DialogResult.OK;
            dlg.Close();
            */
        }

5. Example

Project: EDDiscovery
Source File: UserControlRoute.cs
View license
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridViewRoute.GetCellCount(DataGridViewElementStates.Selected) > 0)
            {
                try
                {
                    Clipboard.SetDataObject(dataGridViewRoute.GetClipboardContent());
                }
                catch { }
            }
        }

6. Example

View license
private void menuCopy_Click(object sender, EventArgs e)
        {
            if(dgvCESniffer.SelectedRows.Count < 1) {
                return;
            }
            Clipboard.SetDataObject(dgvCESniffer.GetClipboardContent());
        }

7. Example

Project: tesvsnip
Source File: ObjectListView.cs
View license
public 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);
        }

8. Example

Project: falloutsnip
Source File: ObjectListView.cs
View license
public 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);
        }

9. Example

View license
public void CopyPacUrl()
        {
            Clipboard.SetDataObject(_pacServer.PacUrl);
        }

10. Example

Project: Toxy
Source File: ClipboardHelpers.cs
View license
private static bool CopyData(IDataObject data, bool copy = true)
        {
            if (data != null)
            {
                lock (ClipboardLock)
                {
                    Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay);
                }

                return true;
            }

            return false;
        }

11. Example

Project: RuiRuiQQ
Source File: MainForm.cs
View license
private void listBoxLog_DoubleClick(object sender, EventArgs e)
        {
            if (listBoxLog.SelectedIndex != -1)
                Clipboard.SetDataObject(listBoxLog.Items[listBoxLog.SelectedIndex].ToString());
        }

12. Example

Project: RuiRuiQQ
Source File: MainForm.cs
View license
private void listBoxFriend_DoubleClick(object sender, EventArgs e)
        {
            if (listBoxFriend.SelectedIndex != -1)
                Clipboard.SetDataObject(listBoxFriend.Items[listBoxFriend.SelectedIndex].ToString());
        }

13. Example

Project: RuiRuiQQ
Source File: MainForm.cs
View license
private void listBoxGroup_DoubleClick(object sender, EventArgs e)
        {
            if (listBoxGroup.SelectedIndex != -1)
                Clipboard.SetDataObject(listBoxGroup.Items[listBoxGroup.SelectedIndex].ToString());
        }

14. Example

Project: logwizard
Source File: ObjectListView.cs
View license
public 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);
        }

15. Example

Project: WzComparerR2
Source File: AfrmTooltip.cs
View license
void tsmiCopy_Click(object sender, EventArgs e)
        {
            if (this.Bitmap != null)
            {
                var dataObj = new ImageDataObject(this.Bitmap, this.ImageFileName);
                Clipboard.SetDataObject(dataObj, false);
            }
        }

16. Example

View license
private 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);
            }
        }

17. Example

View license
public 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);
        }

18. Example

Project: lphant
Source File: downloadsListView.cs
View license
private 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+"|/");
		}

19. Example

Project: lphant
Source File: downloadsListView.cs
View license
private 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>");
		}

20. Example

Project: lphant
Source File: searchListView.cs
View license
private 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+"|/");
		}

21. Example

Project: lphant
Source File: searchListView.cs
View license
private 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>");
		}

22. Example

Project: lphant
Source File: serversListView.cs
View license
private 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()+"|/");
		}

23. Example

Project: lphant
Source File: serversListView.cs
View license
private 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>");
		}

24. Example

Project: lphant
Source File: sharedListView.cs
View license
private 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+"|/");
		}

25. Example

Project: lphant
Source File: sharedListView.cs
View license
private 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>");
		}

26. Example

Project: v2ray-taskbar
Source File: MainForm.cs
View license
void TextBoxCopy(object sender, EventArgs e)
		{
			if (this.textBoxTaskbar.SelectedText != "") {
				Clipboard.SetDataObject(this.textBoxTaskbar.SelectedText);
			}
		}

27. Example

Project: My-FyiReporting
Source File: DesignXmlDraw.cs
View license
public 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);
        }

28. Example

Project: XmlNotepad
Source File: Commands.cs
View license
public static void SetData(XmlTreeNode node)
        {
            if (node.Node != null)
            {
                Clipboard.SetDataObject(new TreeData(node));
            }
        }

29. Example

Project: neo-gui
Source File: MainForm.cs
View license
private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (listView3.SelectedItems.Count == 0) return;
            Clipboard.SetDataObject(listView3.SelectedItems[0].SubItems[1].Text);
        }

30. Example

Project: SharpChess
Source File: frmMain.cs
View license
private void mnuCopyFEN_Click(object sender, EventArgs e)
        {
            // Put FEN position string into the clipboard
            Clipboard.SetDataObject(Fen.GetBoardPosition());
        }

31. Example

Project: GEDKeeper
Source File: PersonEditDlg.cs
View license
private void btnNameCopy_Click(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(GKUtils.GetNameString(fPerson, true, false));
        }

32. Example

Project: ShareX
Source File: ClipboardHelpers.cs
View license
private static bool CopyData(IDataObject data, bool copy = true)
        {
            if (data != null)
            {
                lock (ClipboardLock)
                {
                    Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay);
                }

                return true;
            }

            return false;
        }

33. Example

Project: OrionSDK
Source File: ActivityMonitorTab.cs
View license
private void CopySelected(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
                return;

            var text = listView1.SelectedItems[0].SubItems[1].Text;
            Clipboard.SetDataObject(text, true);
        }

34. Example

Project: OSUplayer
Source File: Main.cs
View license
private void Main_PlayList_RightClick_Copy_Current_Name_Click(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(Core.TmpSet.ToString());
        }

35. Example

Project: ShareX
Source File: ClipboardHelpers.cs
View license
private static bool CopyData(IDataObject data, bool copy = true)
        {
            if (data != null)
            {
                lock (ClipboardLock)
                {
                    Clipboard.SetDataObject(data, copy, RetryTimes, RetryDelay);
                }

                return true;
            }

            return false;
        }

36. Example

Project: SquareOne
Source File: ObjectListView.cs
View license
public 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);
        }

37. Example

Project: xenadmin
Source File: PDSection.cs
View license
private void CopyMenuItem_Click(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(dataGridViewEx1.SelectedRows[0].Cells[1].Value);
        }

38. Example

Project: xenadmin
Source File: NICPage.cs
View license
private void CopyItemClick(object sender, EventArgs e)
        {
            Clipboard.SetDataObject(dataGridView1.SelectedRows[0].Cells[1].Value);
        }

39. Example

Project: RNGReporter
Source File: IVstoFrame.cs
View license
private 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);
            }
        }

40. Example

Project: dp2
Source File: MsSqlServerDataSourceWizard.cs
View license
private void button_copySqlServerInfo_Click(object sender, EventArgs e)
        {
            if (this._sqlServerInfo != null)
            {
                Clipboard.SetDataObject(this._sqlServerInfo.GetSummary(), true);
            }
        }

41. Example

Project: dp2
Source File: OracleDataSourceWizard.cs
View license
private void button_copySqlServerInfo_Click(object sender, EventArgs e)
        {
            if (this._sqlServerInfo != null)
            {
                Clipboard.SetDataObject(this._sqlServerInfo.GetSummary(), true);
            }
        }

42. Example

Project: dp2
Source File: SelectItemDialog.cs
View license
void 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;
        }

43. Example

Project: tesvsnip
Source File: ObjectListView.cs
View license
public 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));
        }

44. Example

Project: falloutsnip
Source File: ObjectListView.cs
View license
public 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));
        }

45. Example

Project: IKendeLib
Source File: FrmMain.cs
View license
private 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);
            }
        }

46. Example

Project: logwizard
Source File: ObjectListView.cs
View license
public 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));
        }

47. Example

View license
public 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));
        }

48. Example

Project: lphant
Source File: sharedListView.cs
View license
private 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+"|/");
		}

49. Example

Project: My-FyiReporting
Source File: DesignCtl.cs
View license
public 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());
		}

50. Example

Project: My-FyiReporting
Source File: DesignCtl.cs
View license
public void Copy()
		{
			Clipboard.SetDataObject(GetCopy(), true);
		}