Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Avoid serialization for in-process DataObject use #10776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JeremyKuhne opened this issue Apr 15, 2025 · 1 comment
Open

Avoid serialization for in-process DataObject use #10776

JeremyKuhne opened this issue Apr 15, 2025 · 1 comment
Labels
area-clipboard Issues related to DataObject and shared clipboard

Comments

@JeremyKuhne
Copy link
Member

Historically putting data on the Clipboard and retrieving it would go through the native OLE IDataObject interface, which would have the side effect of always making all interaction be autoConvert == true.

The new implementation does not need to go through the serialization that would happen here but does need to follow the behavior above. We initially handled this by forcing some scenarios through the proxy, but that causes serialization. In WinForms this was handled via a derived DataObject class, which we've just updated to just mimic the behavior from before.
 
dotnet/winforms#13287

DataObject is sealed in WPF, so this behavior was done with:

    private readonly bool _doNotUnwrap;

This should be changed to _forceAutoConvert to follow the behavior change that WinForms does.

Then we'll be able to enable customer OLE scenarios that are only in process and don't set copy to true without needing to take the BinaryFormatter compat package.

@miloush
Copy link
Contributor

miloush commented Apr 15, 2025

Is unsealing the WPF one an option?

@siagupta0202 siagupta0202 added the area-clipboard Issues related to DataObject and shared clipboard label Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-clipboard Issues related to DataObject and shared clipboard
Projects
None yet
Development

No branches or pull requests

3 participants