Add additional Windows-specific APIs#40610
Conversation
…ormAttribute anymore
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
I wrote a tool to extract these attributes from reference assemblies. I've looked at the report and the only thing that is missing from spec is this: /cc @bartonjs |
| /// this <see cref="ComWrappers" /> instance, the previously created COM interface will be returned. | ||
| /// If not, a new one will be created. | ||
| /// </remarks> | ||
| [SupportedOSPlatform("windows")] |
There was a problem hiding this comment.
Can we just mark the whole type as windows specific?
There was a problem hiding this comment.
done.
BTW how should we handle nested types? If class B is nested within class A which is Windows-specific, should B be Windows-specific OOTB as well?
[SupportedOSPlatform("windows")]
public class A
{
public class B { }
}/cc @buyaa-n
There was a problem hiding this comment.
If class B is nested within class A which is Windows-specific, should B be Windows-specific OOTB as well?
Yes, I would assume so. The same with any other scope - if a class is marked OS-specific, all the methods in it are OS-specific. If an assembly is marked OS-specific, all the types in it are OS-specific.
| _innerEventInfo = type.GetEvent(eventName)!; | ||
| } | ||
|
|
||
| [SupportedOSPlatform("windows")] |
There was a problem hiding this comment.
It seems like the whole ComAwareEventInfo class should be marked as Windows-specific. In general, nothing "COM" specific will work outside of Windows.
A follow up of dotnet/designs#142