-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
.NET 10 Preview 1 - WinForms Release Notes #9722
base: dotnet10p1
Are you sure you want to change the base?
Conversation
First draft of release nites
I did use AI to translate to markdown from docx formats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should double check that new Clipboard/DataObject APIs documentation is on the learn.microsoft site for preview so users may be able to more quickly understand the APIs
Co-authored-by: Loni Tra <[email protected]>
Applying the latest feedback and correcting a couple mistakes.
|
||
- `public void SetDataAsJson<T>(T data)` | ||
- `public void SetDataAsJson<T>(string format, T data)` | ||
- `public void SetDataAsJson<T>(string format, bool autoConvert, T data)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public void SetDataAsJson<T>(T data)
public void SetDataAsJson<T>(string format, T data)
public void SetDataAsJson<T>(string format, bool autoConvert, T data)
protected virtual bool TryGetDataCore<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data)
These are not interface methods, they are added on the concrete DataObject class
Suggestions:
DataObject:
public void SetDataAsJson<T>(T data)
public void SetDataAsJson<T>(string format, T data)
public void SetDataAsJson<T>(string format, bool autoConvert, T data)
public bool TryGetData<T>(out T data);
public bool TryGetData<T>(string format, out T data);
public bool TryGetData<T>(string format, bool autoConvert, out T data);
public bool TryGetData<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data);
protected virtual bool TryGetDataCore<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data)
ITypedDataObject:
public bool TryGetData<T>(out T data);
public bool TryGetData<T>(string format, out T data);
public bool TryGetData<T>(string format, bool autoConvert, out T data);
public bool TryGetData<T>(string format, Func<Reflection.Metadata.TypeName, Type> resolver, bool autoConvert, out T data);
|
||
### New Configuration Switch | ||
|
||
If an application is unable to adopt the new APIs, and requires a fallback to `BinaryFormatter` serialization during Clipboard and Drag/Drop operations, the developer will need to take additional action. In .NET 9, calls to BinaryFormatter will always throw a `PlatformNotSupportedException` unless the developer follows the instructions located here: [BinaryFormatter compatibility package](https://learn.microsoft.com/dotnet/standard/serialization/binaryformatter-migration-guide/compatibility-package) . In .NET 10 Preview 1, WinForms will now also by default disable the use of BinaryFormatter as a fallback unless it is explicitly enabled with this new configuration switch. This switch is `Windows.ClipboardDragDrop.EnableUnsafeBinaryFormatterSerialization`, and it must be set to `True` for the fallback to happen successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: extra white space after the closing paren.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET 10 Preview 1, WinForms will now also by default disable ...
->> In .NET 10 Preview 1, WinForms will also by default disable the use of BinaryFormatter on the application level using the same compatibility switches. Additionally, we allow developer to control BinaryFormatter usage in Clipboard only with a new compatibility switch
Windows.ClipboardDragDrop.EnableUnsafeBinaryFormatterSerialization. For full compatibility application should reference the OOB package and opt in into 2 compat switches.
Here is the first draft of our release notes for Preview 1.