[Mono-bugs] [Bug 543694] New: DataObject.GetData and DataObject.GetDataPresent Not Working For Arbitrary Types in Drag Drop

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 1 18:16:46 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=543694


           Summary: DataObject.GetData and DataObject.GetDataPresent Not
                    Working For Arbitrary Types in Drag Drop
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: 32bit
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dglick at dracorp.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:
When a drag and drop operation is initalized via Control.DoDragDrop and an
arbitrary object is passed in as the first parameter, the object cannot be
retrieved or tested from the DataObject passed in event handlers through the
DragEventArgs parameter. In a handler (such as DragOver) if you get the
DataObject from the DragEventArgs.Data field and call DataObject.GetDataPreset
with either a Type parameter or a type name false is always returned. If you
call DataObject.GetData with either a Type parameter or a type name null is
always returned.

Steps to reproduce the problem:
1. Initiate a drag/drop operation using Control.DoDragDrop and pass in an
arbitrary object as the first parameter (the drag/drop data):

Control.DoDragDrop(new Point(100), DragDropEffect.All);

2. Register a handler for Control.DragOver.
3. In the Control.DragOver handler, attempt to get the drag/drop data object by
using DragEventArgs.Data.GetData:

void Control_DragOver(object sender, DragEventArgs e)
{
 Point p = (Point)e.Data.GetData(typeof(Point));
}


Actual Results:
null is always returned.

Expected Results:
The object is returned.

How often does this happen? 
Always (that I can tell).

Additional Information:

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list