diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2c0342712f..c80ba05162 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -168,6 +168,7 @@ The runtime library (`WinRT.Runtime.dll`) provides all common infrastructure for - **Warnings as errors**: release only. `EnforceCodeStyleInBuild` enabled, `AnalysisLevelStyle` = `latest-all`. - **Strong-name signed** with `key.snk` - **AOT compatible**: `IsAotCompatible = true` +- **Reference assembly**: the project is built twice for NuGet packaging. With `CsWinRTBuildReferenceAssembly=true`, it produces a reference assembly (for `ref\net10.0\` in the NuGet) that strips all private implementation detail types and members. The normal build produces the full implementation assembly (for `lib\net10.0\`) and defines `WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY`; the reference assembly build defines `WINDOWS_RUNTIME_REFERENCE_ASSEMBLY` instead. Stripping is driven primarily by the `[WindowsRuntimeImplementationOnlyMember]` attribute (a `[Conditional("WINDOWS_RUNTIME_REFERENCE_ASSEMBLY")]` marker on top-level types) plus an MSBuild target that removes any source file containing that attribute, any file with a top-of-file `#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE`, and entire implementation-only folders (e.g. `ABI\`, `NativeObjects\`, most `InteropServices\` subfolders). Method bodies remaining in the reference assembly are stubbed with `throw null`. This replaces the previous approach of marking implementation details with `[Obsolete]` and `[EditorBrowsable(Never)]` attributes. **Directory structure:** @@ -554,7 +555,7 @@ The MSBuild integration is orchestrated through several `.props` and `.targets` - **Compiler strict mode**: `strict` in all projects - **XML documentation**: generated for all projects - **`SkipLocalsInit`**: enabled in runtime and build tools for performance -- **Suppressed warnings**: `CS8500` (ref safety in unsafe contexts), `AD0001` (analyzer crashes), `CSWINRT3001` (obsolete internal members) +- **Suppressed warnings**: `CS8500` (ref safety in unsafe contexts), `AD0001` (analyzer crashes) - **Strong-name signing**: all assemblies signed with `src/WinRT.Runtime2/key.snk` ### C++ project (cswinrt) @@ -597,7 +598,6 @@ All four .NET build tools (`cswinrtimplgen`, `cswinrtprojectiongen`, `cswinrtint | Projection Generator | `CSWINRTPROJECTIONGENxxxx` | `0001`–`0008`, `9999` | | Interop Generator | `CSWINRTINTEROPGENxxxx` | Various, `9999` | | WinMD Generator | `CSWINRTWINMDGENxxxx` | `0001`–`0007` | -| Runtime (obsolete markers) | `CSWINRT3xxx` | `CSWINRT3001` | --- diff --git a/.github/skills/interop-generator/SKILL.md b/.github/skills/interop-generator/SKILL.md index 1a918671c1..cd2193d6d0 100644 --- a/.github/skills/interop-generator/SKILL.md +++ b/.github/skills/interop-generator/SKILL.md @@ -32,7 +32,24 @@ The `WinRT.Interop.dll` assembly is produced by `cswinrtinteropgen`, which is a - If a project **does not** reference CsWinRT, then `cswinrtinteropgen` is loaded from the Windows SDK projections targeting pack. - If CsWinRT **is** referenced (directly or transitively), then `cswinrtinteropgen` is loaded from that package, but only if the `WinRT.Runtime.dll` binary from that package has a higher version than the one in the Windows SDK projections package being referenced. This correctly handles cases where a dependent project might have a reference to an outdated CsWinRT package. -This version matching is critical because `cswinrtinteropgen` relies on "implementation details only" APIs in `WinRT.Runtime.dll` — APIs which are public, hidden, and marked as `[Obsolete]`, and which are exclusively meant to be consumed by generated code produced by `cswinrtinteropgen`. These APIs might change at any time without following semantic versioning for CsWinRT. For instance, they are crucial to support marshalling generic Windows Runtime collection interfaces, and the code in `WinRT.Interop.dll` makes heavy use of them in this scenario. +This version matching is critical because `cswinrtinteropgen` relies on internal implementation detail APIs in `WinRT.Runtime.dll` — APIs which are public in the implementation assembly but excluded from the reference assembly (via the `[WindowsRuntimeImplementationOnlyMember]` attribute and related MSBuild stripping, controlled by the `WINDOWS_RUNTIME_REFERENCE_ASSEMBLY` / `WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY` define constants), and which are exclusively meant to be consumed by generated code produced by `cswinrtinteropgen`. These APIs might change at any time without following semantic versioning for CsWinRT. For instance, they are crucial to support marshalling generic Windows Runtime collection interfaces, and the code in `WinRT.Interop.dll` makes heavy use of them in this scenario. + +### Private implementation detail APIs + +`WinRT.Runtime.dll` is shipped as two assemblies in the CsWinRT NuGet package: a **reference assembly** (in `ref\net10.0\`) that exposes only the versioned public API surface, and an **implementation assembly** (in `lib\net10.0\`) that contains the full set of types and members. Many types in the implementation assembly are "public" only because generated code in other assemblies (produced by `cswinrt.exe` and `cswinrtinteropgen`) needs to call them — they are not part of the stable API contract. These types are stripped from the reference assembly via the `[WindowsRuntimeImplementationOnlyMember]` attribute (a `[Conditional("WINDOWS_RUNTIME_REFERENCE_ASSEMBLY")]` marker that triggers an MSBuild target to remove the entire source file), an opt-in `#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE` directive at the top of a source file, or wholesale folder removals (e.g. `ABI\`, `NativeObjects\`, most `InteropServices\` subfolders), so consumers never see them. Method bodies that remain in the reference assembly are stubbed with `throw null`. + +The interop generator receives a reference to the **implementation** `WinRT.Runtime.dll` (not the reference assembly) so that it can resolve and emit calls to these internal APIs. Examples of private implementation detail types that the interop generator uses heavily include: + +- **Vtable structs** (`IVectorVftbl`, `IMapVftbl`, `IIterableVftbl`, etc.) — the interop generator emits static readonly vtable fields for each projected interface, populated with function pointers to marshalling stubs. +- **Collection adapters and methods** (`IListAdapter`, `IDictionaryMethods`, `IEnumerableMethods`, etc.) — generated native object wrappers delegate collection operations to these adapter types. +- **Marshalling infrastructure** (`WindowsRuntimeObjectMarshaller`, `HStringMarshaller`, `WindowsRuntimeInterfaceMarshaller`, array marshallers, etc.) — generated marshalling stubs call these to convert between managed and native representations. +- **Object reference types** (`WindowsRuntimeObjectReference`, `WindowsRuntimeObjectReferenceValue`, `CreateObjectReferenceMarshalingType`) — generated code uses these for COM pointer lifecycle management. +- **ComWrappers callbacks** (`IWindowsRuntimeObjectComWrappersCallback`, `WindowsRuntimeComWrappersMarshal`) — generated CCW vtable entries and type map registrations use these. +- **Type map groups** (`WindowsRuntimeComWrappersTypeMapGroup`, `WindowsRuntimeMetadataTypeMapGroup`, `DynamicInterfaceCastableImplementationTypeMapGroup`) — generated type map registrations target these groups. +- **Projection implementations** (`IPropertyValueImpl`, `IStringableImpl`, `IMarshalImpl`, etc.) — generated code wires up these implementations in CCW vtables. +- **ABI types** (under `ABI.*` namespaces) — per-type marshalling definitions and event source types. + +All of these types are referenced extensively throughout the interop generator's builder and factory classes (in `Builders/` and `Factories/`). When modifying these types in `WinRT.Runtime`, the corresponding interop generator code must be updated in lockstep — which is why the version matching described above is essential. ## Project settings diff --git a/.github/skills/update-copilot-instructions/SKILL.md b/.github/skills/update-copilot-instructions/SKILL.md index 433b0c1c90..63dd24f8d8 100644 --- a/.github/skills/update-copilot-instructions/SKILL.md +++ b/.github/skills/update-copilot-instructions/SKILL.md @@ -26,6 +26,7 @@ Launch parallel explore agents for each of the 8 CsWinRT 3.0 projects listed in - Key types listed still exist and have the described purposes - T4 templates (`.tt` files) are accurately listed - Project settings (TFM, language version, nullable, unsafe, etc.) are current + - Reference assembly build setup (`CsWinRTBuildReferenceAssembly`, `WINDOWS_RUNTIME_REFERENCE_ASSEMBLY` / `WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY` defines, `[WindowsRuntimeImplementationOnlyMember]` attribute, `#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE` opt-out) is accurately described - Namespace organization matches 2. **WinRT.SourceGenerator2 (`src/Authoring/WinRT.SourceGenerator2/`)** diff --git a/build/AzurePipelineTemplates/CsWinRT-Build-Steps.yml b/build/AzurePipelineTemplates/CsWinRT-Build-Steps.yml index 82ba90240f..29b69242d0 100644 --- a/build/AzurePipelineTemplates/CsWinRT-Build-Steps.yml +++ b/build/AzurePipelineTemplates/CsWinRT-Build-Steps.yml @@ -251,6 +251,25 @@ steps: WinRT.Runtime.xml TargetFolder: $(StagingFolder)\net10.0 + # Build WinRT.Runtime reference assembly with implementation detail types stripped out + - task: VSBuild@1 + displayName: Build WinRT.Runtime reference assembly + condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release')) + inputs: + solution: $(Build.SourcesDirectory)\src\WinRT.Runtime2\WinRT.Runtime.csproj + msbuildArgs: /p:VersionNumber=$(VersionNumber),VersionString=$(Build.BuildNumber),AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion),CsWinRTBuildReferenceAssembly=true,ContinuousIntegrationBuild=true + platform: $(BuildPlatform) + configuration: $(BuildConfiguration) + + # Stage WinRT.Runtime reference assembly + - task: CopyFiles@2 + displayName: Stage WinRT.Runtime reference assembly + condition: and(succeeded(), eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildConfiguration'], 'release')) + inputs: + SourceFolder: $(Build.SourcesDirectory)\src\WinRT.Runtime2\obj\$(BuildPlatform)\$(BuildConfiguration)\net10.0\ref + Contents: WinRT.Runtime.dll + TargetFolder: $(StagingFolder)\net10.0\ref + # Stage WinRT.Host.Shim - task: CopyFiles@2 displayName: Stage WinRT.Host.Shim diff --git a/build/AzurePipelineTemplates/CsWinRT-PublishToNuGet-Steps.yml b/build/AzurePipelineTemplates/CsWinRT-PublishToNuGet-Steps.yml index 977daf1475..cba3d02954 100644 --- a/build/AzurePipelineTemplates/CsWinRT-PublishToNuGet-Steps.yml +++ b/build/AzurePipelineTemplates/CsWinRT-PublishToNuGet-Steps.yml @@ -95,7 +95,7 @@ steps: command: pack searchPatternPack: nuget/Microsoft.Windows.CsWinRT.nuspec configurationToPack: Release - buildProperties: cswinrt_nuget_version=$(NugetVersion);cswinrt_exe=$(Build.SourcesDirectory)\release_x86\native\cswinrt.exe;interop_winmd=$(Build.SourcesDirectory)\release_x86\native\WindowsRuntime.Internal.winmd;net10_runtime=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Runtime.dll;net10_runtime_xml=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Runtime.xml;source_generator=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.SourceGenerator.dll;winrt_shim=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Host.Shim.dll;winrt_host_x86=$(Build.SourcesDirectory)\release_x86\native\WinRT.Host.dll;winrt_host_x64=$(Build.SourcesDirectory)\release_x64\native\WinRT.Host.dll;winrt_host_arm64=$(Build.SourcesDirectory)\release_arm64\native\WinRT.Host.dll;winrt_host_resource_x86=$(Build.SourcesDirectory)\release_x86\native\WinRT.Host.dll.mui;winrt_host_resource_x64=$(Build.SourcesDirectory)\release_x64\native\WinRT.Host.dll.mui;winrt_host_resource_arm64=$(Build.SourcesDirectory)\release_arm64\native\WinRT.Host.dll.mui;cswinrtinteropgen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtinteropgen.exe;cswinrtinteropgen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtinteropgen.exe;cswinrtimplgen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtimplgen.exe;cswinrtimplgen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtimplgen.exe;cswinrtprojectiongen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtprojectiongen.exe;cswinrtprojectiongen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtprojectiongen.exe;run_cswinrt_generator_task=$(Build.SourcesDirectory)\release_x86\netstandard2.0\WinRT.Generator.Tasks.dll;branch=$(Build.SourceBranchName);commit=$(Build.SourceVersion) + buildProperties: cswinrt_nuget_version=$(NugetVersion);cswinrt_exe=$(Build.SourcesDirectory)\release_x86\native\cswinrt.exe;interop_winmd=$(Build.SourcesDirectory)\release_x86\native\WindowsRuntime.Internal.winmd;net10_runtime=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Runtime.dll;net10_runtime_xml=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Runtime.xml;net10_runtime_ref=$(Build.SourcesDirectory)\release_x86\net10.0\ref\WinRT.Runtime.dll;source_generator=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.SourceGenerator.dll;winrt_shim=$(Build.SourcesDirectory)\release_x86\net10.0\WinRT.Host.Shim.dll;winrt_host_x86=$(Build.SourcesDirectory)\release_x86\native\WinRT.Host.dll;winrt_host_x64=$(Build.SourcesDirectory)\release_x64\native\WinRT.Host.dll;winrt_host_arm64=$(Build.SourcesDirectory)\release_arm64\native\WinRT.Host.dll;winrt_host_resource_x86=$(Build.SourcesDirectory)\release_x86\native\WinRT.Host.dll.mui;winrt_host_resource_x64=$(Build.SourcesDirectory)\release_x64\native\WinRT.Host.dll.mui;winrt_host_resource_arm64=$(Build.SourcesDirectory)\release_arm64\native\WinRT.Host.dll.mui;cswinrtinteropgen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtinteropgen.exe;cswinrtinteropgen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtinteropgen.exe;cswinrtimplgen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtimplgen.exe;cswinrtimplgen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtimplgen.exe;cswinrtprojectiongen_x64=$(Build.SourcesDirectory)\release_x64\net10.0\native\cswinrtprojectiongen.exe;cswinrtprojectiongen_arm64=$(Build.SourcesDirectory)\release_arm64\net10.0\native\cswinrtprojectiongen.exe;run_cswinrt_generator_task=$(Build.SourcesDirectory)\release_x86\netstandard2.0\WinRT.Generator.Tasks.dll;branch=$(Build.SourceBranchName);commit=$(Build.SourceVersion) packDestination: $(ob_outputDirectory)\packages - task: NuGetCommand@2 diff --git a/docs/diagnostics/cswinrt30001.md b/docs/diagnostics/cswinrt30001.md deleted file mode 100644 index c9877706fe..0000000000 --- a/docs/diagnostics/cswinrt30001.md +++ /dev/null @@ -1,34 +0,0 @@ -# CsWinRT warning CSWINRT3001 - -This type or method is a private implementation detail, and it's only meant to be consumed by generated projections (produced by 'cswinrt.exe') and by generated interop code (produced by 'cswinrtinteropgen.exe'). Private implementation detail types are not considered part of the versioned API surface, and they are ignored when determining the assembly version following semantic versioning. Types might be modified or removed across any version change for 'WinRT.Runtime.dll', and using them in user code is undefined behavior and not supported. - -For instance, the following sample generates CSWINRT3001: - -```csharp -using Microsoft.UI.Xaml; -using WindowsRuntime.InteropServices; - -namespace MyProgram; - -Window window = Window.Current; - -// CSWINRT3001: 'GetObjectReferenceForInterface' is a private implementation detail API -WindowsRuntimeObjectReference objectReference = window.GetObjectReferenceForInterface(typeof(object).TypeHandle); -``` - -Using any private implementation detail API is not supported, and should be considered undefined behavior. - -## Additional resources - -`CSWINRT30001` is emitted when user code tries to reference a type that is marked as a **private implementation detail** within `WinRT.Runtime.dll` or the generated `WinRT.Interop.dll`. These private implementation detail types exist solely to support the marshalling pipeline that CsWinRT and the .NET SDK generate at build time. They are not part of the public, versioned API surface, and consuming them from application code is unsupported. - -While all of these types are public (as they are used across assembglies), they are intentionally hidden from IntelliSense and decorated with `[Obsolete]` (with `CSWINRT3001` as the diagnostic id) to warn when they are referenced. Their names often include `Impl`, `Helpers`, or other internal wording, and their diagnostic message explicitly states that they are private implementation details. During a build, `cswinrt.exe` produces projections and `cswinrtinteropgen.exe` produces `WinRT.Interop.dll`. The generated code inside these tools uses private implementation detail types to perform marshalling work. See `docs/winrt-interop-dll-spec.md` for a description of the generated interop assembly. Because the tooling controls all references to these types, their shape can change whenever needed without breaking consumers. This flexibility is what allows performance and reliability improvements across releases. - -## Recommended action - -- Remove all references to any private implementation detail types. -- Look for supported alternatives in `WinRT.Runtime.dll`, the Windows SDK projections, or your own code. -- If you are authoring source generators or tooling, never take a dependency on private implementation detail types. -- When in doubt, file an issue describing the scenario so the CsWinRT team can help identify a stable API or consider exposing a supported helper. - -Keeping private implementation detail types exclusive to generated code is what allows CsWinRT to deliver fast, safe interop while evolving rapidly. Respecting the diagnostic ensures your applications remain stable across updates (and also avoids accidentally breaking builds when updating the CsWinRT version). diff --git a/nuget/Microsoft.Windows.CsWinRT.nuspec b/nuget/Microsoft.Windows.CsWinRT.nuspec index 1b9f18d74a..77baea4dca 100644 --- a/nuget/Microsoft.Windows.CsWinRT.nuspec +++ b/nuget/Microsoft.Windows.CsWinRT.nuspec @@ -33,6 +33,7 @@ + diff --git a/src/WinRT.Runtime2/ABI/System/Boolean.cs b/src/WinRT.Runtime2/ABI/System/Boolean.cs index 6c668aa2c1..6d993add02 100644 --- a/src/WinRT.Runtime2/ABI/System/Boolean.cs +++ b/src/WinRT.Runtime2/ABI/System/Boolean.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class BooleanMarshaller { /// @@ -288,4 +284,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Byte.cs b/src/WinRT.Runtime2/ABI/System/Byte.cs index 4cbe373176..d9cbee4b33 100644 --- a/src/WinRT.Runtime2/ABI/System/Byte.cs +++ b/src/WinRT.Runtime2/ABI/System/Byte.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ByteMarshaller { /// @@ -456,4 +452,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Char.cs b/src/WinRT.Runtime2/ABI/System/Char.cs index 9161ddd52d..f6d3f6a9a5 100644 --- a/src/WinRT.Runtime2/ABI/System/Char.cs +++ b/src/WinRT.Runtime2/ABI/System/Char.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class CharMarshaller { /// @@ -288,4 +284,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/IEnumerable.cs b/src/WinRT.Runtime2/ABI/System/Collections/IEnumerable.cs index 7c1601d3de..4b964b1b1d 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/IEnumerable.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/IEnumerable.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -23,10 +22,7 @@ namespace ABI.System.Collections; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IEnumerableMarshaller { /// @@ -87,10 +83,7 @@ public static unsafe object CreateObject(void* value, out CreatedWrapperFlags wr /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class IEnumerableComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -108,10 +101,7 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumerableMethods { /// @@ -124,10 +114,7 @@ public static IEnumerator GetEnumerator(WindowsRuntimeObjectReference thisRefere /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IEnumerableImpl { /// diff --git a/src/WinRT.Runtime2/ABI/System/Collections/IEnumerator.cs b/src/WinRT.Runtime2/ABI/System/Collections/IEnumerator.cs index b6138a3353..48eeb6e6e0 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/IEnumerator.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/IEnumerator.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -23,10 +22,7 @@ namespace ABI.System.Collections; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IEnumeratorMarshaller { /// @@ -87,10 +83,7 @@ public static unsafe object CreateObject(void* value, out CreatedWrapperFlags wr /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class IEnumeratorComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -108,10 +101,7 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorMethods { /// @@ -131,10 +121,7 @@ public static bool MoveNext(WindowsRuntimeObjectReference thisReference) /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IEnumeratorImpl { /// @@ -275,4 +262,4 @@ void IEnumerator.Reset() { throw new NotSupportedException(); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/IList.cs b/src/WinRT.Runtime2/ABI/System/Collections/IList.cs index 87fea7a820..9668d4203f 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/IList.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/IList.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -27,10 +26,7 @@ namespace ABI.System.Collections; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IListMarshaller { /// @@ -91,10 +87,7 @@ public static unsafe object CreateObject(void* value, out CreatedWrapperFlags wr /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class IListComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -112,10 +105,7 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListMethods { /// @@ -188,10 +178,7 @@ public static void Clear(WindowsRuntimeObjectReference thisReference) /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IListImpl { /// @@ -551,4 +538,4 @@ void ICollection.CopyTo(Array array, int index) BindableIListMethods.CopyTo(thisReference, array, index); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/IReadOnlyList.cs b/src/WinRT.Runtime2/ABI/System/Collections/IReadOnlyList.cs index fce2dcfe05..64f35fbc78 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/IReadOnlyList.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/IReadOnlyList.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.InteropServices; using WindowsRuntime; using WindowsRuntime.InteropServices; @@ -22,10 +20,7 @@ namespace ABI.System.Collections; /// type will be generated at compile time, as its runtime class name will depend on the XAML configuration being used. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class IReadOnlyListComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -38,4 +33,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return new WindowsRuntimeReadOnlyList(valueReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/INotifyCollectionChanged.cs b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/INotifyCollectionChanged.cs index cb4bd9c62d..cc3459d28b 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/INotifyCollectionChanged.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/INotifyCollectionChanged.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Specialized; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; @@ -20,10 +19,7 @@ namespace ABI.System.Collections.Specialized; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyCollectionChangedMarshaller { /// @@ -44,10 +40,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(INotifyColle /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class INotifyCollectionChangedMethods { /// @@ -99,10 +92,7 @@ internal unsafe struct INotifyCollectionChangedVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyCollectionChangedImpl { /// @@ -193,4 +183,4 @@ private static HRESULT remove_CollectionChanged(void* thisPtr, EventRegistration return e.HResult; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedAction.cs b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedAction.cs index 21ee72f226..106641303d 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedAction.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedAction.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Specialized; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime; @@ -18,10 +17,7 @@ namespace ABI.System.Collections.Specialized; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class NotifyCollectionChangedActionMarshaller { /// @@ -90,10 +86,7 @@ static NotifyCollectionChangedActionInterfaceEntriesImpl() /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class NotifyCollectionChangedActionComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -117,4 +110,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return WindowsRuntimeValueTypeMarshaller.UnboxToManagedUnsafe(value, in WellKnownXamlInterfaceIIDs.IID_IReferenceOfNotifyCollectionChangedAction); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventArgs.cs b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventArgs.cs index c63bfeebb1..5177806fa9 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventArgs.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventArgs.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Specialized; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime; @@ -17,10 +16,7 @@ namespace ABI.System.Collections.Specialized; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class NotifyCollectionChangedEventArgsMarshaller { /// @@ -151,10 +147,7 @@ static int GetOldStartingIndex(void* value) /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class NotifyCollectionChangedEventArgsComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -236,4 +229,4 @@ file static unsafe class NotifyCollectionChangedEventArgsRuntimeClassFactory return defaultInterface; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandler.cs b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandler.cs index 9dcfdef519..3a0552fcd4 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandler.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandler.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Specialized; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -19,10 +18,7 @@ namespace ABI.System.Collections.Specialized; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class NotifyCollectionChangedEventHandlerMarshaller { /// @@ -146,10 +142,7 @@ static NotifyCollectionChangedEventHandlerInterfaceEntriesImpl() /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class NotifyCollectionChangedEventHandlerComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -307,4 +300,4 @@ private static HRESULT get_Value(void* thisPtr, void** result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandlerEventSource.cs b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandlerEventSource.cs index f763851ff2..09a42382f4 100644 --- a/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandlerEventSource.cs +++ b/src/WinRT.Runtime2/ABI/System/Collections/Specialized/NotifyCollectionChangedEventHandlerEventSource.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Specialized; -using System.ComponentModel; using WindowsRuntime; using WindowsRuntime.InteropServices; @@ -12,10 +10,7 @@ namespace ABI.System.Collections.Specialized; /// /// An implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class NotifyCollectionChangedEventHandlerEventSource : EventSource { /// @@ -53,4 +48,4 @@ protected override NotifyCollectionChangedEventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/DataErrorsChangedEventArgs.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/DataErrorsChangedEventArgs.cs index 3583b0b1c9..19925235f7 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/DataErrorsChangedEventArgs.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/DataErrorsChangedEventArgs.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -35,10 +34,7 @@ namespace ABI.System.ComponentModel; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class DataErrorsChangedEventArgsMarshaller { /// @@ -135,4 +131,4 @@ file static unsafe class DataErrorsChangedEventArgsRuntimeClassFactory return defaultInterface; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyDataErrorInfo.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyDataErrorInfo.cs index 2eb948f3a2..7a22da264b 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyDataErrorInfo.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyDataErrorInfo.cs @@ -44,10 +44,7 @@ namespace ABI.System.ComponentModel; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyDataErrorInfoMarshaller { /// @@ -68,10 +65,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(global::Syst /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyDataErrorInfoMethods { /// @@ -174,10 +168,7 @@ internal unsafe struct INotifyDataErrorInfoVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyDataErrorInfoImpl { /// diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyPropertyChanged.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyPropertyChanged.cs index 1b80d25526..e7984b5ac5 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyPropertyChanged.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/INotifyPropertyChanged.cs @@ -19,10 +19,7 @@ namespace ABI.System.ComponentModel; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyPropertyChangedMarshaller { /// @@ -43,10 +40,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(INotifyPrope /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class INotifyPropertyChangedMethods { /// @@ -98,10 +92,7 @@ internal unsafe struct INotifyPropertyChangedVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class INotifyPropertyChangedImpl { /// diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventArgs.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventArgs.cs index 6574166cc8..f22bd1fb56 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventArgs.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventArgs.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -14,10 +13,7 @@ namespace ABI.System.ComponentModel; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class PropertyChangedEventArgsMarshaller { /// @@ -55,10 +51,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(PropertyChan /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class PropertyChangedEventArgsComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -121,4 +114,4 @@ file static unsafe class PropertyChangedEventArgsRuntimeClassFactory return defaultInterface; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandler.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandler.cs index d457f3e19d..8a01f4e472 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandler.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandler.cs @@ -18,10 +18,7 @@ namespace ABI.System.ComponentModel; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class PropertyChangedEventHandlerMarshaller { /// @@ -145,10 +142,7 @@ static PropertyChangedEventHandlerInterfaceEntriesImpl() /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class PropertyChangedEventHandlerComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// diff --git a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandlerEventSource.cs b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandlerEventSource.cs index 23ce3bda8e..679680f3d6 100644 --- a/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandlerEventSource.cs +++ b/src/WinRT.Runtime2/ABI/System/ComponentModel/PropertyChangedEventHandlerEventSource.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.ComponentModel; using WindowsRuntime; using WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace ABI.System.ComponentModel; /// /// An implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class PropertyChangedEventHandlerEventSource : EventSource { /// @@ -52,4 +48,4 @@ protected override PropertyChangedEventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/DateTimeOffset.cs b/src/WinRT.Runtime2/ABI/System/DateTimeOffset.cs index e0e9ff87bd..0f0b6b18b7 100644 --- a/src/WinRT.Runtime2/ABI/System/DateTimeOffset.cs +++ b/src/WinRT.Runtime2/ABI/System/DateTimeOffset.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -39,10 +38,7 @@ namespace ABI.System; [WindowsRuntimeMappedType(typeof(global::System.DateTimeOffset))] [WindowsRuntimeReferenceType(typeof(global::System.DateTimeOffset?))] [DateTimeOffsetComWrappersMarshaller] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public struct DateTimeOffset { /// @@ -55,10 +51,7 @@ public struct DateTimeOffset /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class DateTimeOffsetMarshaller { /// @@ -335,4 +328,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Double.cs b/src/WinRT.Runtime2/ABI/System/Double.cs index 3cb89fb29f..aaee82f743 100644 --- a/src/WinRT.Runtime2/ABI/System/Double.cs +++ b/src/WinRT.Runtime2/ABI/System/Double.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class DoubleMarshaller { /// @@ -512,4 +508,4 @@ private static HRESULT GetSingle(void* thisPtr, float* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/EventHandler.cs b/src/WinRT.Runtime2/ABI/System/EventHandler.cs index 84568d3760..d65e9c9cd5 100644 --- a/src/WinRT.Runtime2/ABI/System/EventHandler.cs +++ b/src/WinRT.Runtime2/ABI/System/EventHandler.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -46,10 +45,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class EventHandlerMarshaller { /// @@ -314,4 +310,4 @@ private static HRESULT get_Value(void* thisPtr, void** result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Exception.cs b/src/WinRT.Runtime2/ABI/System/Exception.cs index f7910c85e3..fb569395f8 100644 --- a/src/WinRT.Runtime2/ABI/System/Exception.cs +++ b/src/WinRT.Runtime2/ABI/System/Exception.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -38,10 +37,7 @@ namespace ABI.System; [WindowsRuntimeMetadataTypeName("Windows.Foundation.HResult")] [WindowsRuntimeMappedType(typeof(global::System.Exception))] [ExceptionComWrappersMarshaller] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public struct Exception { /// @@ -55,10 +51,7 @@ public struct Exception /// Marshaller for . /// /// This marshaller is backed by the infrastructure provided by . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ExceptionMarshaller { /// @@ -246,4 +239,4 @@ private static HRESULT get_Value(void* thisPtr, Exception* result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Guid.cs b/src/WinRT.Runtime2/ABI/System/Guid.cs index 726a873554..50eb1e89b2 100644 --- a/src/WinRT.Runtime2/ABI/System/Guid.cs +++ b/src/WinRT.Runtime2/ABI/System/Guid.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class GuidMarshaller { /// @@ -317,4 +313,4 @@ private static HRESULT GetString(void* thisPtr, HSTRING* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/IDisposable.cs b/src/WinRT.Runtime2/ABI/System/IDisposable.cs index fc1b2fdb40..805b02cf73 100644 --- a/src/WinRT.Runtime2/ABI/System/IDisposable.cs +++ b/src/WinRT.Runtime2/ABI/System/IDisposable.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -41,10 +40,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IDisposableMarshaller { /// @@ -63,10 +59,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(global::Syst /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IDisposableMethods { /// @@ -99,10 +92,7 @@ internal unsafe struct IDisposableVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IDisposableImpl { /// @@ -161,4 +151,4 @@ private static HRESULT Close(void* thisPtr) IDisposableMethods.Dispose(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/IServiceProvider.cs b/src/WinRT.Runtime2/ABI/System/IServiceProvider.cs index d963e7d0a2..0f90747c18 100644 --- a/src/WinRT.Runtime2/ABI/System/IServiceProvider.cs +++ b/src/WinRT.Runtime2/ABI/System/IServiceProvider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -41,10 +40,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IServiceProviderMarshaller { /// @@ -63,10 +59,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(global::Syst /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IServiceProviderMethods { /// @@ -114,10 +107,7 @@ internal unsafe struct IServiceProviderVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IServiceProviderImpl { /// @@ -193,4 +183,4 @@ private static HRESULT GetService(void* thisPtr, Type serviceType, void** result return IServiceProviderMethods.GetService(thisReference, serviceType); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Int16.cs b/src/WinRT.Runtime2/ABI/System/Int16.cs index 737f8f0b24..50a303c21c 100644 --- a/src/WinRT.Runtime2/ABI/System/Int16.cs +++ b/src/WinRT.Runtime2/ABI/System/Int16.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Int16Marshaller { /// @@ -484,4 +480,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Int32.cs b/src/WinRT.Runtime2/ABI/System/Int32.cs index 8027851cbf..bea1b46ad0 100644 --- a/src/WinRT.Runtime2/ABI/System/Int32.cs +++ b/src/WinRT.Runtime2/ABI/System/Int32.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Int32Marshaller { /// @@ -491,4 +487,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Int64.cs b/src/WinRT.Runtime2/ABI/System/Int64.cs index 16e56d3333..621577f8cc 100644 --- a/src/WinRT.Runtime2/ABI/System/Int64.cs +++ b/src/WinRT.Runtime2/ABI/System/Int64.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Int64Marshaller { /// @@ -498,4 +494,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Matrix3x2.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Matrix3x2.cs index 749ddbf800..ec958b2a69 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Matrix3x2.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Matrix3x2.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Matrix3x2Marshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Matrix3x return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Matrix4x4.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Matrix4x4.cs index 9f94ecaf3f..d7a3ff7d5a 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Matrix4x4.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Matrix4x4.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Matrix4x4Marshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Matrix4x return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Plane.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Plane.cs index fe5ff53236..0246bba713 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Plane.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Plane.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class PlaneMarshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Plane* r return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Quaternion.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Quaternion.cs index dced508efd..853916a0f6 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Quaternion.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Quaternion.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class QuaternionMarshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Quaterni return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Vector2.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Vector2.cs index dabd87f769..cd10654163 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Vector2.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Vector2.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Vector2Marshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Vector2* return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Vector3.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Vector3.cs index e463900f31..f32ae5c989 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Vector3.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Vector3.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Vector3Marshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Vector3* return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Numerics/Vector4.cs b/src/WinRT.Runtime2/ABI/System/Numerics/Vector4.cs index 8368e3f2a1..f6fb040d36 100644 --- a/src/WinRT.Runtime2/ABI/System/Numerics/Vector4.cs +++ b/src/WinRT.Runtime2/ABI/System/Numerics/Vector4.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -45,10 +44,7 @@ namespace ABI.System.Numerics; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class Vector4Marshaller { /// @@ -207,4 +203,4 @@ private static HRESULT get_Value(void* thisPtr, global::System.Numerics.Vector4* return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Single.cs b/src/WinRT.Runtime2/ABI/System/Single.cs index a051b2ee1a..5957badf43 100644 --- a/src/WinRT.Runtime2/ABI/System/Single.cs +++ b/src/WinRT.Runtime2/ABI/System/Single.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class SingleMarshaller { /// @@ -505,4 +501,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/String.cs b/src/WinRT.Runtime2/ABI/System/String.cs index 0ae612ae65..8e62c51654 100644 --- a/src/WinRT.Runtime2/ABI/System/String.cs +++ b/src/WinRT.Runtime2/ABI/System/String.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class StringMarshaller { /// @@ -443,4 +439,4 @@ private static HRESULT GetNumeric(void* thisPtr, T* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/TimeSpan.cs b/src/WinRT.Runtime2/ABI/System/TimeSpan.cs index 27fb0b68c9..1763e43dfa 100644 --- a/src/WinRT.Runtime2/ABI/System/TimeSpan.cs +++ b/src/WinRT.Runtime2/ABI/System/TimeSpan.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -39,10 +38,7 @@ namespace ABI.System; [WindowsRuntimeMappedType(typeof(global::System.TimeSpan))] [WindowsRuntimeReferenceType(typeof(global::System.TimeSpan?))] [TimeSpanComWrappersMarshaller] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public struct TimeSpan { /// @@ -55,10 +51,7 @@ public struct TimeSpan /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class TimeSpanMarshaller { /// @@ -326,4 +319,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Type.cs b/src/WinRT.Runtime2/ABI/System/Type.cs index ca235d753c..4767f0b973 100644 --- a/src/WinRT.Runtime2/ABI/System/Type.cs +++ b/src/WinRT.Runtime2/ABI/System/Type.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -45,10 +44,7 @@ namespace ABI.System; [WindowsRuntimeMetadataTypeName("Windows.UI.Xaml.Interop.TypeName")] [WindowsRuntimeMappedType(typeof(global::System.Type))] [TypeComWrappersMarshaller] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe struct Type { /// @@ -67,10 +63,7 @@ public unsafe struct Type /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class TypeMarshaller { /// @@ -1027,4 +1020,4 @@ public override int GetHashCode() { return _fullName.GetHashCode(); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/UInt16.cs b/src/WinRT.Runtime2/ABI/System/UInt16.cs index 236f032b35..10d05a5271 100644 --- a/src/WinRT.Runtime2/ABI/System/UInt16.cs +++ b/src/WinRT.Runtime2/ABI/System/UInt16.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class UInt16Marshaller { /// @@ -470,4 +466,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/UInt32.cs b/src/WinRT.Runtime2/ABI/System/UInt32.cs index 1789d62bf1..da34839df7 100644 --- a/src/WinRT.Runtime2/ABI/System/UInt32.cs +++ b/src/WinRT.Runtime2/ABI/System/UInt32.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class UInt32Marshaller { /// @@ -484,4 +480,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/UInt64.cs b/src/WinRT.Runtime2/ABI/System/UInt64.cs index 66bff493e2..1d92e8f02d 100644 --- a/src/WinRT.Runtime2/ABI/System/UInt64.cs +++ b/src/WinRT.Runtime2/ABI/System/UInt64.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -43,10 +42,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class UInt64Marshaller { /// @@ -498,4 +494,4 @@ private static HRESULT GetDouble(void* thisPtr, double* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Uri.cs b/src/WinRT.Runtime2/ABI/System/Uri.cs index 9917d2fed9..1c0beb64d9 100644 --- a/src/WinRT.Runtime2/ABI/System/Uri.cs +++ b/src/WinRT.Runtime2/ABI/System/Uri.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime; @@ -35,10 +34,7 @@ namespace ABI.System; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class UriMarshaller { /// @@ -130,4 +126,4 @@ file static unsafe class UriRuntimeClassFactory return defaultInterface; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/System/Windows.Input/ICommand.cs b/src/WinRT.Runtime2/ABI/System/Windows.Input/ICommand.cs index faf4ce3941..30e5f1bbed 100644 --- a/src/WinRT.Runtime2/ABI/System/Windows.Input/ICommand.cs +++ b/src/WinRT.Runtime2/ABI/System/Windows.Input/ICommand.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; @@ -20,10 +19,7 @@ namespace ABI.System.Windows.Input; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ICommandMarshaller { /// @@ -44,10 +40,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(ICommand? va /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ICommandMethods { /// @@ -128,10 +121,7 @@ internal unsafe struct ICommandVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ICommandImpl { /// @@ -270,4 +260,4 @@ private static HRESULT Execute(void* thisPtr, void* parameter) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncActionCompletedHandler.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncActionCompletedHandler.cs index 1b28d99b7e..3c4b5cc303 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncActionCompletedHandler.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncActionCompletedHandler.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class AsyncActionCompletedHandlerMarshaller { /// @@ -316,4 +312,4 @@ private static HRESULT get_Value(void* thisPtr, void** result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncStatus.cs index a48763a1bd..b3904dea2b 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/AsyncStatus.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class AsyncStatusMarshaller { /// @@ -125,4 +121,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return WindowsRuntimeValueTypeMarshaller.UnboxToManagedUnsafe(value, in WellKnownWindowsInterfaceIIDs.IID_IReferenceOfAsyncStatus); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/CollectionChange.cs index 7528ac0295..53482131a4 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/CollectionChange.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation.Collections; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation.Collections; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class CollectionChangeMarshaller { /// @@ -125,4 +121,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return WindowsRuntimeValueTypeMarshaller.UnboxToManagedUnsafe(value, in WellKnownWindowsInterfaceIIDs.IID_IReferenceOfCollectionChange); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/IVectorChangedEventArgs.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/IVectorChangedEventArgs.cs index 2743c2f97f..81c90bbfc9 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/IVectorChangedEventArgs.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/IVectorChangedEventArgs.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation.Collections; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IVectorChangedEventArgsMarshaller { /// @@ -54,10 +50,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(IVectorChang /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IVectorChangedEventArgsMethods { /// @@ -108,10 +101,7 @@ internal unsafe struct IVectorChangedEventArgsVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IVectorChangedEventArgsImpl { /// @@ -205,4 +195,4 @@ uint IVectorChangedEventArgs.Index return IVectorChangedEventArgsMethods.Index(thisReference); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/MapChangedEventHandlerEventSource{K, V}.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/MapChangedEventHandlerEventSource{K, V}.cs index 41c44d3626..ddabb144e1 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/MapChangedEventHandlerEventSource{K, V}.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/MapChangedEventHandlerEventSource{K, V}.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using Windows.Foundation.Collections; using WindowsRuntime; using WindowsRuntime.InteropServices; @@ -14,10 +12,7 @@ namespace ABI.Windows.Foundation.Collections; /// /// The type of keys in the observable map. /// The type of values in the observable map. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class MapChangedEventHandlerEventSource : EventSource> { /// @@ -49,4 +44,4 @@ protected override MapChangedEventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/VectorChangedEventHandlerEventSource{T}.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/VectorChangedEventHandlerEventSource{T}.cs index 0068c00e37..0b0299cda3 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/VectorChangedEventHandlerEventSource{T}.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Collections/VectorChangedEventHandlerEventSource{T}.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using Windows.Foundation.Collections; using WindowsRuntime; using WindowsRuntime.InteropServices; @@ -13,10 +11,7 @@ namespace ABI.Windows.Foundation.Collections; /// An implementation for . /// /// The type of elements in the observable vector. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class VectorChangedEventHandlerEventSource : EventSource> { /// @@ -48,4 +43,4 @@ protected override VectorChangedEventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncAction.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncAction.cs index f24d87c628..42b270406e 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncAction.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncAction.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncActionMarshaller { /// @@ -95,10 +91,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncActionMethods { /// @@ -172,10 +165,7 @@ internal unsafe struct IAsyncActionVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncActionImpl { /// @@ -296,4 +286,4 @@ void IAsyncAction.GetResults() IAsyncActionMethods.GetResults(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncInfo.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncInfo.cs index b4d0ab9899..efc4e3e02a 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncInfo.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/IAsyncInfo.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -29,10 +28,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncInfoMarshaller { /// @@ -51,10 +47,7 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanaged(IAsyncInfo? /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncInfoMethods { /// @@ -154,10 +147,7 @@ internal unsafe struct IAsyncInfoVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncInfoImpl { /// @@ -350,4 +340,4 @@ void IAsyncInfo.Close() IAsyncInfoMethods.Close(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/IMemoryBufferReference.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/IMemoryBufferReference.cs index 516a30a0f6..98a39fdf2b 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/IMemoryBufferReference.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/IMemoryBufferReference.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -31,10 +30,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IMemoryBufferReferenceMarshaller { /// @@ -96,10 +92,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IMemoryBufferReferenceMethods { /// @@ -172,10 +165,7 @@ internal unsafe struct IMemoryBufferReferenceVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IMemoryBufferReferenceImpl { /// @@ -333,4 +323,4 @@ event EventHandler? IMemoryBufferReference.Close IMemoryBufferReferenceMethods.Closed(thisObject, thisReference).Unsubscribe(value); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/IStringable.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/IStringable.cs index 22ac08de74..600fbc53ce 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/IStringable.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/IStringable.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -42,10 +41,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStringableMarshaller { /// @@ -129,10 +125,7 @@ public WindowsRuntimeStringable(WindowsRuntimeObjectReference nativeObjectRefere } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -148,10 +141,7 @@ public override string ToString() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; @@ -161,10 +151,7 @@ protected override bool IsOverridableInterface(in Guid iid) /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStringableMethods { /// @@ -208,10 +195,7 @@ internal unsafe struct IStringableVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStringableImpl { /// @@ -277,4 +261,4 @@ private static HRESULT ToString(void* thisPtr, HSTRING* result) return IStringableMethods.ToString(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Point.cs index f6877757a4..bc656e6492 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Point.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class PointMarshaller { /// @@ -275,4 +271,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/PropertyType.cs index 8982afa5aa..10f90c29c6 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/PropertyType.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class PropertyTypeMarshaller { /// @@ -125,4 +121,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return WindowsRuntimeValueTypeMarshaller.UnboxToManagedUnsafe(value, in WellKnownWindowsInterfaceIIDs.IID_IReferenceOfPropertyType); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Rect.cs index 49de7b2656..6b8b039f79 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Rect.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class RectMarshaller { /// @@ -275,4 +271,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/ABI/Windows.Foundation/Size.cs index 3e502df0aa..a5c950c0e1 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Foundation/Size.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -30,10 +29,7 @@ namespace ABI.Windows.Foundation; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class SizeMarshaller { /// @@ -275,4 +271,4 @@ private static HRESULT get_Type(void* thisPtr, PropertyType* value) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IBuffer.cs b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IBuffer.cs index 00e6a0ef5f..5fd586a111 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IBuffer.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IBuffer.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -31,10 +30,7 @@ namespace ABI.Windows.Storage.Streams; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IBufferMarshaller { /// @@ -96,10 +92,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IBufferMethods { /// @@ -168,10 +161,7 @@ internal unsafe struct IBufferVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IBufferImpl { /// @@ -300,4 +290,4 @@ uint IBuffer.Length IBufferMethods.Length(thisReference, value); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IInputStream.cs b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IInputStream.cs index 7e979c347a..bdf1157623 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IInputStream.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IInputStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -31,10 +30,7 @@ namespace ABI.Windows.Storage.Streams; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IInputStreamMarshaller { /// @@ -96,10 +92,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IInputStreamMethods { /// @@ -159,10 +152,7 @@ internal unsafe struct IInputStreamVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IInputStreamImpl { /// @@ -238,4 +228,4 @@ IAsyncOperationWithProgress IInputStream.ReadAsync(IBuffer buffer return IInputStreamMethods.ReadAsync(thisReference, buffer, count, options); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IOutputStream.cs b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IOutputStream.cs index f87d69866a..f1fb0a2524 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IOutputStream.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IOutputStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -31,10 +30,7 @@ namespace ABI.Windows.Storage.Streams; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IOutputStreamMarshaller { /// @@ -96,10 +92,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IOutputStreamMethods { /// @@ -182,10 +175,7 @@ internal unsafe struct IOutputStreamVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IOutputStreamImpl { /// @@ -297,4 +287,4 @@ IAsyncOperation IOutputStream.FlushAsync() return IOutputStreamMethods.FlushAsync(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IRandomAccessStream.cs b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IRandomAccessStream.cs index ebea98f5b0..920efc39b7 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IRandomAccessStream.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/IRandomAccessStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -31,10 +30,7 @@ namespace ABI.Windows.Storage.Streams; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IRandomAccessStreamMarshaller { /// @@ -96,10 +92,7 @@ public static object CreateObject(void* value, out CreatedWrapperFlags wrapperFl /// /// Interop methods for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IRandomAccessStreamMethods { /// @@ -294,10 +287,7 @@ internal unsafe struct IRandomAccessStreamVftbl /// /// The implementation. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IRandomAccessStreamImpl { /// @@ -625,4 +615,4 @@ IRandomAccessStream IRandomAccessStream.CloneStream() return IRandomAccessStreamMethods.CloneStream(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/InputStreamOptions.cs index fdb05a299d..2ff9a41be2 100644 --- a/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/ABI/Windows.Storage.Streams/InputStreamOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Storage.Streams; @@ -30,10 +29,7 @@ namespace ABI.Windows.Storage.Streams; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class InputStreamOptionsMarshaller { /// @@ -125,4 +121,4 @@ public override object CreateObject(void* value, out CreatedWrapperFlags wrapper return WindowsRuntimeValueTypeMarshaller.UnboxToManagedUnsafe(value, in WellKnownWindowsInterfaceIIDs.IID_IReferenceOfInputStreamOptions); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/Bindables/BindableIReadOnlyListAdapter.cs b/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/Bindables/BindableIReadOnlyListAdapter.cs index 7a0bbee795..b2e99342ef 100644 --- a/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/Bindables/BindableIReadOnlyListAdapter.cs +++ b/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/Bindables/BindableIReadOnlyListAdapter.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime; @@ -87,10 +86,7 @@ static BindableIReadOnlyListAdapterInterfaceEntriesImpl() /// /// A custom implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class BindableIReadOnlyListAdapterComWrappersMarshallerAttribute : WindowsRuntimeComWrappersMarshallerAttribute { /// @@ -212,4 +208,4 @@ private static HRESULT IndexOf(void* thisPtr, void* value, uint* index, bool* re return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(ex); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/EventRegistrationToken.cs b/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/EventRegistrationToken.cs index fbb90b6c1f..0582a161df 100644 --- a/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/EventRegistrationToken.cs +++ b/src/WinRT.Runtime2/ABI/WindowsRuntime.InteropServices/EventRegistrationToken.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -25,10 +24,7 @@ namespace ABI.WindowsRuntime.InteropServices; /// /// Marshaller for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class EventRegistrationTokenMarshaller { /// @@ -187,4 +183,4 @@ private static HRESULT get_Value(void* thisPtr, EventRegistrationToken* result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeDefaultInterfaceAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeDefaultInterfaceAttribute.cs index ba327c4a61..e280fa0702 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeDefaultInterfaceAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeDefaultInterfaceAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -12,10 +11,7 @@ namespace WindowsRuntime; /// on the runtime class type itself. This allows the interface type reference to be trimmed away when not needed. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeDefaultInterfaceAttribute : Attribute { /// @@ -38,4 +34,4 @@ public WindowsRuntimeDefaultInterfaceAttribute(Type runtimeClassType, Type inter /// Gets the type of the default interface for the specified Windows Runtime class type. /// public Type InterfaceType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeExclusiveToInterfaceAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeExclusiveToInterfaceAttribute.cs index 5ae3841602..e1ea76964c 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeExclusiveToInterfaceAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeExclusiveToInterfaceAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -10,10 +9,7 @@ namespace WindowsRuntime; /// Indicates the projected Windows Runtime class type that a given interface is exclusive to. /// [AttributeUsage(AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeExclusiveToInterfaceAttribute : Attribute { /// @@ -29,4 +25,4 @@ public WindowsRuntimeExclusiveToInterfaceAttribute(Type runtimeClassType) /// Gets the projected Windows Runtime class type that the annotated interface is exclusive to. /// public Type RuntimeClassType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeImplementationOnlyMemberAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeImplementationOnlyMemberAttribute.cs new file mode 100644 index 0000000000..7b9e858c29 --- /dev/null +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeImplementationOnlyMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using System.Diagnostics; + +namespace WindowsRuntime; + +/// +/// Indicates a member that is an implementation-only member, meaning it should only be included in the WinRT.Runtime.dll +/// assembly when producing the implementation .dll (not the reference assemlby) that will be used by downstream tooling too. +/// +/// +/// This attribute is used to make it clearer which members are implementation-only members (rather than just relying on whether +/// they are excluded from the compilation in some way). Additionally, this attribute is actually only emitted when producing +/// reference assemblies (where such members wouldn't be present anyway), so it can be fully stripped in the actual .dll used. +/// +[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] +[Conditional("WINDOWS_RUNTIME_REFERENCE_ASSEMBLY")] +internal sealed class WindowsRuntimeImplementationOnlyMemberAttribute : Attribute; \ No newline at end of file diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMappedMetadataAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMappedMetadataAttribute.cs index abec34fd53..db7d06d96b 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMappedMetadataAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMappedMetadataAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -17,10 +16,7 @@ namespace WindowsRuntime; AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeMappedMetadataAttribute : Attribute { /// @@ -36,4 +32,4 @@ public WindowsRuntimeMappedMetadataAttribute(string name) /// Gets the name of the mapped source Windows Runtime metadata file (.winmd) that the current custom-mapped type is from. /// public string Name { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataAttribute.cs index ef8d79db32..aff608ee3d 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -17,10 +16,7 @@ namespace WindowsRuntime; AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeMetadataAttribute : Attribute { /// @@ -36,4 +32,4 @@ public WindowsRuntimeMetadataAttribute(string name) /// Gets the name of the source Windows Runtime metadata file (.winmd) that the current projected type is from. /// public string Name { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataTypeNameAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataTypeNameAttribute.cs index 352cae8da7..3e6bceb204 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataTypeNameAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeMetadataTypeNameAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -27,10 +26,7 @@ namespace WindowsRuntime; AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeMetadataTypeNameAttribute : Attribute { /// @@ -46,4 +42,4 @@ public WindowsRuntimeMetadataTypeNameAttribute(string metadataTypeName) /// Gets the metadata type name for the current instance. /// public string MetadataTypeName { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Attributes/WindowsRuntimeReferenceTypeAttribute.cs b/src/WinRT.Runtime2/Attributes/WindowsRuntimeReferenceTypeAttribute.cs index 68f1a6e269..e5351a0c4f 100644 --- a/src/WinRT.Runtime2/Attributes/WindowsRuntimeReferenceTypeAttribute.cs +++ b/src/WinRT.Runtime2/Attributes/WindowsRuntimeReferenceTypeAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime; @@ -16,10 +15,7 @@ namespace WindowsRuntime; AttributeTargets.Enum, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeReferenceTypeAttribute : Attribute { /// @@ -35,4 +31,4 @@ public WindowsRuntimeReferenceTypeAttribute(Type referenceType) /// Gets the reference type (a constructed type) for the annotated type. /// public Type ReferenceType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationArgsReference.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationArgsReference.cs index 32f46e3709..30ada9f78c 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationArgsReference.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationArgsReference.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -14,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// /// This type works around the lack of support for for byref-like types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public readonly ref struct WindowsRuntimeActivationArgsReference { /// diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactory.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactory.cs index 847890afdb..512d6507a3 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactory.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactory.cs @@ -114,6 +114,9 @@ public static bool TryGetActivationFactoryUnsafe(string runtimeClassName, in Gui /// private static HRESULT GetActivationFactoryFromAnySourceUnsafe(string runtimeClassName, in Guid iid, out void* activationFactory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // If we have no input IID, it means that callers just expect whatever the default interface pointer // returned by each attempted API is. For the activation handler and 'RoGetActivationFactory', we // still need to pass an IID in all cases. Unless specified, this should be 'IID_IActivationFactory'. @@ -148,6 +151,7 @@ private static HRESULT GetActivationFactoryFromAnySourceUnsafe(string runtimeCla return Unsafe.IsNullRef(in iid) ? GetActivationFactoryFromDllUnsafe(runtimeClassName, hresult, out activationFactory) : GetActivationFactoryFromDllUnsafe(runtimeClassName, in iid, hresult, out activationFactory); +#endif } /// Tries to get the activation factory for a Windows Runtime type with the specified runtime class name, using only the registered activation handler, if present. @@ -175,6 +179,9 @@ private static HRESULT GetActivationFactoryFromDllUnsafe( HRESULT hresult, out void* activationFactory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else activationFactory = null; ReadOnlySpan moduleName = runtimeClassName; @@ -223,6 +230,7 @@ private static HRESULT GetActivationFactoryFromDllUnsafe( } return hresult; +#endif } /// Tries to get the activation factory for a Windows Runtime type with the specified runtime class name, using only manifest-free activation. @@ -235,6 +243,9 @@ private static HRESULT GetActivationFactoryFromDllUnsafe( HRESULT hresult, out void* activationFactory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else activationFactory = null; // First, try to get the activation factory with the same logic for when we don't have an IID @@ -253,6 +264,7 @@ private static HRESULT GetActivationFactoryFromDllUnsafe( _ = IUnknownVftbl.ReleaseUnsafe(activationFactoryUnknown); return hresult; +#endif } /// diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactoryCallback.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactoryCallback.cs index cb25f7c927..a7d65e3b97 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactoryCallback.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationFactoryCallback.cs @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// Activation factory types to activate Windows Runtime objects with custom logic. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class WindowsRuntimeActivationFactoryCallback { /// /// A type containing logic to activate a composed Windows Runtime object. /// /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public abstract class DerivedComposed { /// @@ -43,10 +34,7 @@ public abstract unsafe void Invoke( /// A type containing logic to activate a sealed Windows Runtime object. /// /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public abstract class DerivedSealed { /// @@ -56,4 +44,4 @@ public abstract class DerivedSealed /// The resulting default interface pointer. public abstract unsafe void Invoke(WindowsRuntimeActivationArgsReference additionalParameters, out void* defaultInterface); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationHelper.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationHelper.cs index c16f258c0a..31b71efed9 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationHelper.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationHelper.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE + using System; using System.Collections; using System.Collections.Specialized; diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationTypes.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationTypes.cs index fa500e3c97..7aacaae8a7 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationTypes.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeActivationTypes.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -15,27 +12,18 @@ namespace WindowsRuntime.InteropServices; /// constructor. Activation works differently for composed and sealed types, so these marker types are used to select /// the correct constructor overload to invoke. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class WindowsRuntimeActivationTypes { /// /// The derived type is a composed Windows Runtime type. /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public readonly ref struct DerivedComposed; /// /// The derived type is a sealed Windows Runtime type. /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public readonly ref struct DerivedSealed; -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeDllModule.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeDllModule.cs index 1903eb1684..eccc4a170a 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeDllModule.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimeDllModule.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE + using System; using System.Collections.Generic; using System.ComponentModel; diff --git a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimePlatformModule.cs b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimePlatformModule.cs index 67d56ea4bb..f5f5b4c99a 100644 --- a/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimePlatformModule.cs +++ b/src/WinRT.Runtime2/InteropServices/Activation/WindowsRuntimePlatformModule.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE + using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethods.cs b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethods.cs index b96c494473..ef22c63e7c 100644 --- a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IAsyncActionWithProgressMethods { /// @@ -27,4 +22,4 @@ public static void GetResults(WindowsRuntimeObjectReference thisReference) RestrictedErrorInfo.ThrowExceptionForHR(((IAsyncActionWithProgressVftbl*)*(void***)thisPtr)->GetResults(thisPtr)); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethodsImpl{TProgress}.cs b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethodsImpl{TProgress}.cs index 95a77664e7..b19197ee40 100644 --- a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethodsImpl{TProgress}.cs +++ b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncActionWithProgressMethodsImpl{TProgress}.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using Windows.Foundation; namespace WindowsRuntime.InteropServices; @@ -11,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// An interface for implementations of types. /// /// The type of progress information. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IAsyncActionWithProgressMethodsImpl { /// @@ -55,4 +50,4 @@ public interface IAsyncActionWithProgressMethodsImpl /// The instance to use to invoke the native method. /// static abstract void GetResults(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationMethodsImpl{TResult}.cs b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationMethodsImpl{TResult}.cs index 9dc801b08a..fddceac541 100644 --- a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationMethodsImpl{TResult}.cs +++ b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationMethodsImpl{TResult}.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using Windows.Foundation; namespace WindowsRuntime.InteropServices; @@ -11,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// An interface for implementations of types. /// /// The result type. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IAsyncOperationMethodsImpl { /// @@ -40,4 +35,4 @@ public interface IAsyncOperationMethodsImpl /// The results of the operation. /// static abstract TResult GetResults(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationWithProgressMethodsImpl{TResult, TProgress}.cs b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationWithProgressMethodsImpl{TResult, TProgress}.cs index 5b0fc97bf9..d8f4ccb1ce 100644 --- a/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationWithProgressMethodsImpl{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/InteropServices/AsyncInfo/IAsyncOperationWithProgressMethodsImpl{TResult, TProgress}.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using Windows.Foundation; namespace WindowsRuntime.InteropServices; @@ -12,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// The result type. /// The type of progress information. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IAsyncOperationWithProgressMethodsImpl { /// @@ -57,4 +52,4 @@ public interface IAsyncOperationWithProgressMethodsImpl /// The results of the operation. /// static abstract TResult GetResults(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/DynamicInterfaceCastableForwarderAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/DynamicInterfaceCastableForwarderAttribute.cs index bc1c6475f9..1749195175 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/DynamicInterfaceCastableForwarderAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/DynamicInterfaceCastableForwarderAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -18,14 +17,11 @@ namespace WindowsRuntime.InteropServices; /// is supported. Implementations are also expected to pre-cache the resulting object references while performing these checks. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class DynamicInterfaceCastableForwarderAttribute : Attribute { /// /// The instance to use to perform QueryInterface calls. /// The resulting for the effective interface, if available. public abstract bool IsInterfaceImplemented(WindowsRuntimeObject thisObject, [NotNullWhen(true)] out WindowsRuntimeObjectReference? interfaceReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs index 6e7bbb0ae7..c641ebeb60 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeActivationFactoryAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// Indicates the authored Windows Runtime class type that a given activation factory is for. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeActivationFactoryAttribute : Attribute { /// @@ -29,4 +25,4 @@ public WindowsRuntimeActivationFactoryAttribute(Type runtimeClassType) /// Gets the authored Windows Runtime class type that the annotated activation factory is for. /// public Type RuntimeClassType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComWrappersMarshallerAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComWrappersMarshallerAttribute.cs index 77a19c1874..0802e82b94 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComWrappersMarshallerAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComWrappersMarshallerAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -41,10 +40,7 @@ namespace WindowsRuntime.InteropServices; AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class WindowsRuntimeComWrappersMarshallerAttribute : Attribute { /// @@ -139,4 +135,4 @@ static NotSupportedException GetNotSupportedException() throw GetNotSupportedException(); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyAttribute.cs index dd0b2a0a90..7a52538f9c 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -16,10 +15,7 @@ namespace WindowsRuntime.InteropServices; /// /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeComponentAssemblyAttribute : Attribute { /// @@ -28,4 +24,4 @@ public sealed class WindowsRuntimeComponentAssemblyAttribute : Attribute public WindowsRuntimeComponentAssemblyAttribute() { } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyExportsTypeAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyExportsTypeAttribute.cs index 9bdc7db4e7..6b1ef71188 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyExportsTypeAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeComponentAssemblyExportsTypeAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeComponentAssemblyExportsTypeAttribute : Attribute { /// @@ -34,4 +30,4 @@ public WindowsRuntimeComponentAssemblyExportsTypeAttribute(Type exportsType) /// Gets the type that contains the managed GetActivationFactory method to invoke for authoring scenarios. /// public Type ExportsType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeMappedTypeAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeMappedTypeAttribute.cs index 69e72069bc..72916e1bcd 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeMappedTypeAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeMappedTypeAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// Indicates a mapped type for a Windows Runtime type projection (ie. a metadata provider type). /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeMappedTypeAttribute : Attribute { /// @@ -29,4 +25,4 @@ public WindowsRuntimeMappedTypeAttribute(Type publicType) /// Gets the public type associated with the current instance (ie. the type that would be used directly by developers). /// public Type PublicType { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeReferenceAssemblyAttribute.cs b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeReferenceAssemblyAttribute.cs index 6625d2f27d..ed4b612b7d 100644 --- a/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeReferenceAssemblyAttribute.cs +++ b/src/WinRT.Runtime2/InteropServices/Attributes/WindowsRuntimeReferenceAssemblyAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -17,10 +16,7 @@ namespace WindowsRuntime.InteropServices; /// /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class WindowsRuntimeReferenceAssemblyAttribute : Attribute { /// @@ -29,4 +25,4 @@ public sealed class WindowsRuntimeReferenceAssemblyAttribute : Attribute public WindowsRuntimeReferenceAssemblyAttribute() { } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Bindables/BindableIReadOnlyListAdapter.cs b/src/WinRT.Runtime2/InteropServices/Bindables/BindableIReadOnlyListAdapter.cs index 23b2862b0b..67393ee26c 100644 --- a/src/WinRT.Runtime2/InteropServices/Bindables/BindableIReadOnlyListAdapter.cs +++ b/src/WinRT.Runtime2/InteropServices/Bindables/BindableIReadOnlyListAdapter.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// still uses "IReadOnlyList" in its name to match the naming convention of adapter types matching .NET type names. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class BindableIReadOnlyListAdapter : IEnumerable { /// @@ -58,4 +54,4 @@ public IEnumerator GetEnumerator() { return _list.GetEnumerator(); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeArrayComWrappersCallback.cs b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeArrayComWrappersCallback.cs index 074d3e64d5..aba67353d7 100644 --- a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeArrayComWrappersCallback.cs +++ b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeArrayComWrappersCallback.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// /// An interface for callbacks for , for Windows Runtime arrays. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeArrayComWrappersCallback { /// @@ -38,4 +34,4 @@ public unsafe interface IWindowsRuntimeArrayComWrappersCallback /// /// static abstract Array CreateArray(uint count, void* value); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeObjectComWrappersCallback.cs b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeObjectComWrappersCallback.cs index 8e0e279a0b..3b7a145999 100644 --- a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeObjectComWrappersCallback.cs +++ b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeObjectComWrappersCallback.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// An interface for callbacks for , for Windows Runtime objects. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeObjectComWrappersCallback { /// @@ -47,4 +42,4 @@ public unsafe interface IWindowsRuntimeObjectComWrappersCallback /// /// static abstract object CreateObject(void* value, out CreatedWrapperFlags wrapperFlags); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeUnsealedObjectComWrappersCallback.cs b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeUnsealedObjectComWrappersCallback.cs index 83f5f3d92c..95f65aa878 100644 --- a/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeUnsealedObjectComWrappersCallback.cs +++ b/src/WinRT.Runtime2/InteropServices/Callbacks/IWindowsRuntimeUnsealedObjectComWrappersCallback.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// An interface for callbacks for , for unsealed Windows Runtime objects. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeUnsealedObjectComWrappersCallback { /// @@ -62,4 +58,4 @@ static abstract bool TryCreateObject( /// /// static abstract object CreateObject(void* value, out CreatedWrapperFlags wrapperFlags); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryAdapterExtensions.cs b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryAdapterExtensions.cs index 47dd367703..b6094cf422 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryAdapterExtensions.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryAdapterExtensions.cs @@ -5,7 +5,6 @@ using System.Collections.Concurrent; using System.Collections.Frozen; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; #pragma warning disable IDE0045, IDE0046 @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// Extensions for the type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IDictionaryAdapterExtensions { extension(IDictionaryAdapter) @@ -127,4 +123,4 @@ public static void Remove(IDictionary dictionary, ReadOnlySpanThe type of keys in the dictionary. /// The type of values in the dictionary. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IDictionaryAdapter { /// @@ -115,4 +110,4 @@ public static void Remove(IDictionary dictionary, TKey key) KeyNotFoundException.ThrowKeyNotFound(); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods.cs index e5071cfee0..d8c668980c 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods.cs @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// Methods for implementations of types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IDictionaryMethods { /// @@ -28,4 +22,4 @@ public static void Clear(WindowsRuntimeObjectReference thisReference) { IMapMethods.Clear(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods{TKey, TValue}.cs index 7de74cf38f..d01adf88c9 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IDictionaryMethods{TKey, TValue}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; #pragma warning disable CS1573, IDE0046 @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of keys in the dictionary. /// The type of values in the dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IDictionaryMethods { /// @@ -210,4 +206,4 @@ public static bool Remove(WindowsRuntimeObjectReference thisReference, return true; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableAdapter{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableAdapter{T}.cs index 5a6712311d..64a72601b2 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableAdapter{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableAdapter{T}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using WindowsRuntime.InteropServices.Marshalling; namespace WindowsRuntime.InteropServices; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of objects to enumerate. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumerableAdapter { /// @@ -61,4 +57,4 @@ public static unsafe void First(IEnumerable enumerable, in Guid iid, void** e *enumerator = (void*)WindowsRuntimeComWrappers.GetOrCreateComInterfaceForObjectExact(enumeratorAdapter, in iid); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableMethods{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableMethods{T}.cs index 65ce32a786..82510e0a37 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableMethods{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IEnumerableMethods{T}.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -12,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// Methods for types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumerableMethods { /// @@ -40,4 +35,4 @@ public static IEnumerator GetEnumerator(WindowsRuntimeObjectReferen // object implementing 'IEnumerator', or a managed object that was passed to native as a CCW. return enumerator; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapterExtensions.cs b/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapterExtensions.cs index 0a8d3cda77..1590c2dddd 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapterExtensions.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapterExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using WindowsRuntime.InteropServices.Marshalling; namespace WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// Extensions for the type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterExtensions { // Note: all the extensions in this file match the ones in 'IReadOnlyListAdapterExtensions', @@ -170,10 +166,7 @@ public unsafe uint GetMany(uint itemsSize, ABI.System.Type* items) /// /// Extensions for the type for blittable value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterBlittableValueTypeExtensions { extension(IEnumeratorAdapter adapter) @@ -206,10 +199,7 @@ public unsafe uint GetMany(uint itemsSize, T* items) /// /// Extensions for the type for unmanaged value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterUnmanagedValueTypeExtensions { extension(IEnumeratorAdapter adapter) @@ -244,10 +234,7 @@ public unsafe uint GetMany(uint itemsSize, TAbi* items) /// /// Extensions for the type for managed value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterManagedValueTypeExtensions { extension(IEnumeratorAdapter adapter) @@ -294,10 +281,7 @@ public unsafe uint GetMany(uint itemsSize, TAbi* items) /// /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterKeyValuePairTypeExtensions { extension(IEnumeratorAdapter> adapter) @@ -342,10 +326,7 @@ public unsafe uint GetMany(uint itemsSize, void** items) /// /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterNullableTypeExtensions { extension(IEnumeratorAdapter adapter) @@ -391,10 +372,7 @@ public unsafe uint GetMany(uint itemsSize, void** items) /// /// Extensions for the type for reference types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IEnumeratorAdapterReferenceTypeExtensions { extension(IEnumeratorAdapter adapter) @@ -435,4 +413,4 @@ public unsafe uint GetMany(uint itemsSize, void** items) return index; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapter{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapter{T}.cs index a50a24218c..3cb1ffe046 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapter{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IEnumeratorAdapter{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; #pragma warning disable IDE0032 @@ -16,10 +15,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of objects to enumerate. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class IEnumeratorAdapter : IEnumerator, IEnumeratorAdapter { /// @@ -204,4 +200,4 @@ private IEnumeratorAdapter Create(IEnumerator enumerator) { return new(enumerator); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IIterableMethodsImpl{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IIterableMethodsImpl{T}.cs index 1b7e8eb5e2..85dcf179fd 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IIterableMethodsImpl{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IIterableMethodsImpl{T}.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -11,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// An interface for implementations of Windows.Foundation.Collections.IIterable<T> types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IIterableMethodsImpl { /// @@ -24,4 +19,4 @@ public interface IIterableMethodsImpl /// The iterator. /// static abstract IEnumerator First(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethods.cs index 63eed64d3f..43b0d88d07 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IIterator<T> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IIteratorMethods { /// @@ -54,4 +49,4 @@ public static bool MoveNext(WindowsRuntimeObjectReference thisReference) return result; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethodsImpl{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethodsImpl{T}.cs index 785f129dbc..abe509295c 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethodsImpl{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IIteratorMethodsImpl{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// An interface for implementations of Windows.Foundation.Collections.IIterator<T> types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IIteratorMethodsImpl { /// @@ -23,4 +17,4 @@ public interface IIteratorMethodsImpl /// The current element. /// static abstract T Current(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IListAdapterExtensions.cs b/src/WinRT.Runtime2/InteropServices/Collections/IListAdapterExtensions.cs index 55238b460a..ddd8fe06d2 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IListAdapterExtensions.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IListAdapterExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using WindowsRuntime.InteropServices.Marshalling; namespace WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// Extensions for the type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterExtensions { // Note: all the extensions in this file exactly match the ones in 'IReadOnlyListAdapterExtensions'. @@ -226,10 +222,7 @@ public static unsafe uint GetMany(IList list, uint startIndex, uint itemsS /// /// Extensions for the type for blittable value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterBlittableValueTypeExtensions { extension(IListAdapter) @@ -269,10 +262,7 @@ public static unsafe uint GetMany(IList list, uint startIndex, uint itemsSize /// /// Extensions for the type for unmanaged value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterUnmanagedValueTypeExtensions { extension(IListAdapter) @@ -314,10 +304,7 @@ public static unsafe uint GetMany(IList list, uint startI /// /// Extensions for the type for managed value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterManagedValueTypeExtensions { extension(IListAdapter) @@ -374,10 +361,7 @@ public static unsafe uint GetMany(IList list, uint startI /// /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterKeyValuePairTypeExtensions { extension(IListAdapter>) @@ -432,10 +416,7 @@ public static unsafe uint GetMany(IList /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterNullableTypeExtensions { extension(IListAdapter) @@ -491,10 +472,7 @@ public static unsafe uint GetMany(IList list, uint start /// /// Extensions for the type for reference types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapterReferenceTypeExtensions { extension(IListAdapter) @@ -543,4 +521,4 @@ public static unsafe uint GetMany(IList list, uint startI return (uint)itemCount; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IListAdapter{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IListAdapter{T}.cs index 23b4ad4dd7..c0f34a5437 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IListAdapter{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IListAdapter{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -14,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of objects to enumerate. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListAdapter { /// @@ -203,4 +199,4 @@ public static void RemoveAtEnd(IList list) throw; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IListMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IListMethods.cs index 8ea7bbcf53..cc2fbd85f0 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IListMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IListMethods.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; #pragma warning disable CS1573 @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListMethods { /// @@ -48,4 +44,4 @@ public static void RemoveAt(WindowsRuntimeObjectReference thisReference, int ind throw ArgumentOutOfRangeException.GetArgumentOutOfRangeException(nameof(index)); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IListMethods{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IListMethods{T}.cs index d5e19d09a4..849ecd40de 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IListMethods{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IListMethods{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; #pragma warning disable CS1573 @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// Methods for types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IListMethods { /// @@ -159,4 +155,4 @@ public static void Insert(WindowsRuntimeObjectReference thisReference, throw ArgumentOutOfRangeException.GetArgumentOutOfRangeException(nameof(index)); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethods.cs index df55acf04a..f4caf1901e 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using Windows.Foundation.Collections; @@ -11,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IMapChangedEventArgs<K> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IMapChangedEventArgsMethods { /// @@ -35,4 +30,4 @@ public static CollectionChange CollectionChange(WindowsRuntimeObjectReference th return result; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethodsImpl{K}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethodsImpl{K}.cs index 41fe28b9ed..2cfefc2da8 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethodsImpl{K}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapChangedEventArgsMethodsImpl{K}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// An interface for implementations of Windows.Foundation.Collections.IMapChangedEventArgs<K> types. /// /// The type of keys in the map. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IMapChangedEventArgsMethodsImpl { /// @@ -23,4 +17,4 @@ public interface IMapChangedEventArgsMethodsImpl /// The key of the item that changed. /// static abstract K Key(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapMethods.cs index a59d695f66..7e03466992 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; #pragma warning disable CS1573 @@ -12,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IMap<K, V> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IMapMethods { /// @@ -39,4 +34,4 @@ public static void Clear(WindowsRuntimeObjectReference thisReference) RestrictedErrorInfo.ThrowExceptionForHR(((IMapVftbl*)*(void***)thisPtr)->Clear(thisPtr)); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapMethodsImpl{K, V}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapMethodsImpl{K, V}.cs index a8a62dd20e..4942f6ba97 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapMethodsImpl{K, V}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapMethodsImpl{K, V}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of keys in the map. /// The type of values in the map. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IMapMethodsImpl { /// @@ -52,4 +46,4 @@ public interface IMapMethodsImpl /// The key associated with the item to remove. /// static abstract void Remove(WindowsRuntimeObjectReference thisReference, K key); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethods.cs index 5617a0893e..58e33a5c15 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethods.cs @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IMapView<K, V> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IMapViewMethods { /// @@ -26,4 +20,4 @@ public static uint Size(WindowsRuntimeObjectReference thisReference) // The vtable slot for 'get_Size' is identical between 'IMapView' and 'IVectorView' return IVectorViewMethods.Size(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethodsImpl{K, V}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethodsImpl{K, V}.cs index b3e2dfe47c..a6056f38e5 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethodsImpl{K, V}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IMapViewMethodsImpl{K, V}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of keys in the map. /// The type of values in the map. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IMapViewMethodsImpl { /// @@ -34,4 +28,4 @@ public interface IMapViewMethodsImpl /// if the key is found; otherwise, . /// static abstract bool HasKey(WindowsRuntimeObjectReference thisReference, K key); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IObservableMapEventSourceFactory{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IObservableMapEventSourceFactory{TKey, TValue}.cs index 02c97cbd80..579de7533a 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IObservableMapEventSourceFactory{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IObservableMapEventSourceFactory{TKey, TValue}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of keys in the observable map. /// The type of values in the observable map. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IObservableMapEventSourceFactory { /// @@ -24,4 +18,4 @@ public interface IObservableMapEventSourceFactory /// The instance to be used with . /// static abstract ABI.Windows.Foundation.Collections.MapChangedEventHandlerEventSource MapChanged(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IObservableVectorEventSourceFactory{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IObservableVectorEventSourceFactory{T}.cs index 8ba76aa0e9..47a15917c3 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IObservableVectorEventSourceFactory{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IObservableVectorEventSourceFactory{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// An interface for implementations of types. /// /// The type of elements in the observable vector. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IObservableVectorEventSourceFactory { /// @@ -23,4 +17,4 @@ public interface IObservableVectorEventSourceFactory /// The instance to be used with . /// static abstract ABI.Windows.Foundation.Collections.VectorChangedEventHandlerEventSource VectorChanged(WindowsRuntimeObjectReference thisReference); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapterExtensions.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapterExtensions.cs index 08bd42ab30..ab432ba665 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapterExtensions.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapterExtensions.cs @@ -5,7 +5,6 @@ using System.Collections.Concurrent; using System.Collections.Frozen; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; #pragma warning disable IDE0045, IDE0046 @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// Extensions for the type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyDictionaryAdapterExtensions { extension(IReadOnlyDictionaryAdapter) @@ -103,4 +99,4 @@ public static bool HasKey(IReadOnlyDictionary dictionary, ReadOn return dictionary.ContainsKey(key.ToString()); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapter{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapter{TKey, TValue}.cs index 74ac8414df..17263d77d3 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapter{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryAdapter{TKey, TValue}.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -15,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// The type of keys in the dictionary. /// The type of values in the dictionary. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyDictionaryAdapter { /// @@ -84,4 +79,4 @@ public static void Split( splitAdapter.Split(out first, out second); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods.cs index 1d240ffbfc..d4b384d69b 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - #pragma warning disable CS1573 namespace WindowsRuntime.InteropServices; @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyDictionaryMethods { /// @@ -24,4 +18,4 @@ public static int Count(WindowsRuntimeObjectReference thisReference) // The vtable slot for 'get_Size' and the desired semantics are identical between 'IMapView' and 'IVectorView' return IReadOnlyListMethods.Count(thisReference); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods{TKey, TValue}.cs index b0e6986841..6896b78216 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionaryMethods{TKey, TValue}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; #pragma warning disable CS1573 @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of keys in the read-only dictionary. /// The type of values in the read-only dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyDictionaryMethods { /// @@ -72,4 +68,4 @@ public static bool TryGetValue(WindowsRuntimeObjectReference thisRefer return true; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionarySplitAdapter{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionarySplitAdapter{TKey, TValue}.cs index 362f95ed7b..0f6104561e 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionarySplitAdapter{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyDictionarySplitAdapter{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; #pragma warning disable IDE0046 @@ -17,10 +16,7 @@ namespace WindowsRuntime.InteropServices; /// The type of keys in the dictionary. /// The type of values in the dictionary. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class IReadOnlyDictionarySplitAdapter : IReadOnlyDictionary { /// @@ -214,4 +210,4 @@ public int Compare(KeyValuePair x, KeyValuePair y) return Comparer.Default.Compare(x.Key, y.Key); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapterExtensions.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapterExtensions.cs index b97b9e4d75..833895d966 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapterExtensions.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapterExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using WindowsRuntime.InteropServices.Marshalling; namespace WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// Extensions for the type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterExtensions { extension(IReadOnlyListAdapter) @@ -228,10 +224,7 @@ public static unsafe uint GetMany(IReadOnlyList list, uint startIndex, uin /// /// Extensions for the type for blittable value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterBlittableValueTypeExtensions { extension(IReadOnlyListAdapter) @@ -271,10 +264,7 @@ public static unsafe uint GetMany(IReadOnlyList list, uint startIndex, uint i /// /// Extensions for the type for unmanaged value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterUnmanagedValueTypeExtensions { extension(IReadOnlyListAdapter) @@ -316,10 +306,7 @@ public static unsafe uint GetMany(IReadOnlyList list, uin /// /// Extensions for the type for managed value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterManagedValueTypeExtensions { extension(IReadOnlyListAdapter) @@ -376,10 +363,7 @@ public static unsafe uint GetMany(IReadOnlyList list, uin /// /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterKeyValuePairTypeExtensions { extension(IReadOnlyListAdapter>) @@ -434,10 +418,7 @@ public static unsafe uint GetMany(IReadOnlyList /// Extensions for the type for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterNullableTypeExtensions { extension(IReadOnlyListAdapter) @@ -493,10 +474,7 @@ public static unsafe uint GetMany(IReadOnlyList list, ui /// /// Extensions for the type for reference types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapterReferenceTypeExtensions { extension(IReadOnlyListAdapter) @@ -545,4 +523,4 @@ public static unsafe uint GetMany(IReadOnlyList list, uin return (uint)itemCount; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapter{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapter{T}.cs index c09c03020a..bbff4742d0 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapter{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListAdapter{T}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of objects to enumerate. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListAdapter { /// @@ -82,4 +78,4 @@ public static bool IndexOf(IReadOnlyList list, T value, out uint index) return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods.cs index bf27f25986..0dda9ddaea 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods.cs @@ -2,17 +2,13 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; /// /// Methods for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListMethods { /// @@ -26,4 +22,4 @@ public static int Count(WindowsRuntimeObjectReference thisReference) return (int)count; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods{T}.cs index 940404ba05..cdc285438a 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IReadOnlyListMethods{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; #pragma warning disable CS1573 @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// Methods for types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IReadOnlyListMethods { /// @@ -38,4 +34,4 @@ public static T Item(WindowsRuntimeObjectReference thisReference, int throw ArgumentOutOfRangeException.GetArgumentOutOfRangeException(nameof(index)); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethods.cs index 8ca1491ae6..8a5eeaacfb 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IVector<T> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IVectorMethods { /// @@ -58,4 +53,4 @@ public static void Clear(WindowsRuntimeObjectReference thisReference) RestrictedErrorInfo.ThrowExceptionForHR(((IVectorVftbl*)*(void***)thisPtr)->Clear(thisPtr)); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethodsImpl{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethodsImpl{T}.cs index 6ab0679404..bc240c2764 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethodsImpl{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IVectorMethodsImpl{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// An interface for implementations of Windows.Foundation.Collections.IVector<T> types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IVectorMethodsImpl { /// @@ -60,4 +54,4 @@ public interface IVectorMethodsImpl /// The item to insert. /// static abstract void InsertAt(WindowsRuntimeObjectReference thisReference, uint index, T value); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethods.cs b/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethods.cs index 58f3d4b4ba..57fa1057ab 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +8,7 @@ namespace WindowsRuntime.InteropServices; /// /// Methods for Windows.Foundation.Collections.IVectorView<T> types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IVectorViewMethods { /// @@ -34,4 +29,4 @@ public static uint Size(WindowsRuntimeObjectReference thisReference) return result; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethodsImpl{T}.cs b/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethodsImpl{T}.cs index f99494d5e4..52df49af03 100644 --- a/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethodsImpl{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Collections/IVectorViewMethodsImpl{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// An interface for implementations of Windows.Foundation.Collections.IVectorView<T> types. /// /// The type of objects to enumerate. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IVectorViewMethodsImpl { /// @@ -24,4 +18,4 @@ public interface IVectorViewMethodsImpl /// The item at the specified index. /// static abstract T GetAt(WindowsRuntimeObjectReference thisReference, uint index); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Dispatching/DispatcherQueueSynchronizationContext.cs b/src/WinRT.Runtime2/InteropServices/Dispatching/DispatcherQueueSynchronizationContext.cs index 976ee2634a..20e544160d 100644 --- a/src/WinRT.Runtime2/InteropServices/Dispatching/DispatcherQueueSynchronizationContext.cs +++ b/src/WinRT.Runtime2/InteropServices/Dispatching/DispatcherQueueSynchronizationContext.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Threading; namespace WindowsRuntime.InteropServices; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// the UI thread. It needs to be installed on the UI thread through /// invoked on a wrapping managed object (which is generated in a projection .dll). /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public readonly struct DispatcherQueueSynchronizationContext { /// @@ -100,4 +96,4 @@ public void Send(SendOrPostCallback d, object? state) { throw new NotSupportedException("'SynchronizationContext.Send' is not supported."); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource.cs b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource.cs index f52596ac36..a4eef5d2a9 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource.cs @@ -2,17 +2,13 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; /// /// An implementation for . /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed unsafe class EventHandlerEventSource : EventSource { /// @@ -50,4 +46,4 @@ protected override EventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TEventArgs}.cs b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TEventArgs}.cs index 8c4511ae8e..fd5a015f34 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TEventArgs}.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TEventArgs}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// An implementation for . /// /// The type of the event data generated by the event. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class EventHandlerEventSource : EventSource> { /// @@ -45,4 +41,4 @@ protected override EventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TSender,TEventArgs}.cs b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TSender,TEventArgs}.cs index 9df6c6cff5..8998956a31 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TSender,TEventArgs}.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventHandlerEventSource{TSender,TEventArgs}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of object raising the event. /// The type of the event data generated by the event. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class EventHandlerEventSource : EventSource> { /// @@ -46,4 +42,4 @@ protected override EventHandler GetEventInvoke() return (obj, e) => TargetDelegate?.Invoke(obj, e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs index 8b590c358c..c31ba3e0e7 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs @@ -11,10 +11,12 @@ namespace WindowsRuntime.InteropServices; /// Represents a reference to a delegate that receives change notifications. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(EventRegistrationToken?))] [ABI.WindowsRuntime.InteropServices.EventRegistrationTokenComWrappersMarshaller] +#endif public struct EventRegistrationToken : IEquatable { /// diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationTokenTable{T}.cs b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationTokenTable{T}.cs index e7e3124111..e2b198d7c2 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationTokenTable{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationTokenTable{T}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -14,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// sourcing Windows Runtime style events from managed code. This only supports events for CCW objects. /// /// The event handler type to use in the table. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class EventRegistrationTokenTable where T : MulticastDelegate { @@ -177,4 +173,4 @@ private static int GetTypeOfTHashCode() // To work around this, we just check for this edge case and return a magic constant instead. return hashCode == 0 ? 0x5FC74196 : hashCode; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventSourceState{T}.cs b/src/WinRT.Runtime2/InteropServices/Events/EventSourceState{T}.cs index 921dbee4e8..6071bc92a7 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventSourceState{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventSourceState{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// /// The type of delegate being managed from the associated event. [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class EventSourceState : IDisposable where T : MulticastDelegate { @@ -212,4 +208,4 @@ private void OnDispose() EventSourceCache.Remove(_thisPtr, _index, _weakReferenceToSelf); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventSource{T}.cs b/src/WinRT.Runtime2/InteropServices/Events/EventSource{T}.cs index 371453befe..12536434e4 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventSource{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventSource{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// A managed wrapper for an event to expose to a native Windows Runtime consumer. /// /// The type of delegate being managed. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe class EventSource where T : MulticastDelegate { @@ -221,4 +217,4 @@ private bool TryGetStateUnsafe([NotNullWhen(true)] out EventSourceState? stat return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs b/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs index 5daf6e3856..9b08ad0b61 100644 --- a/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs +++ b/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// Handles the IRestrictedErrorInfo infrastructure for .NET exceptions. /// /// . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class RestrictedErrorInfo { /// @@ -42,6 +38,9 @@ public static unsafe class RestrictedErrorInfo /// restoredExceptionFromGlobalState Out param. private static Exception? GetExceptionForHR(HRESULT errorCode, out bool restoredExceptionFromGlobalState) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // If the 'HRESULT' indicates success, there is no exception to return if (errorCode.Succeeded) { @@ -180,6 +179,7 @@ public static unsafe class RestrictedErrorInfo restoredExceptionFromGlobalState = false; return exception; +#endif } /// @@ -230,6 +230,9 @@ static void Throw(HRESULT errorCode) /// public static HRESULT GetHRForException(Exception? exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // If the input exception is 'null', we always just map to 'S_OK' if (exception is null) { @@ -254,6 +257,7 @@ public static HRESULT GetHRForException(Exception? exception) } return WellKnownExceptionMappings.GetHRForNativeOrManagedErrorCode(hresult); +#endif } /// @@ -263,6 +267,9 @@ public static HRESULT GetHRForException(Exception? exception) /// Thrown if is . internal static void SetErrorInfo(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); try @@ -339,6 +346,7 @@ internal static void SetErrorInfo(Exception exception) // If we fail to set the error info, we continue on reporting the original exception Debug.Assert(false, e.Message, e.StackTrace); } +#endif } /// @@ -347,6 +355,9 @@ internal static void SetErrorInfo(Exception exception) /// The input instance to attach the error info to. internal static void AttachErrorInfo(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); void* restrictedErrorInfoPtr = null; @@ -417,6 +428,7 @@ internal static void AttachErrorInfo(Exception exception) { WindowsRuntimeUnknownMarshaller.Free(restrictedErrorInfoPtr); } +#endif } /// @@ -433,6 +445,9 @@ internal static void AttachErrorInfo(Exception exception) /// internal static void ReportUnhandledError(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else SetErrorInfo(exception); using WindowsRuntimeObjectReferenceValue restrictedErrorInfoValue = RestrictedErrorInfoHelpers.BorrowErrorInfo(); @@ -443,5 +458,6 @@ internal static void ReportUnhandledError(Exception exception) { _ = WindowsRuntimeImports.RoReportUnhandledError(restrictedErrorInfoValuePtr); } +#endif } } \ No newline at end of file diff --git a/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface.cs b/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface.cs index 595875a15f..082c65de26 100644 --- a/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface.cs +++ b/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -12,14 +11,11 @@ namespace WindowsRuntime.InteropServices; /// /// This interface is only meant to be used to support marshalling code for generic instantiations. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeInterface { /// /// Gets the IID for the implemented interface. /// static abstract ref readonly Guid IID { get; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface{T}.cs b/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface{T}.cs index 18b467a373..b306b78023 100644 --- a/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/IWindowsRuntimeInterface{T}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -18,10 +15,7 @@ namespace WindowsRuntime.InteropServices; /// The type must refer to a projected Windows Runtime interface. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeInterface where T : class { @@ -30,4 +24,4 @@ public interface IWindowsRuntimeInterface /// /// The cached instance for the interface . WindowsRuntimeObjectReferenceValue GetInterface(); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeKeyValuePairTypeElementMarshaller{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeKeyValuePairTypeElementMarshaller{TKey, TValue}.cs index 902cd1d7f6..56bd5f1b8c 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeKeyValuePairTypeElementMarshaller{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeKeyValuePairTypeElementMarshaller{TKey, TValue}.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime.InteropServices.Marshalling; @@ -12,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of the key. /// The type of the value. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeKeyValuePairTypeElementMarshaller { /// diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeManagedValueTypeElementMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeManagedValueTypeElementMarshaller{T, TAbi}.cs index 3bcfa861cb..827dc6e6fb 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeManagedValueTypeElementMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeManagedValueTypeElementMarshaller{T, TAbi}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeManagedValueTypeElementMarshaller where T : struct where TAbi : unmanaged diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeNullableTypeElementMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeNullableTypeElementMarshaller{T}.cs index 50c1e54e4b..7b8c2f7947 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeNullableTypeElementMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeNullableTypeElementMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// An interface for marshalling collection elements to native. /// /// The underlying value type of the nullable type. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeNullableTypeElementMarshaller where T : struct { diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeReferenceTypeElementMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeReferenceTypeElementMarshaller{T}.cs index e5ed85edcc..d7516ed65c 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeReferenceTypeElementMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeReferenceTypeElementMarshaller{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// /// An interface for marshalling collection elements to native. /// /// The type of elements in the array. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeReferenceTypeElementMarshaller where T : class { diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeUnmanagedValueTypeElementMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeUnmanagedValueTypeElementMarshaller{T, TAbi}.cs index 0358ac8975..bfb03fcb8c 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeUnmanagedValueTypeElementMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/Collections/IWindowsRuntimeUnmanagedValueTypeElementMarshaller{T, TAbi}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeUnmanagedValueTypeElementMarshaller where T : unmanaged where TAbi : unmanaged diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringHeader.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringHeader.cs index 1b169310de..3323b674e9 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringHeader.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringHeader.cs @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// /// Represents a header for a fast-pass HSTRING value (passed without copying). /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public struct HStringHeader { /// @@ -22,4 +16,4 @@ public struct HStringHeader /// Using this field to mirror the layout of with one fewer indirection. /// internal HSTRING_HEADER._Reserved_e__Union _reserved; -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringMarshaller.cs index 0db896dd7c..37dae15ed7 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for the Windows Runtime HSTRING type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class HStringMarshaller { /// @@ -171,4 +167,4 @@ public static void Free(HSTRING value) // We can ignore the return value, as this method always returns 'S_OK' _ = WindowsRuntimeImports.WindowsDeleteString(value); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringReference.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringReference.cs index 832965ac3d..cfd7e9df83 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/HStringReference.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/HStringReference.cs @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// /// Represents a reference to a fast-pass HSTRING value (passed without copying). /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe ref struct HStringReference { /// @@ -32,4 +26,4 @@ public unsafe ref struct HStringReference /// It is not valid to escape this value outside of the scope of the current instance. /// public readonly HSTRING HString => _hstring; -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/RestrictedErrorInfoExceptionMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/RestrictedErrorInfoExceptionMarshaller.cs index 4c5cb3050e..836ec5449d 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/RestrictedErrorInfoExceptionMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/RestrictedErrorInfoExceptionMarshaller.cs @@ -7,15 +7,16 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// -/// A marshaller using to marshal exceptions to and from the native side. +/// A marshaller using the IRestrictedErrorInfo infrastructure to marshal exceptions to and from the native side. /// /// /// This type is only meant to be used in two scenarios: /// -/// With , when used on interfaces implemented by WinRT objects. +/// With , when used on interfaces implemented by Windows Runtime objects. /// In blocks within generated or handwritten marshalling stubs. /// /// +/// . [CustomMarshaller(typeof(Exception), MarshalMode.ManagedToUnmanagedOut, typeof(RestrictedErrorInfoExceptionMarshaller))] public static class RestrictedErrorInfoExceptionMarshaller { @@ -36,9 +37,13 @@ public static class RestrictedErrorInfoExceptionMarshaller /// public static HRESULT ConvertToUnmanaged(Exception value) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else RestrictedErrorInfo.SetErrorInfo(value); return RestrictedErrorInfo.GetHRForException(value); +#endif } /// @@ -48,6 +53,10 @@ public static HRESULT ConvertToUnmanaged(Exception value) /// A managed exception. public static Exception? ConvertToManaged(HRESULT value) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return RestrictedErrorInfo.GetExceptionForHR(value); +#endif } } \ No newline at end of file diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/ExceptionArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/ExceptionArrayMarshaller.cs index 436fd7a79b..0a807e42d8 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/ExceptionArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/ExceptionArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for arrays of the Windows Runtime type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class ExceptionArrayMarshaller { /// @@ -104,4 +100,4 @@ public static void CopyToManaged(uint size, ABI.System.Exception* source, Span /// A marshaller for arrays of the Windows Runtime HSTRING type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class HStringArrayMarshaller { /// @@ -271,4 +267,4 @@ public static void Free(uint size, void** array) Marshal.FreeCoTaskMem((nint)array); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeKeyValuePairTypeArrayElementMarshaller{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeKeyValuePairTypeArrayElementMarshaller{TKey, TValue}.cs index 2c6d040212..9c1ae3abc8 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeKeyValuePairTypeArrayElementMarshaller{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeKeyValuePairTypeArrayElementMarshaller{TKey, TValue}.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime.InteropServices.Marshalling; @@ -12,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of the key. /// The type of the value. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeKeyValuePairTypeArrayElementMarshaller { /// diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeManagedValueTypeArrayElementMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeManagedValueTypeArrayElementMarshaller{T, TAbi}.cs index 1f2052b0a3..f9a7838d91 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeManagedValueTypeArrayElementMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeManagedValueTypeArrayElementMarshaller{T, TAbi}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeManagedValueTypeArrayElementMarshaller where T : struct where TAbi : unmanaged diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeNullableTypeArrayElementMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeNullableTypeArrayElementMarshaller{T}.cs index 7ade281e51..c39c14d763 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeNullableTypeArrayElementMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeNullableTypeArrayElementMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// An interface for marshalling implementations to support . /// /// The underlying value type of the nullable type. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeNullableTypeArrayElementMarshaller where T : struct { diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeReferenceTypeArrayElementMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeReferenceTypeArrayElementMarshaller{T}.cs index bd913731f7..257c505c31 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeReferenceTypeArrayElementMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeReferenceTypeArrayElementMarshaller{T}.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// /// An interface for marshalling implementations to support . /// /// The type of elements in the array. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe interface IWindowsRuntimeReferenceTypeArrayElementMarshaller where T : class { diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeUnmanagedValueTypeArrayElementMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeUnmanagedValueTypeArrayElementMarshaller{T, TAbi}.cs index 11743faf18..b29099b57c 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeUnmanagedValueTypeArrayElementMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/IWindowsRuntimeUnmanagedValueTypeArrayElementMarshaller{T, TAbi}.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// @@ -11,10 +8,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public interface IWindowsRuntimeUnmanagedValueTypeArrayElementMarshaller where T : unmanaged where TAbi : unmanaged diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/TypeArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/TypeArrayMarshaller.cs index dd43538aa2..371d21cfc6 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/TypeArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/TypeArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for arrays of the Windows Runtime type. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class TypeArrayMarshaller { /// @@ -162,4 +158,4 @@ public static void Free(uint size, ABI.System.Type* array) Marshal.FreeCoTaskMem((nint)array); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller.cs index 79fc337642..88d490d4b7 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for arrays of blittable Windows Runtime types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeBlittableValueTypeArrayMarshaller { /// @@ -32,4 +28,4 @@ public static void Free(uint size, void* array) Marshal.FreeCoTaskMem((nint)array); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller{T}.cs index 2867243f5c..2a23149c75 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeBlittableValueTypeArrayMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// A marshaller for arrays of blittable Windows Runtime types. /// /// The type of elements in the array. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeBlittableValueTypeArrayMarshaller where T : unmanaged { @@ -97,4 +93,4 @@ public static void CopyToManaged(uint size, T* source, Span destination) new ReadOnlySpan(source, (int)size).CopyTo(destination); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeKeyValuePairTypeArrayMarshaller{TKey, TValue}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeKeyValuePairTypeArrayMarshaller{TKey, TValue}.cs index ec3e5089cb..e3a6eac3dc 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeKeyValuePairTypeArrayMarshaller{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeKeyValuePairTypeArrayMarshaller{TKey, TValue}.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of the key. /// The type of the value. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeKeyValuePairTypeArrayMarshaller { /// @@ -139,4 +135,4 @@ public static void CopyToManaged(uint size, void** source, S destination[(int)i] = TElementMarshaller.ConvertToManaged(source[i]); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeManagedValueTypeArrayMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeManagedValueTypeArrayMarshaller{T, TAbi}.cs index 2d1ddb2de0..af4b67cc90 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeManagedValueTypeArrayMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeManagedValueTypeArrayMarshaller{T, TAbi}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeManagedValueTypeArrayMarshaller where T : struct where TAbi : unmanaged @@ -179,4 +175,4 @@ public static void Free(uint size, TAbi* array) Marshal.FreeCoTaskMem((nint)array); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeNullableTypeArrayMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeNullableTypeArrayMarshaller{T}.cs index dd9d23d35b..3ff0065c66 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeNullableTypeArrayMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeNullableTypeArrayMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// A marshaller for arrays of types. /// /// The underlying value type of the nullable type. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeNullableTypeArrayMarshaller where T : struct { diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeObjectArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeObjectArrayMarshaller.cs index 967752f911..f42baafaae 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeObjectArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeObjectArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for arrays of Windows Runtime objects. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeObjectArrayMarshaller { /// @@ -128,4 +124,4 @@ public static void CopyToManaged(uint size, void** source, Span destina destination[(int)i] = WindowsRuntimeObjectMarshaller.ConvertToManaged(source[i]); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeReferenceTypeArrayMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeReferenceTypeArrayMarshaller{T}.cs index 0ca314f15b..876ced0f7b 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeReferenceTypeArrayMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeReferenceTypeArrayMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// A marshaller for arrays of reference Windows Runtime types. /// /// The type of elements in the array. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeReferenceTypeArrayMarshaller where T : class { @@ -138,4 +134,4 @@ public static void CopyToManaged(uint size, void** source, S destination[(int)i] = TElementMarshaller.ConvertToManaged(source[i]); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnknownArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnknownArrayMarshaller.cs index 5fc9b78ec4..a0e617762a 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnknownArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnknownArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// This type mirrors , but for arrays. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeUnknownArrayMarshaller { /// @@ -56,4 +52,4 @@ public static void Free(uint size, void** array) Marshal.FreeCoTaskMem((nint)array); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnmanagedValueTypeArrayMarshaller{T, TAbi}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnmanagedValueTypeArrayMarshaller{T, TAbi}.cs index 8f97df4afc..19530bbaac 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnmanagedValueTypeArrayMarshaller{T, TAbi}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/SzArrays/WindowsRuntimeUnmanagedValueTypeArrayMarshaller{T, TAbi}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// The type of elements in the array. /// The ABI type for type . -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeUnmanagedValueTypeArrayMarshaller where T : unmanaged where TAbi : unmanaged @@ -119,4 +115,4 @@ public static void CopyToManaged(uint size, TAbi* source, Sp destination[(int)i] = TElementMarshaller.ConvertToManaged(source[i]); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/TypeReference.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/TypeReference.cs index 7f50ef2691..5a947b8303 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/TypeReference.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/TypeReference.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using Windows.UI.Xaml.Interop; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// Represents a reference to a value, for fast marshalling to native. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public unsafe ref struct TypeReference { /// @@ -67,4 +63,4 @@ public readonly ref byte GetPinnableReference() { return ref Unsafe.As(ref Unsafe.AsRef(in Name!.GetPinnableReference())); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeArrayMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeArrayMarshaller.cs index 37f1dad53e..b8ef650a43 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeArrayMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeArrayMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for Windows Runtime arrays. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeArrayMarshaller { /// @@ -59,4 +55,4 @@ public static unsafe class WindowsRuntimeArrayMarshaller WindowsRuntimeUnknownMarshaller.Free(referencePtr); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeDelegateMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeDelegateMarshaller.cs index 932bc84b40..f218a03c79 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeDelegateMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeDelegateMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for Windows Runtime delegates. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeDelegateMarshaller { /// @@ -189,4 +185,4 @@ static void ThrowNotSupportedException(object value) // Now that we have the 'IReference' pointer, unbox it normally return UnboxToManaged(referencePtr); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeInterfaceMarshaller{T}.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeInterfaceMarshaller{T}.cs index bb7d786830..d81dc932d4 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeInterfaceMarshaller{T}.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeInterfaceMarshaller{T}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// A marshaller for Windows Runtime interfaces. /// /// The type of the interface being marshalled. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeInterfaceMarshaller where T : class { @@ -219,4 +215,4 @@ private static void ThrowInvalidCastExceptionManaged(object value, in Guid iid, RestrictedErrorInfo.ThrowExceptionForHR(hresult); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeKeyValuePairTypeMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeKeyValuePairTypeMarshaller.cs index ff1b751f1c..5ac6d59709 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeKeyValuePairTypeMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeKeyValuePairTypeMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeKeyValuePairTypeMarshaller { /// @@ -34,4 +30,4 @@ public static WindowsRuntimeObjectReferenceValue ConvertToUnmanagedUnsafe(object { return new((void*)WindowsRuntimeComWrappers.Default.GetOrCreateComInterfaceForObject(value, flags, in iid)); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeObjectMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeObjectMarshaller.cs index 08c8b115a6..e403f2c9be 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeObjectMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeObjectMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for Windows Runtime objects. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeObjectMarshaller { /// @@ -124,4 +120,4 @@ static void ThrowNotSupportedException(object value) objectComWrappersCallback: WindowsRuntimeObjectComWrappersCallback.GetInstance(), unsealedObjectComWrappersCallback: null); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnknownMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnknownMarshaller.cs index 3bba42d511..dd0b9cfbcc 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnknownMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnknownMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for Windows Runtime or COM objects that does not do any additional QueryInterface calls for specific interfaces. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeUnknownMarshaller { /// @@ -68,4 +64,4 @@ public static void Free(void* value) _ = IUnknownVftbl.ReleaseUnsafe(value); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnsealedObjectMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnsealedObjectMarshaller.cs index 02fd47e608..11929b9633 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnsealedObjectMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeUnsealedObjectMarshaller.cs @@ -1,18 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for unsealed Windows Runtime objects. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeUnsealedObjectMarshaller { /// @@ -41,4 +35,4 @@ public static unsafe class WindowsRuntimeUnsealedObjectMarshaller objectComWrappersCallback: null, unsealedObjectComWrappersCallback: WindowsRuntimeUnsealedObjectComWrappersCallback.GetInstance()); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeValueTypeMarshaller.cs b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeValueTypeMarshaller.cs index 460e0f4c5e..71269c22f7 100644 --- a/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeValueTypeMarshaller.cs +++ b/src/WinRT.Runtime2/InteropServices/Marshalling/WindowsRuntimeValueTypeMarshaller.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.InteropServices; namespace WindowsRuntime.InteropServices.Marshalling; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices.Marshalling; /// /// A marshaller for Windows Runtime value types. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeValueTypeMarshaller { /// @@ -176,4 +172,4 @@ public static T UnboxToManagedUnsafe(void* value, in Guid iid) return result; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ObjectReference/CreateObjectReferenceMarshalingType.cs b/src/WinRT.Runtime2/InteropServices/ObjectReference/CreateObjectReferenceMarshalingType.cs index efc02e0f53..306b4f66a9 100644 --- a/src/WinRT.Runtime2/InteropServices/ObjectReference/CreateObjectReferenceMarshalingType.cs +++ b/src/WinRT.Runtime2/InteropServices/ObjectReference/CreateObjectReferenceMarshalingType.cs @@ -1,19 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// /// Specifies the marshaling type to use to marshal a given Windows Runtime object, specifically when creating a instance. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public enum CreateObjectReferenceMarshalingType { /// @@ -31,4 +25,4 @@ public enum CreateObjectReferenceMarshalingType /// CoGetStandardMarshal on all interfaces. /// Standard -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReference.cs b/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReference.cs index ee06ae965e..fba67b7543 100644 --- a/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReference.cs +++ b/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReference.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -11,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// A managed, low-level wrapper for a native Windows Runtime object. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract unsafe partial class WindowsRuntimeObjectReference : IDisposable { /// @@ -152,4 +148,4 @@ internal CreateObjectReferenceFlags CopyFlags(CreateObjectReferenceFlags request /// /// The value to return from . private protected abstract bool DerivedIsInCurrentContext(); -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReferenceValue.cs b/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReferenceValue.cs index 99a2a83704..faaa36bdfe 100644 --- a/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReferenceValue.cs +++ b/src/WinRT.Runtime2/InteropServices/ObjectReference/WindowsRuntimeObjectReferenceValue.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// /// A marshalling-optimized wrapper for a Windows Runtime object. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public readonly unsafe ref struct WindowsRuntimeObjectReferenceValue { /// @@ -157,4 +153,4 @@ public void Dispose() _ = IUnknownVftbl.ReleaseUnsafe(_thisPtr); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Platform/ComCallData.cs b/src/WinRT.Runtime2/InteropServices/Platform/ComCallData.cs index 449f5dc198..d829ff4b66 100644 --- a/src/WinRT.Runtime2/InteropServices/Platform/ComCallData.cs +++ b/src/WinRT.Runtime2/InteropServices/Platform/ComCallData.cs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +using System.Runtime.InteropServices; + namespace WindowsRuntime.InteropServices; /// +[StructLayout(LayoutKind.Sequential)] internal unsafe struct ComCallData { public uint dwDispid; diff --git a/src/WinRT.Runtime2/InteropServices/Platform/HSTRING_HEADER.cs b/src/WinRT.Runtime2/InteropServices/Platform/HSTRING_HEADER.cs index 6cf2421521..4a897829d5 100644 --- a/src/WinRT.Runtime2/InteropServices/Platform/HSTRING_HEADER.cs +++ b/src/WinRT.Runtime2/InteropServices/Platform/HSTRING_HEADER.cs @@ -6,12 +6,15 @@ #pragma warning disable IDE1006 +using System.Runtime.InteropServices; + namespace WindowsRuntime.InteropServices; /// /// Represents a header for an HSTRING. /// /// +[StructLayout(LayoutKind.Sequential)] internal struct HSTRING_HEADER { /// @@ -24,6 +27,7 @@ internal struct HSTRING_HEADER // To avoid producing multiple builds of the managed bindings, we use a 16 byte buffer and a native int instead, preserving the same layout. // Using this strategy, trying to match the native definition of this union would be too contrived. // Since the contents of this structure are undefined, it is not important to provide the same definitions. + [StructLayout(LayoutKind.Sequential)] public unsafe partial struct _Reserved_e__Union { internal fixed byte Reserved1_0[16]; diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionDllExports/TokenizerHelper.cs b/src/WinRT.Runtime2/InteropServices/ProjectionDllExports/TokenizerHelper.cs index 7b9e3a865b..92eb7948b1 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionDllExports/TokenizerHelper.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionDllExports/TokenizerHelper.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Globalization; namespace WindowsRuntime.InteropServices; @@ -10,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// /// Helper class for tokenizing used by generated projections. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class TokenizerHelper { /// @@ -35,4 +31,4 @@ public static char GetNumericListSeparator(IFormatProvider? provider) ? SemicolonSeparator : CommaSeparator; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IAgileObjectImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IAgileObjectImpl.cs index f8db6bff2c..8280044d65 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IAgileObjectImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IAgileObjectImpl.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; namespace WindowsRuntime.InteropServices; @@ -11,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// The IAgileObject implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class IAgileObjectImpl { /// @@ -26,4 +21,4 @@ public static nint Vtable [MethodImpl(MethodImplOptions.AggressiveInlining)] get => IUnknownImpl.Vtable; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IInspectableImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IInspectableImpl.cs index 27d6f3f97a..d52635c326 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IInspectableImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IInspectableImpl.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Windows.Foundation; @@ -15,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// The IInspectable implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IInspectableImpl { /// @@ -123,4 +119,4 @@ private static HRESULT GetTrustLevel(void* thisPtr, TrustLevel* trustLevel) return WellKnownErrorCodes.S_OK; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IMarshalImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IMarshalImpl.cs index be7ccae012..6e76109515 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IMarshalImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IMarshalImpl.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime.InteropServices.Marshalling; @@ -13,10 +12,7 @@ namespace WindowsRuntime.InteropServices; /// The IMarshal implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe partial class IMarshalImpl { /// @@ -171,4 +167,4 @@ private static HRESULT DisconnectObject(void* thisPtr, uint dwReserved) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(ex); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IPropertyValueImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IPropertyValueImpl.cs index 02c704fcc1..a8c298a131 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IPropertyValueImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IPropertyValueImpl.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - #pragma warning disable IDE0060, IDE1006 namespace WindowsRuntime.InteropServices; @@ -16,8 +13,5 @@ namespace WindowsRuntime.InteropServices; /// This type provides shared paths for some implementations, and then some specific full implementations. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] -public static partial class IPropertyValueImpl; \ No newline at end of file +[WindowsRuntimeImplementationOnlyMember] +public static partial class IPropertyValueImpl; diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IReferenceImpl.Int32Enum.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IReferenceImpl.Int32Enum.cs index 52be173fe0..7af337570a 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IReferenceImpl.Int32Enum.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IReferenceImpl.Int32Enum.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime.InteropServices.Marshalling; @@ -16,10 +15,7 @@ namespace WindowsRuntime.InteropServices; /// The IReference`1 implementation for managed types that can share an implementation. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe partial class IReferenceImpl { /// @@ -73,4 +69,4 @@ public static HRESULT get_Value(void* thisPtr, int* result) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IStringableImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IStringableImpl.cs index a8db72502b..207467dfcf 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IStringableImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IStringableImpl.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using WindowsRuntime.InteropServices.Marshalling; @@ -14,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// The IStringable implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStringableImpl { /// @@ -64,4 +60,4 @@ private static HRESULT ToString(void* thisPtr, HSTRING* value) return RestrictedErrorInfoExceptionMarshaller.ConvertToUnmanaged(e); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IUnknownImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IUnknownImpl.cs index 97fc2ddb15..6b999751c9 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IUnknownImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IUnknownImpl.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -14,10 +12,7 @@ namespace WindowsRuntime.InteropServices; /// The IUnknown implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IUnknownImpl { /// @@ -49,4 +44,4 @@ public static nint Vtable [MethodImpl(MethodImplOptions.AggressiveInlining)] get => (nint)Unsafe.AsPointer(in Vftbl); } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IWeakReferenceSourceImpl.cs b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IWeakReferenceSourceImpl.cs index 7c4204eb8b..746c7067c0 100644 --- a/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IWeakReferenceSourceImpl.cs +++ b/src/WinRT.Runtime2/InteropServices/ProjectionImpls/IWeakReferenceSourceImpl.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; @@ -14,10 +13,7 @@ namespace WindowsRuntime.InteropServices; /// The IWeakReferenceSource implementation for managed types. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IWeakReferenceSourceImpl { /// @@ -69,4 +65,4 @@ private static HRESULT GetWeakReference(void* thisPtr, void** weakReference) return e.HResult; } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/Streams/IStorageFolderHandleAccessMethods.cs b/src/WinRT.Runtime2/InteropServices/Streams/IStorageFolderHandleAccessMethods.cs index 61e8fadcc2..5f76fe2255 100644 --- a/src/WinRT.Runtime2/InteropServices/Streams/IStorageFolderHandleAccessMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Streams/IStorageFolderHandleAccessMethods.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.IO; using Microsoft.Win32.SafeHandles; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// Provides methods for interacting with the IStorageFolderHandleAccess COM interface. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStorageFolderHandleAccessMethods { /// diff --git a/src/WinRT.Runtime2/InteropServices/Streams/IStorageItemHandleAccessMethods.cs b/src/WinRT.Runtime2/InteropServices/Streams/IStorageItemHandleAccessMethods.cs index ac6b3d3332..37383d3159 100644 --- a/src/WinRT.Runtime2/InteropServices/Streams/IStorageItemHandleAccessMethods.cs +++ b/src/WinRT.Runtime2/InteropServices/Streams/IStorageItemHandleAccessMethods.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.IO; using Microsoft.Win32.SafeHandles; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// Provides methods for interacting with the IStorageItemHandleAccess COM interface. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class IStorageItemHandleAccessMethods { /// diff --git a/src/WinRT.Runtime2/InteropServices/Streams/WindowsRuntimeIOHelpers.cs b/src/WinRT.Runtime2/InteropServices/Streams/WindowsRuntimeIOHelpers.cs index 07368a74ae..084787b0c2 100644 --- a/src/WinRT.Runtime2/InteropServices/Streams/WindowsRuntimeIOHelpers.cs +++ b/src/WinRT.Runtime2/InteropServices/Streams/WindowsRuntimeIOHelpers.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Runtime.ExceptionServices; @@ -13,10 +12,7 @@ namespace Windows.Storage.Streams; /// /// Helpers for working with Windows Runtime I/O operations. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class WindowsRuntimeIOHelpers { /// diff --git a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs index d7ca2ace12..b3b03c6049 100644 --- a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs +++ b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs @@ -41,9 +41,13 @@ public static class AsyncInfo /// public static IAsyncAction Run(Func factory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(factory); return new TaskAdapter(factory); +#endif } /// @@ -75,9 +79,13 @@ public static IAsyncAction Run(Func factory) /// public static IAsyncActionWithProgress Run(Func, Task> factory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(factory); return new TaskWithProgressAdapter(factory); +#endif } /// @@ -99,9 +107,13 @@ public static IAsyncActionWithProgress Run(Func public static IAsyncOperation Run(Func> factory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(factory); return new TaskAdapter(factory); +#endif } /// @@ -139,9 +151,13 @@ public static IAsyncOperation Run(Func Run( Func, Task> factory) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(factory); return new TaskWithProgressAdapter(factory); +#endif } /// @@ -150,7 +166,11 @@ public static IAsyncOperationWithProgress RunThe resulting instance. public static IAsyncAction CompletedAction() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskAdapter(default(CompletedTaskPlaceholder)); +#endif } /// @@ -160,7 +180,11 @@ public static IAsyncAction CompletedAction() /// The resulting instance. public static IAsyncActionWithProgress CompletedActionWithProgress() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskWithProgressAdapter(default(CompletedTaskPlaceholder)); +#endif } /// @@ -171,7 +195,11 @@ public static IAsyncActionWithProgress CompletedActionWithProgressThe resulting instance. public static IAsyncOperation FromResult(TResult result) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskAdapter(result); +#endif } /// @@ -183,7 +211,11 @@ public static IAsyncOperation FromResult(TResult result) /// The resulting instance. public static IAsyncOperationWithProgress FromResultWithProgress(TResult result) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskWithProgressAdapter(result); +#endif } /// @@ -193,9 +225,13 @@ public static IAsyncOperationWithProgress FromResultWithProg /// The resulting instance. public static IAsyncAction FromException(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); return new TaskAdapter(exception); +#endif } /// @@ -206,9 +242,13 @@ public static IAsyncAction FromException(Exception exception) /// The resulting instance. public static IAsyncActionWithProgress FromExceptionWithProgress(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); return new TaskWithProgressAdapter(exception); +#endif } /// @@ -219,9 +259,13 @@ public static IAsyncActionWithProgress FromExceptionWithProgressThe resulting instance. public static IAsyncOperation FromException(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); return new TaskAdapter(exception); +#endif } /// @@ -233,9 +277,13 @@ public static IAsyncOperation FromException(Exception exceptio /// The resulting instance. public static IAsyncOperationWithProgress FromExceptionWithProgress(Exception exception) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(exception); return new TaskWithProgressAdapter(exception); +#endif } /// @@ -244,7 +292,11 @@ public static IAsyncOperationWithProgress FromExceptionWithP /// The resulting instance. public static IAsyncAction CanceledAction() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskAdapter(default(CanceledTaskPlaceholder)); +#endif } /// @@ -254,7 +306,11 @@ public static IAsyncAction CanceledAction() /// The resulting instance. public static IAsyncActionWithProgress CanceledActionWithProgress() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskWithProgressAdapter(default(CanceledTaskPlaceholder)); +#endif } /// @@ -264,7 +320,11 @@ public static IAsyncActionWithProgress CanceledActionWithProgressThe resulting instance. public static IAsyncOperation CanceledOperation() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskAdapter(default(CanceledTaskPlaceholder)); +#endif } /// @@ -275,6 +335,10 @@ public static IAsyncOperation CanceledOperation() /// The resulting instance. public static IAsyncOperationWithProgress CanceledOperationWithProgress() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return new TaskWithProgressAdapter(default(CanceledTaskPlaceholder)); +#endif } } \ No newline at end of file diff --git a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/WindowsRuntimeBuffer.cs b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/WindowsRuntimeBuffer.cs index 73194ebb12..eb3abcf31f 100644 --- a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/WindowsRuntimeBuffer.cs +++ b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/WindowsRuntimeBuffer.cs @@ -19,9 +19,13 @@ public static class WindowsRuntimeBuffer /// Thrown if is less than 0. public static IBuffer Create(int capacity) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentOutOfRangeException.ThrowIfNegative(capacity); return new WindowsRuntimePinnedArrayBuffer(capacity); +#endif } /// @@ -31,11 +35,15 @@ public static IBuffer Create(int capacity) /// The resulting instance (with and equal to the length of ). public static IBuffer Create(ReadOnlySpan data) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else byte[] pinnedData = GC.AllocateArray(data.Length, pinned: true); data.CopyTo(pinnedData); return new WindowsRuntimePinnedArrayBuffer(pinnedData, offset: 0, data.Length, data.Length); +#endif } /// @@ -49,6 +57,9 @@ public static IBuffer Create(ReadOnlySpan data) /// Thrown if is less than the length of . public static IBuffer Create(ReadOnlySpan data, int capacity) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentOutOfRangeException.ThrowIfNegative(capacity); //if (capacity < length) throw new ArgumentException(global::Windows.Foundation.SR.Argument_InsufficientBufferCapacity); @@ -57,6 +68,7 @@ public static IBuffer Create(ReadOnlySpan data, int capacity) data.CopyTo(pinnedData); return new WindowsRuntimePinnedArrayBuffer(pinnedData, offset: 0, data.Length, capacity); +#endif } /// @@ -73,6 +85,9 @@ public static IBuffer Create(ReadOnlySpan data, int capacity) /// Thrown if the specified range is not valid, or if is less than the specified range. public static IBuffer Create(byte[] data, int offset, int length, int capacity) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(data); ArgumentOutOfRangeException.ThrowIfNegative(offset); ArgumentOutOfRangeException.ThrowIfNegative(length); @@ -91,5 +106,6 @@ public static IBuffer Create(byte[] data, int offset, int length, int capacity) length: length); return new WindowsRuntimePinnedArrayBuffer(pinnedData, offset: 0, length, capacity); +#endif } } diff --git a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/DynamicInterfaceCastableImplementationTypeMapGroup.cs b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/DynamicInterfaceCastableImplementationTypeMapGroup.cs index 81ce3f8650..dfddd5369b 100644 --- a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/DynamicInterfaceCastableImplementationTypeMapGroup.cs +++ b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/DynamicInterfaceCastableImplementationTypeMapGroup.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -13,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// This type is only meant to be used as type map group for APIs. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class DynamicInterfaceCastableImplementationTypeMapGroup { /// @@ -25,4 +19,4 @@ public abstract class DynamicInterfaceCastableImplementationTypeMapGroup private DynamicInterfaceCastableImplementationTypeMapGroup() { } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeComWrappersTypeMapGroup.cs b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeComWrappersTypeMapGroup.cs index 3d14def610..b124e507a5 100644 --- a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeComWrappersTypeMapGroup.cs +++ b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeComWrappersTypeMapGroup.cs @@ -1,9 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; - namespace WindowsRuntime.InteropServices; /// @@ -12,10 +9,7 @@ namespace WindowsRuntime.InteropServices; /// /// This type is only meant to be used as type map group for APIs. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeComWrappersTypeMapGroup { /// @@ -24,4 +18,4 @@ public abstract class WindowsRuntimeComWrappersTypeMapGroup private WindowsRuntimeComWrappersTypeMapGroup() { } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeMetadataTypeMapGroup.cs b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeMetadataTypeMapGroup.cs index 59b512bf8c..31b2121757 100644 --- a/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeMetadataTypeMapGroup.cs +++ b/src/WinRT.Runtime2/InteropServices/TypeMapGroups/WindowsRuntimeMetadataTypeMapGroup.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; namespace WindowsRuntime.InteropServices; @@ -12,10 +11,7 @@ namespace WindowsRuntime.InteropServices; /// /// This type is only meant to be used as type map group for APIs. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeMetadataTypeMapGroup { /// @@ -24,4 +20,4 @@ public abstract class WindowsRuntimeMetadataTypeMapGroup private WindowsRuntimeMetadataTypeMapGroup() { } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.g.cs b/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.g.cs index 2ca6a8e856..55728c1ef9 100644 --- a/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.g.cs +++ b/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.g.cs @@ -10,10 +10,7 @@ namespace WindowsRuntime.InteropServices; /// /// IIDs for well known projected WinRT interfaces. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class WellKnownInterfaceIIDs { /// The IID for IUnknown. diff --git a/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.tt b/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.tt index 6ddf0ca640..0603f3f2db 100644 --- a/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.tt +++ b/src/WinRT.Runtime2/InteropServices/WellKnownInterfaceIIDs.tt @@ -14,10 +14,7 @@ namespace WindowsRuntime.InteropServices; /// /// IIDs for well known projected WinRT interfaces. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static class WellKnownInterfaceIIDs { <# diff --git a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeBufferMarshal.cs b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeBufferMarshal.cs index ff0756aa54..d3a2c040cb 100644 --- a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeBufferMarshal.cs +++ b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeBufferMarshal.cs @@ -27,6 +27,9 @@ public static partial class WindowsRuntimeBufferMarshal /// public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IBuffer? buffer, out byte* data) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else if (buffer is null) { goto Failure; @@ -49,6 +52,7 @@ public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IBuffer? buffer, data = null; return false; +#endif } /// @@ -66,6 +70,9 @@ public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IBuffer? buffer, /// public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IMemoryBufferReference? buffer, out byte* data, out uint capacity) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else if (buffer is null) { goto Failure; @@ -92,6 +99,7 @@ public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IMemoryBufferRefe capacity = 0; return false; +#endif } /// @@ -102,6 +110,9 @@ public static unsafe bool TryGetDataUnsafe([NotNullWhen(true)] IMemoryBufferRefe /// Whether was successfully retrieved. public static bool TryGetArray([NotNullWhen(true)] IBuffer? buffer, out ArraySegment array) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else if (buffer is null) { goto Failure; @@ -127,5 +138,6 @@ public static bool TryGetArray([NotNullWhen(true)] IBuffer? buffer, out ArraySeg array = default; return false; +#endif } } diff --git a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappers.cs b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappers.cs index 087229d386..ea0cfbdba9 100644 --- a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappers.cs +++ b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappers.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE + using System; using System.Collections; using System.Diagnostics; diff --git a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappersMarshal.cs b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappersMarshal.cs index 0308eacd46..7f8f448bd6 100644 --- a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappersMarshal.cs +++ b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeComWrappersMarshal.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -20,10 +19,7 @@ namespace WindowsRuntime.InteropServices; /// the code will throw . It is the caller's responsibility /// to validate inputs before calling any method in this class. /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public static unsafe class WindowsRuntimeComWrappersMarshal { /// @@ -249,4 +245,4 @@ public static WindowsRuntimeObjectReference UnwrapObjectReferenceUnsafe(WindowsR { return value.NativeObjectReference; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeMarshal.cs b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeMarshal.cs index 192490fb4f..2b8bbce886 100644 --- a/src/WinRT.Runtime2/InteropServices/WindowsRuntimeMarshal.cs +++ b/src/WinRT.Runtime2/InteropServices/WindowsRuntimeMarshal.cs @@ -22,6 +22,9 @@ public static unsafe class WindowsRuntimeMarshal /// Whether and are the same object or wrap the same underlying native object. public static bool NativeReferenceEquals(object? left, object? right) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else if (ReferenceEquals(left, right)) { return true; @@ -44,6 +47,7 @@ public static bool NativeReferenceEquals(object? left, object? right) } return false; +#endif } /// @@ -55,6 +59,9 @@ public static bool NativeReferenceEquals(object? left, object? right) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsReferenceToManagedObject(void* externalComObject) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(externalComObject); return WindowsRuntimeComWrappersMarshal.IsReferenceToManagedObjectUnsafe(externalComObject); @@ -89,6 +96,9 @@ public static bool TryGetManagedObject(void* externalComObject, [NotNullWhen(tru /// Whether was a reference to a native object, and could be retrieved. public static bool TryGetNativeObject([NotNullWhen(true)] object? managedObject, out void* result) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // If the input object is wrapping a native object, we can unwrap it and return it after incrementing its reference count if (WindowsRuntimeComWrappersMarshal.TryUnwrapObjectReference(managedObject, out WindowsRuntimeObjectReference? objectReference)) { @@ -100,6 +110,7 @@ public static bool TryGetNativeObject([NotNullWhen(true)] object? managedObject, result = null; return false; +#endif } /// @@ -120,7 +131,11 @@ public static bool TryGetNativeObject([NotNullWhen(true)] object? managedObject, /// public static void* ConvertToUnmanaged(object? managedObject) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeUnknownMarshaller.ConvertToUnmanaged(managedObject).DetachThisPtrUnsafe(); +#endif } /// @@ -132,7 +147,11 @@ public static bool TryGetNativeObject([NotNullWhen(true)] object? managedObject, /// public static object? ConvertToManaged(void* value) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeObjectMarshaller.ConvertToManaged(value); +#endif } /// @@ -146,6 +165,10 @@ public static bool TryGetNativeObject([NotNullWhen(true)] object? managedObject, /// public static void Free(void* value) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else WindowsRuntimeUnknownMarshaller.Free(value); +#endif } } \ No newline at end of file diff --git a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncAction.cs b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncAction.cs index b6720c55fb..2390c3a901 100644 --- a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncAction.cs +++ b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncAction.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation; @@ -53,10 +52,7 @@ WindowsRuntimeObjectReference InitializeIAsyncInfoObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; public AsyncActionCompletedHandler? Completed @@ -105,12 +101,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInter } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncActionWithProgress{TProgress}.cs b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncActionWithProgress{TProgress}.cs index 7f192a9749..8e3a2946e9 100644 --- a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncActionWithProgress{TProgress}.cs +++ b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncActionWithProgress{TProgress}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using ABI.Windows.Foundation; @@ -18,10 +17,7 @@ namespace WindowsRuntime; /// The implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeAsyncActionWithProgress : WindowsRuntimeObject, IAsyncActionWithProgress, IWindowsRuntimeInterface>, @@ -59,10 +55,7 @@ WindowsRuntimeObjectReference InitializeIAsyncInfoObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -119,12 +112,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInter } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperationWithProgress{TResult, TProgress}.cs b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperationWithProgress{TResult, TProgress}.cs index a248639770..9165191dff 100644 --- a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperationWithProgress{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperationWithProgress{TResult, TProgress}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using ABI.Windows.Foundation; @@ -19,10 +18,7 @@ namespace WindowsRuntime; /// The implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeAsyncOperationWithProgress : WindowsRuntimeObject, IAsyncOperationWithProgress, IWindowsRuntimeInterface>, @@ -60,10 +56,7 @@ WindowsRuntimeObjectReference InitializeIAsyncInfoObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -120,12 +113,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInter } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperation{TResult}.cs b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperation{TResult}.cs index 86bdd28dc4..398841bb70 100644 --- a/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperation{TResult}.cs +++ b/src/WinRT.Runtime2/NativeObjects/AsyncInfo/WindowsRuntimeAsyncOperation{TResult}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using ABI.Windows.Foundation; @@ -18,10 +17,7 @@ namespace WindowsRuntime; /// The implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeAsyncOperation : WindowsRuntimeObject, IAsyncOperation, IWindowsRuntimeInterface>, @@ -59,10 +55,7 @@ WindowsRuntimeObjectReference InitializeIAsyncInfoObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -112,12 +105,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInter } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerable.cs b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerable.cs index 487915e3d2..f525dd873d 100644 --- a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerable.cs +++ b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerable.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using WindowsRuntime.InteropServices; namespace WindowsRuntime; @@ -26,10 +25,7 @@ public WindowsRuntimeEnumerable(WindowsRuntimeObjectReference nativeObjectRefere } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -45,12 +41,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerator.cs b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerator.cs index dff273efc5..7ef06855c0 100644 --- a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerator.cs +++ b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeEnumerator.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using WindowsRuntime.InteropServices; @@ -39,10 +38,7 @@ public WindowsRuntimeEnumerator(WindowsRuntimeObjectReference nativeObjectRefere } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -113,12 +109,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeList.cs b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeList.cs index 66a402a897..3b06177474 100644 --- a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeList.cs +++ b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeList.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using WindowsRuntime.InteropServices; @@ -53,10 +52,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -148,12 +144,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeReadOnlyList.cs b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeReadOnlyList.cs index b8278220c0..5034c07809 100644 --- a/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeReadOnlyList.cs +++ b/src/WinRT.Runtime2/NativeObjects/Bindables/WindowsRuntimeReadOnlyList.cs @@ -3,7 +3,6 @@ using System; using System.Collections; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using WindowsRuntime.InteropServices; @@ -57,10 +56,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -76,12 +72,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryKeyCollection{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryKeyCollection{TKey, TValue}.cs index 41e3c32a57..d1d18a8de6 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryKeyCollection{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryKeyCollection{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime; @@ -13,10 +12,7 @@ namespace WindowsRuntime; /// /// The type of keys in the dictionary. /// The type of values in the dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class DictionaryKeyCollection : ICollection { /// @@ -108,10 +104,7 @@ IEnumerator IEnumerable.GetEnumerator() /// /// The implementation for . /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public sealed class Enumerator : IEnumerator { /// @@ -158,4 +151,4 @@ public void Dispose() _enumerator.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryValueCollection{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryValueCollection{TKey, TValue}.cs index b382430ed2..ca42a4fc6a 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryValueCollection{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/DictionaryValueCollection{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime; @@ -13,10 +12,7 @@ namespace WindowsRuntime; /// /// The type of keys in the dictionary. /// The type of values in the dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class DictionaryValueCollection : ICollection { /// @@ -117,10 +113,7 @@ IEnumerator IEnumerable.GetEnumerator() /// /// The implementation for . /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public sealed class Enumerator : IEnumerator { /// @@ -167,4 +160,4 @@ public void Dispose() _enumerator.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryKeyCollection{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryKeyCollection{TKey, TValue}.cs index 7b9ef3047a..b3a2c08ff6 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryKeyCollection{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryKeyCollection{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime; @@ -13,10 +12,7 @@ namespace WindowsRuntime; /// /// The type of keys in the read-only dictionary. /// The type of values in the read-only dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class ReadOnlyDictionaryKeyCollection : IEnumerable { /// @@ -51,10 +47,7 @@ IEnumerator IEnumerable.GetEnumerator() /// /// The implementation for . /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public sealed class Enumerator : IEnumerator { /// @@ -101,4 +94,4 @@ public void Dispose() _enumerator.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryValueCollection{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryValueCollection{TKey, TValue}.cs index 00ed96700f..adc6b5fae9 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryValueCollection{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/ReadOnlyDictionaryValueCollection{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; namespace WindowsRuntime; @@ -13,10 +12,7 @@ namespace WindowsRuntime; /// /// The type of keys in the read-only dictionary. /// The type of values in the read-only dictionary. -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public sealed class ReadOnlyDictionaryValueCollection : IEnumerable { /// @@ -51,10 +47,7 @@ IEnumerator IEnumerable.GetEnumerator() /// /// The implementation for . /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public sealed class Enumerator : IEnumerator { /// @@ -101,4 +94,4 @@ public void Dispose() _enumerator.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeDictionary{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeDictionary{TKey, TValue}.cs index ebe4b6f5d6..6e3b584176 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeDictionary{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeDictionary{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Threading; @@ -22,10 +21,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IMap<K, V> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeDictionary< TKey, TValue, @@ -83,10 +79,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -205,12 +198,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerable{T}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerable{T}.cs index bc7d477c2f..a2c08d899e 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerable{T}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerable{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using WindowsRuntime.InteropServices; #pragma warning disable CA1816 @@ -18,10 +17,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IIterable<T> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeEnumerable : WindowsRuntimeObject, IEnumerable, IWindowsRuntimeInterface> where TIIterableMethods : IIterableMethodsImpl { @@ -36,10 +32,7 @@ protected WindowsRuntimeEnumerable(WindowsRuntimeObjectReference nativeObjectRef } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -61,12 +54,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface>.GetI } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerator{T}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerator{T}.cs index dca11f3180..52da2cb0f8 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerator{T}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeEnumerator{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using WindowsRuntime.InteropServices; @@ -19,10 +18,7 @@ namespace WindowsRuntime; /// The implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeEnumerator : WindowsRuntimeObject, IEnumerator, IWindowsRuntimeInterface> where TIIteratorMethods : IIteratorMethodsImpl { @@ -47,10 +43,7 @@ protected WindowsRuntimeEnumerator(WindowsRuntimeObjectReference nativeObjectRef } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -142,12 +135,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface>.GetI } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeList{T}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeList{T}.cs index e77e03308a..fa7982393c 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeList{T}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeList{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using WindowsRuntime.InteropServices; @@ -22,10 +21,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IVector<T> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeList< T, TIIterable, @@ -70,10 +66,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -162,12 +155,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface>.GetI } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeMapChangedEventArgs{TKey}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeMapChangedEventArgs{TKey}.cs index fa97363bdb..f7a5e4c87b 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeMapChangedEventArgs{TKey}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeMapChangedEventArgs{TKey}.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using Windows.Foundation.Collections; using WindowsRuntime.InteropServices; @@ -15,10 +14,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IMapChangedEventArgs<K> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeMapChangedEventArgs : WindowsRuntimeObject, IMapChangedEventArgs, IWindowsRuntimeInterface> @@ -35,10 +31,7 @@ protected WindowsRuntimeMapChangedEventArgs(WindowsRuntimeObjectReference native } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -54,12 +47,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableMap{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableMap{TKey, TValue}.cs index a2b13bd635..710dad9b0e 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableMap{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableMap{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Threading; @@ -27,10 +26,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IObservableMap<K, V> factory type for event source objects. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeObservableMap< TKey, TValue, @@ -139,10 +135,7 @@ public event MapChangedEventHandler? MapChanged } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -267,12 +260,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableVector{T}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableVector{T}.cs index 40f4f76aad..05f9c31d7c 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableVector{T}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeObservableVector{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation.Collections; @@ -25,10 +24,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IObservableVector<T> factory type for event source objects. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeObservableVector< T, TIIterable, @@ -130,10 +126,7 @@ public event VectorChangedEventHandler? VectorChanged } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -228,12 +221,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface>.GetI } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyDictionary{TKey, TValue}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyDictionary{TKey, TValue}.cs index 6785c57edd..8ab484e01e 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyDictionary{TKey, TValue}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyDictionary{TKey, TValue}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Threading; @@ -22,10 +21,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IMapView<K, V> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeReadOnlyDictionary< TKey, TValue, @@ -82,10 +78,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -143,12 +136,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyList{T}.cs b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyList{T}.cs index 65abb113df..c9313be2ad 100644 --- a/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyList{T}.cs +++ b/src/WinRT.Runtime2/NativeObjects/Collections/WindowsRuntimeReadOnlyList{T}.cs @@ -4,7 +4,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using WindowsRuntime.InteropServices; @@ -20,10 +19,7 @@ namespace WindowsRuntime; /// The Windows.Foundation.Collections.IVectorView<T> implementation type. /// [WindowsRuntimeManagedOnlyType] -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public abstract class WindowsRuntimeReadOnlyList< T, TIIterable, @@ -69,10 +65,7 @@ WindowsRuntimeObjectReference InitializeIIterableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal sealed override bool HasUnwrappableNativeObjectReference => true; /// @@ -106,12 +99,9 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface>.GetI } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected sealed override bool IsOverridableInterface(in Guid iid) { return false; } -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/NativeObjects/Foundation/WindowsRuntimeMemoryBufferReference.cs b/src/WinRT.Runtime2/NativeObjects/Foundation/WindowsRuntimeMemoryBufferReference.cs index 62a2ecb4dd..417aaae08b 100644 --- a/src/WinRT.Runtime2/NativeObjects/Foundation/WindowsRuntimeMemoryBufferReference.cs +++ b/src/WinRT.Runtime2/NativeObjects/Foundation/WindowsRuntimeMemoryBufferReference.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation; @@ -60,10 +59,7 @@ WindowsRuntimeObjectReference InitializeIClosableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -88,10 +84,7 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; diff --git a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeBuffer.cs b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeBuffer.cs index 2f94efde9f..2b959ace6a 100644 --- a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeBuffer.cs +++ b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeBuffer.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using Windows.Storage.Streams; using WindowsRuntime.InteropServices; @@ -26,10 +25,7 @@ public WindowsRuntimeBuffer(WindowsRuntimeObjectReference nativeObjectReference) } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -49,10 +45,7 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInterfac } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; diff --git a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeInputStream.cs b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeInputStream.cs index c3de4a7ae7..1c76cd2225 100644 --- a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeInputStream.cs +++ b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeInputStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation; @@ -54,10 +53,7 @@ WindowsRuntimeObjectReference InitializeIClosableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -85,10 +81,7 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; diff --git a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeOutputStream.cs b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeOutputStream.cs index 26d28c990a..ce5eb4dcb0 100644 --- a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeOutputStream.cs +++ b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeOutputStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation; @@ -52,10 +51,7 @@ WindowsRuntimeObjectReference InitializeIClosableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -89,10 +85,7 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; diff --git a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeRandomAccessStream.cs b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeRandomAccessStream.cs index fe50449890..a71efb0052 100644 --- a/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeRandomAccessStream.cs +++ b/src/WinRT.Runtime2/NativeObjects/Streams/WindowsRuntimeRandomAccessStream.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading; using Windows.Foundation; @@ -98,10 +97,7 @@ WindowsRuntimeObjectReference InitializeIClosableObjectReference() } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// @@ -193,10 +189,7 @@ WindowsRuntimeObjectReferenceValue IWindowsRuntimeInterface.GetInte } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected override bool IsOverridableInterface(in Guid iid) { return false; diff --git a/src/WinRT.Runtime2/Properties/WindowsRuntimeConstants.cs b/src/WinRT.Runtime2/Properties/WindowsRuntimeConstants.cs deleted file mode 100644 index e871e10332..0000000000 --- a/src/WinRT.Runtime2/Properties/WindowsRuntimeConstants.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -namespace WindowsRuntime; - -/// -/// A type containing constants for various scenarios related to Windows Runtime functionality and projections. -/// -internal static class WindowsRuntimeConstants -{ - /// - /// A message for private implementation detail types. - /// - public const string PrivateImplementationDetailObsoleteMessage = - "This type or method is a private implementation detail, and it's only meant to be consumed by generated projections (produced by 'cswinrt.exe') " + - "and by generated interop code (produced by 'cswinrtinteropgen.exe'). Private implementation detail types are not considered part of the versioned " + - "API surface, and they are ignored when determining the assembly version following semantic versioning. Types might be modified or removed " + - "across any version change for 'WinRT.Runtime.dll', and using them in user code is undefined behavior and not supported."; - - /// - /// The diagnostic id for private implementation detail types. - /// - public const string PrivateImplementationDetailObsoleteDiagnosticId = "CSWINRT3001"; - - /// - /// The URL format for all custom diagnostics for CsWinRT. - /// - /// - /// This URL format assumes it will receive the diagnostic id as a parameter. - /// - public const string CsWinRTDiagnosticsUrlFormat = "https://aka.ms/cswinrt/errors/{0}"; -} \ No newline at end of file diff --git a/src/WinRT.Runtime2/Properties/WindowsRuntimeExceptionExtensions.cs b/src/WinRT.Runtime2/Properties/WindowsRuntimeExceptionExtensions.cs index 06a163f49d..d6411adc58 100644 --- a/src/WinRT.Runtime2/Properties/WindowsRuntimeExceptionExtensions.cs +++ b/src/WinRT.Runtime2/Properties/WindowsRuntimeExceptionExtensions.cs @@ -1481,19 +1481,4 @@ public static ArgumentNullException GetIOCompletionCallbackCannotProcessNullAsyn return new(paramName, WindowsRuntimeExceptionMessages.ArgumentNullReference_IOCompletionCallbackCannotProcessNullAsyncInfo); } } - - extension(UnreachableException) - { - /// - /// Throws an . - /// - /// This method never returns. - /// Always thrown. - [DoesNotReturn] - [StackTraceHidden] - public static bool Throw() - { - throw new UnreachableException(); - } - } } diff --git a/src/WinRT.Runtime2/Properties/WindowsRuntimeFeatureSwitches.cs b/src/WinRT.Runtime2/Properties/WindowsRuntimeFeatureSwitches.cs index 99d5d20c94..7d9d247c6e 100644 --- a/src/WinRT.Runtime2/Properties/WindowsRuntimeFeatureSwitches.cs +++ b/src/WinRT.Runtime2/Properties/WindowsRuntimeFeatureSwitches.cs @@ -4,6 +4,8 @@ using System; using System.Diagnostics.CodeAnalysis; +#pragma warning disable CS1574 + namespace WindowsRuntime; /// diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 2b734d5c1d..3a9d32d392 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -74,20 +74,95 @@ --> true - - $(NoWarn);AD0001 - - - $(NoWarn);CSWINRT3001 - true key.snk + + + + false + + + $(DefineConstants);WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY + + + + + $(DefineConstants);WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + + + $(NoWarn);CS8597;IDE0005;IDE0380 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +