Exemplo n.º 1
0
 private void lbl_drag_plain_MouseDown(object sender, MouseEventArgs e)
 {
     DataObject data = new DataObject();
     var ana= new Person() {Name = "Ana", Age = 56 };
     var json_stringAna = JObject.FromObject(ana).ToString();
     data.SetText(json_stringAna, TextDataFormat.Text);
     lbl_drag_plain.DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Move);
 }
Exemplo n.º 2
0
        private void lbl_drag_MouseDown(object sender, MouseEventArgs e)
        {
            DataObject data = new DataObject();
            var dave = new Person() { Name = "Dave", Age = 4 };
            var cf_htmlDave = ClipboardUtil.textToCF_HTML(JObject.FromObject(dave).ToString());

            data.SetText(cf_htmlDave, TextDataFormat.Html);
            data.SetText("We can also attach Text.", TextDataFormat.Text);
            lbl_drag.DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Move);
        }