Skip to content

Commit bda7b40

Browse files
committed
Revert GetDataPresent to DataFormats.Serializable for drag-and-drop
Drag-and-drop uses IDataObject with DataFormats.Serializable format (in-process, trusted data from the drag source). The byte[]+JsonSerialize approach only applies to cross-process clipboard operations via SetClipboardData/GetClipboardData. https://claude.ai/code/session_01Y178Q9RvuMC562i2QELpDX
1 parent 643115a commit bda7b40

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

CADability.Forms/CadFrame.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,9 @@ GeoObjectList IUIService.GetDataPresent(object data)
135135
{
136136
if (data is IDataObject idata)
137137
{
138-
byte[] bytes = idata.GetData(typeof(byte[])) as byte[];
139-
if (bytes != null)
138+
if (idata.GetDataPresent(System.Windows.Forms.DataFormats.Serializable))
140139
{
141-
try
142-
{
143-
using (MemoryStream ms = new MemoryStream(bytes))
144-
{
145-
JsonSerialize js = new JsonSerialize();
146-
return js.FromStream(ms) as GeoObjectList;
147-
}
148-
}
149-
catch { }
140+
return idata.GetData(System.Windows.Forms.DataFormats.Serializable) as GeoObjectList;
150141
}
151142
}
152143
return null;

0 commit comments

Comments
 (0)