Add code analyzers to enforce that ITypedDataObject interface is implemented for data objects #12608
Labels
area: Analyzers/CodeFixes
A Roslyn Analyzer is either needed for the context, needs to be scope extended or fixed.
area-Clipboard
Issues related to Clipboard
IDataObject
interface can't be used in clipboard or drag and drop operations that use the new APIsITypedDataObject
interface wheneverIDataObject
interface is implemented, otherwise the typed APIs such as Clipboard.TryGetData(...) and DataObject.TryGetData(..) would throw an unsupported exception when invoked.DataObject
class, suggest overridingprotected virtual bool TryGetDataCore
as well to support the new APIsClipboard.SetData
orClipboard.SetDataObject
, orDataObject.SetData
is invoked with anIDataObject
data, verify ifITypeDataObject
is implemented as well and suggest implementing it if it's not implemented.The text was updated successfully, but these errors were encountered: