From abe3808e0a6e22ec2e64c556dedba95d7296faa3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:04:56 -0700 Subject: [PATCH 01/28] Add WindowsRuntimeImplementationOnlyMemberAttribute Introduce an internal sealed attribute to mark implementation-only members for WinRT runtime. The attribute targets all members, is non-inherited, and is conditional on WINDOWS_RUNTIME_REFERENCE_ASSEMBLY so it is emitted only in reference assemblies; this makes it explicit which members are implementation-only and allows them to be stripped from the runtime DLL. Added at src/WinRT.Runtime2/Attributes/WindowsRuntimeImplementationOnlyMemberAttribute.cs. --- ...untimeImplementationOnlyMemberAttribute.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/WinRT.Runtime2/Attributes/WindowsRuntimeImplementationOnlyMemberAttribute.cs 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 From f29f9a72b29536cdb969174f4d3a5d840d58b2f9 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:09:12 -0700 Subject: [PATCH 02/28] Use [WindowsRuntimeImplementationOnlyMember] for implementation-only members Replace the combination of [EditorBrowsable(Never)] and [Obsolete(...)] with the single [WindowsRuntimeImplementationOnlyMember] attribute on implementation-only members across WinRT.Runtime. Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- src/WinRT.Runtime2/ABI/System/Boolean.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Byte.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Char.cs | 8 +-- .../ABI/System/Collections/IEnumerable.cs | 21 ++------ .../ABI/System/Collections/IEnumerator.cs | 23 ++------ .../ABI/System/Collections/IList.cs | 23 ++------ .../ABI/System/Collections/IReadOnlyList.cs | 9 +--- .../Specialized/INotifyCollectionChanged.cs | 18 ++----- .../NotifyCollectionChangedAction.cs | 13 ++--- .../NotifyCollectionChangedEventArgs.cs | 13 ++--- .../NotifyCollectionChangedEventHandler.cs | 13 ++--- ...ollectionChangedEventHandlerEventSource.cs | 9 +--- .../DataErrorsChangedEventArgs.cs | 8 +-- .../ComponentModel/INotifyDataErrorInfo.cs | 15 ++---- .../ComponentModel/INotifyPropertyChanged.cs | 15 ++---- .../PropertyChangedEventArgs.cs | 13 ++--- .../PropertyChangedEventHandler.cs | 10 +--- .../PropertyChangedEventHandlerEventSource.cs | 8 +-- .../ABI/System/DateTimeOffset.cs | 13 ++--- src/WinRT.Runtime2/ABI/System/Double.cs | 8 +-- src/WinRT.Runtime2/ABI/System/EventHandler.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Exception.cs | 13 ++--- src/WinRT.Runtime2/ABI/System/Guid.cs | 8 +-- src/WinRT.Runtime2/ABI/System/IDisposable.cs | 18 ++----- .../ABI/System/IServiceProvider.cs | 18 ++----- src/WinRT.Runtime2/ABI/System/Int16.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Int32.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Int64.cs | 8 +-- .../ABI/System/Numerics/Matrix3x2.cs | 8 +-- .../ABI/System/Numerics/Matrix4x4.cs | 8 +-- .../ABI/System/Numerics/Plane.cs | 8 +-- .../ABI/System/Numerics/Quaternion.cs | 8 +-- .../ABI/System/Numerics/Vector2.cs | 8 +-- .../ABI/System/Numerics/Vector3.cs | 8 +-- .../ABI/System/Numerics/Vector4.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Single.cs | 8 +-- src/WinRT.Runtime2/ABI/System/String.cs | 8 +-- src/WinRT.Runtime2/ABI/System/TimeSpan.cs | 13 ++--- src/WinRT.Runtime2/ABI/System/Type.cs | 13 ++--- src/WinRT.Runtime2/ABI/System/UInt16.cs | 8 +-- src/WinRT.Runtime2/ABI/System/UInt32.cs | 8 +-- src/WinRT.Runtime2/ABI/System/UInt64.cs | 8 +-- src/WinRT.Runtime2/ABI/System/Uri.cs | 8 +-- .../ABI/System/Windows.Input/ICommand.cs | 18 ++----- .../AsyncActionCompletedHandler.cs | 8 +-- .../ABI/Windows.Foundation/AsyncStatus.cs | 8 +-- .../Collections/CollectionChange.cs | 8 +-- .../Collections/IVectorChangedEventArgs.cs | 18 ++----- ...MapChangedEventHandlerEventSource{K, V}.cs | 9 +--- ...VectorChangedEventHandlerEventSource{T}.cs | 9 +--- .../ABI/Windows.Foundation/IAsyncAction.cs | 18 ++----- .../ABI/Windows.Foundation/IAsyncInfo.cs | 18 ++----- .../IMemoryBufferReference.cs | 18 ++----- .../ABI/Windows.Foundation/IStringable.cs | 28 +++------- .../ABI/Windows.Foundation/Point.cs | 8 +-- .../ABI/Windows.Foundation/PropertyType.cs | 8 +-- .../ABI/Windows.Foundation/Rect.cs | 8 +-- .../ABI/Windows.Foundation/Size.cs | 8 +-- .../ABI/Windows.Storage.Streams/IBuffer.cs | 18 ++----- .../Windows.Storage.Streams/IInputStream.cs | 18 ++----- .../Windows.Storage.Streams/IOutputStream.cs | 18 ++----- .../IRandomAccessStream.cs | 18 ++----- .../InputStreamOptions.cs | 8 +-- .../Bindables/BindableIReadOnlyListAdapter.cs | 8 +-- .../EventRegistrationToken.cs | 8 +-- ...WindowsRuntimeDefaultInterfaceAttribute.cs | 8 +-- ...owsRuntimeExclusiveToInterfaceAttribute.cs | 8 +-- .../WindowsRuntimeMappedMetadataAttribute.cs | 8 +-- .../WindowsRuntimeMetadataAttribute.cs | 8 +-- ...WindowsRuntimeMetadataTypeNameAttribute.cs | 8 +-- .../WindowsRuntimeReferenceTypeAttribute.cs | 8 +-- .../WindowsRuntimeActivationArgsReference.cs | 6 +-- ...WindowsRuntimeActivationFactoryCallback.cs | 20 ++----- .../WindowsRuntimeActivationTypes.cs | 20 ++----- .../IAsyncActionWithProgressMethods.cs | 9 +--- ...ctionWithProgressMethodsImpl{TProgress}.cs | 9 +--- .../IAsyncOperationMethodsImpl{TResult}.cs | 9 +--- ...ProgressMethodsImpl{TResult, TProgress}.cs | 9 +--- ...amicInterfaceCastableForwarderAttribute.cs | 8 +-- ...indowsRuntimeActivationFactoryAttribute.cs | 8 +-- ...wsRuntimeComWrappersMarshallerAttribute.cs | 8 +-- ...indowsRuntimeComponentAssemblyAttribute.cs | 8 +-- ...meComponentAssemblyExportsTypeAttribute.cs | 8 +-- .../WindowsRuntimeMappedTypeAttribute.cs | 8 +-- ...indowsRuntimeReferenceAssemblyAttribute.cs | 8 +-- .../Bindables/BindableIReadOnlyListAdapter.cs | 8 +-- ...IWindowsRuntimeArrayComWrappersCallback.cs | 8 +-- ...WindowsRuntimeObjectComWrappersCallback.cs | 9 +--- ...untimeUnsealedObjectComWrappersCallback.cs | 8 +-- .../IDictionaryAdapterExtensions.cs | 8 +-- .../IDictionaryAdapter{TKey, TValue}.cs | 9 +--- .../Collections/IDictionaryMethods.cs | 10 +--- .../IDictionaryMethods{TKey, TValue}.cs | 8 +-- .../Collections/IEnumerableAdapter{T}.cs | 8 +-- .../Collections/IEnumerableMethods{T}.cs | 9 +--- .../IEnumeratorAdapterExtensions.cs | 38 +++---------- .../Collections/IEnumeratorAdapter{T}.cs | 8 +-- .../Collections/IIterableMethodsImpl{T}.cs | 9 +--- .../Collections/IIteratorMethods.cs | 9 +--- .../Collections/IIteratorMethodsImpl{T}.cs | 10 +--- .../Collections/IListAdapterExtensions.cs | 38 +++---------- .../Collections/IListAdapter{T}.cs | 8 +-- .../Collections/IListMethods.cs | 8 +-- .../Collections/IListMethods{T}.cs | 8 +-- .../IMapChangedEventArgsMethods.cs | 9 +--- .../IMapChangedEventArgsMethodsImpl{K}.cs | 10 +--- .../Collections/IMapMethods.cs | 9 +--- .../Collections/IMapMethodsImpl{K, V}.cs | 10 +--- .../Collections/IMapViewMethods.cs | 10 +--- .../Collections/IMapViewMethodsImpl{K, V}.cs | 10 +--- ...ableMapEventSourceFactory{TKey, TValue}.cs | 10 +--- .../IObservableVectorEventSourceFactory{T}.cs | 10 +--- .../IReadOnlyDictionaryAdapterExtensions.cs | 8 +-- ...ReadOnlyDictionaryAdapter{TKey, TValue}.cs | 9 +--- .../Collections/IReadOnlyDictionaryMethods.cs | 10 +--- ...ReadOnlyDictionaryMethods{TKey, TValue}.cs | 8 +-- ...nlyDictionarySplitAdapter{TKey, TValue}.cs | 8 +-- .../IReadOnlyListAdapterExtensions.cs | 38 +++---------- .../Collections/IReadOnlyListAdapter{T}.cs | 8 +-- .../Collections/IReadOnlyListMethods.cs | 8 +-- .../Collections/IReadOnlyListMethods{T}.cs | 8 +-- .../Collections/IVectorMethods.cs | 9 +--- .../Collections/IVectorMethodsImpl{T}.cs | 10 +--- .../Collections/IVectorViewMethods.cs | 9 +--- .../Collections/IVectorViewMethodsImpl{T}.cs | 10 +--- .../DispatcherQueueSynchronizationContext.cs | 8 +-- .../Events/EventHandlerEventSource.cs | 8 +-- .../EventHandlerEventSource{TEventArgs}.cs | 8 +-- ...tHandlerEventSource{TSender,TEventArgs}.cs | 8 +-- .../Events/EventRegistrationTokenTable{T}.cs | 8 +-- .../Events/EventSourceState{T}.cs | 8 +-- .../InteropServices/Events/EventSource{T}.cs | 8 +-- .../Exceptions/RestrictedErrorInfo.cs | 6 +-- .../IWindowsRuntimeInterface.cs | 8 +-- .../IWindowsRuntimeInterface{T}.cs | 10 +--- ...PairTypeElementMarshaller{TKey, TValue}.cs | 7 +-- ...agedValueTypeElementMarshaller{T, TAbi}.cs | 8 +-- ...RuntimeNullableTypeElementMarshaller{T}.cs | 6 +-- ...untimeReferenceTypeElementMarshaller{T}.cs | 8 +-- ...agedValueTypeElementMarshaller{T, TAbi}.cs | 8 +-- .../Marshalling/HStringHeader.cs | 10 +--- .../Marshalling/HStringMarshaller.cs | 8 +-- .../Marshalling/HStringReference.cs | 10 +--- .../SzArrays/ExceptionArrayMarshaller.cs | 8 +-- .../SzArrays/HStringArrayMarshaller.cs | 8 +-- ...ypeArrayElementMarshaller{TKey, TValue}.cs | 7 +-- ...alueTypeArrayElementMarshaller{T, TAbi}.cs | 8 +-- ...meNullableTypeArrayElementMarshaller{T}.cs | 6 +-- ...eReferenceTypeArrayElementMarshaller{T}.cs | 8 +-- ...alueTypeArrayElementMarshaller{T, TAbi}.cs | 8 +-- .../SzArrays/TypeArrayMarshaller.cs | 8 +-- ...untimeBlittableValueTypeArrayMarshaller.cs | 8 +-- ...imeBlittableValueTypeArrayMarshaller{T}.cs | 8 +-- ...uePairTypeArrayMarshaller{TKey, TValue}.cs | 8 +-- ...anagedValueTypeArrayMarshaller{T, TAbi}.cs | 8 +-- ...wsRuntimeNullableTypeArrayMarshaller{T}.cs | 6 +-- .../WindowsRuntimeObjectArrayMarshaller.cs | 8 +-- ...sRuntimeReferenceTypeArrayMarshaller{T}.cs | 8 +-- .../WindowsRuntimeUnknownArrayMarshaller.cs | 8 +-- ...anagedValueTypeArrayMarshaller{T, TAbi}.cs | 8 +-- .../Marshalling/TypeReference.cs | 8 +-- .../WindowsRuntimeArrayMarshaller.cs | 8 +-- .../WindowsRuntimeDelegateMarshaller.cs | 8 +-- .../WindowsRuntimeInterfaceMarshaller{T}.cs | 8 +-- ...indowsRuntimeKeyValuePairTypeMarshaller.cs | 8 +-- .../WindowsRuntimeObjectMarshaller.cs | 8 +-- .../WindowsRuntimeUnknownMarshaller.cs | 8 +-- .../WindowsRuntimeUnsealedObjectMarshaller.cs | 10 +--- .../WindowsRuntimeValueTypeMarshaller.cs | 8 +-- .../CreateObjectReferenceMarshalingType.cs | 10 +--- .../WindowsRuntimeObjectReference.cs | 8 +-- .../WindowsRuntimeObjectReferenceValue.cs | 8 +-- .../ProjectionDllExports/TokenizerHelper.cs | 8 +-- .../ProjectionImpls/IAgileObjectImpl.cs | 9 +--- .../ProjectionImpls/IInspectableImpl.cs | 8 +-- .../ProjectionImpls/IMarshalImpl.cs | 8 +-- .../ProjectionImpls/IPropertyValueImpl.cs | 10 +--- .../IReferenceImpl.Int32Enum.cs | 8 +-- .../ProjectionImpls/IStringableImpl.cs | 8 +-- .../ProjectionImpls/IUnknownImpl.cs | 9 +--- .../IWeakReferenceSourceImpl.cs | 8 +-- .../IStorageFolderHandleAccessMethods.cs | 6 +-- .../IStorageItemHandleAccessMethods.cs | 6 +-- .../Streams/WindowsRuntimeIOHelpers.cs | 6 +-- ...rfaceCastableImplementationTypeMapGroup.cs | 10 +--- .../WindowsRuntimeComWrappersTypeMapGroup.cs | 10 +--- .../WindowsRuntimeMetadataTypeMapGroup.cs | 8 +-- .../WellKnownInterfaceIIDs.g.cs | 5 +- .../InteropServices/WellKnownInterfaceIIDs.tt | 5 +- .../WindowsRuntimeComWrappersMarshal.cs | 8 +-- .../AsyncInfo/WindowsRuntimeAsyncAction.cs | 13 ++--- ...ntimeAsyncActionWithProgress{TProgress}.cs | 18 ++----- ...erationWithProgress{TResult, TProgress}.cs | 18 ++----- .../WindowsRuntimeAsyncOperation{TResult}.cs | 18 ++----- .../Bindables/WindowsRuntimeEnumerable.cs | 13 ++--- .../Bindables/WindowsRuntimeEnumerator.cs | 13 ++--- .../Bindables/WindowsRuntimeList.cs | 13 ++--- .../Bindables/WindowsRuntimeReadOnlyList.cs | 13 ++--- .../DictionaryKeyCollection{TKey, TValue}.cs | 13 ++--- ...DictionaryValueCollection{TKey, TValue}.cs | 13 ++--- ...lyDictionaryKeyCollection{TKey, TValue}.cs | 13 ++--- ...DictionaryValueCollection{TKey, TValue}.cs | 13 ++--- .../WindowsRuntimeDictionary{TKey, TValue}.cs | 18 ++----- .../WindowsRuntimeEnumerable{T}.cs | 18 ++----- .../WindowsRuntimeEnumerator{T}.cs | 18 ++----- .../Collections/WindowsRuntimeList{T}.cs | 18 ++----- ...WindowsRuntimeMapChangedEventArgs{TKey}.cs | 18 ++----- ...ndowsRuntimeObservableMap{TKey, TValue}.cs | 18 ++----- .../WindowsRuntimeObservableVector{T}.cs | 18 ++----- ...RuntimeReadOnlyDictionary{TKey, TValue}.cs | 18 ++----- .../WindowsRuntimeReadOnlyList{T}.cs | 18 ++----- .../WindowsRuntimeMemoryBufferReference.cs | 11 +--- .../Streams/WindowsRuntimeBuffer.cs | 11 +--- .../Streams/WindowsRuntimeInputStream.cs | 11 +--- .../Streams/WindowsRuntimeOutputStream.cs | 11 +--- .../WindowsRuntimeRandomAccessStream.cs | 11 +--- .../Windows.Foundation/TrustLevel.cs | 9 +--- .../Windows.UI.Xaml.Interop/TypeKind.cs | 8 +-- .../WindowsRuntimeInspectable.cs | 13 ++--- src/WinRT.Runtime2/WindowsRuntimeObject.cs | 53 ++++--------------- 220 files changed, 533 insertions(+), 1845 deletions(-) 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/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/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/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/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/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..b228f3776c 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 { /// 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/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/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/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/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/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/Windows.Foundation/TrustLevel.cs b/src/WinRT.Runtime2/Windows.Foundation/TrustLevel.cs index 68a91a6597..97e5356d8f 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/TrustLevel.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/TrustLevel.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using System; -using System.ComponentModel; using WindowsRuntime; namespace Windows.Foundation; @@ -14,10 +12,7 @@ namespace Windows.Foundation; /// This type is required for ABI projection of Windows Runtime types, but marshalling it is not supported. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public enum TrustLevel { /// @@ -34,4 +29,4 @@ public enum TrustLevel /// The component requires the full privileges of the user. /// FullTrust = PartialTrust + 1 -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/Windows.UI.Xaml.Interop/TypeKind.cs b/src/WinRT.Runtime2/Windows.UI.Xaml.Interop/TypeKind.cs index 963f9a2e00..f97858b6ce 100644 --- a/src/WinRT.Runtime2/Windows.UI.Xaml.Interop/TypeKind.cs +++ b/src/WinRT.Runtime2/Windows.UI.Xaml.Interop/TypeKind.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using WindowsRuntime; namespace Windows.UI.Xaml.Interop; @@ -14,10 +13,7 @@ namespace Windows.UI.Xaml.Interop; /// This type is required for ABI projection of the class, but marshalling it is not supported. /// /// -[Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] -[EditorBrowsable(EditorBrowsableState.Never)] +[WindowsRuntimeImplementationOnlyMember] public enum TypeKind { /// @@ -34,4 +30,4 @@ public enum TypeKind /// The type is a custom type declared by means other than WinMD. /// Custom -} \ No newline at end of file +} diff --git a/src/WinRT.Runtime2/WindowsRuntimeInspectable.cs b/src/WinRT.Runtime2/WindowsRuntimeInspectable.cs index 862b2b3c95..e45420c30e 100644 --- a/src/WinRT.Runtime2/WindowsRuntimeInspectable.cs +++ b/src/WinRT.Runtime2/WindowsRuntimeInspectable.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.ComponentModel; using WindowsRuntime.InteropServices; namespace WindowsRuntime; @@ -29,19 +28,13 @@ public WindowsRuntimeInspectable(WindowsRuntimeObjectReference nativeObjectRefer } /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal override bool HasUnwrappableNativeObjectReference => true; /// - [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/WindowsRuntimeObject.cs b/src/WinRT.Runtime2/WindowsRuntimeObject.cs index 0f634f2acb..ce1cf45e72 100644 --- a/src/WinRT.Runtime2/WindowsRuntimeObject.cs +++ b/src/WinRT.Runtime2/WindowsRuntimeObject.cs @@ -5,7 +5,6 @@ using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -50,10 +49,7 @@ public abstract unsafe class WindowsRuntimeObject : /// /// The inner Windows Runtime object reference to wrap in the current instance. /// Thrown if is . - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected WindowsRuntimeObject(WindowsRuntimeObjectReference nativeObjectReference) { ArgumentNullException.ThrowIfNull(nativeObjectReference); @@ -74,10 +70,7 @@ protected WindowsRuntimeObject(WindowsRuntimeObjectReference nativeObjectReferen /// /// This constructor should only be used when activating sealed types (both projected and user-defined types). /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected WindowsRuntimeObject( WindowsRuntimeActivationTypes.DerivedSealed _, WindowsRuntimeObjectReference activationFactoryObjectReference, @@ -120,10 +113,7 @@ protected WindowsRuntimeObject( /// /// This constructor should only be used when activating composable types (both projected and user-defined types). /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected WindowsRuntimeObject( WindowsRuntimeActivationTypes.DerivedComposed _, WindowsRuntimeObjectReference activationFactoryObjectReference, @@ -203,10 +193,7 @@ protected WindowsRuntimeObject( /// overload should be used instead, as that is more efficient in case the default signature is sufficient. /// /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected WindowsRuntimeObject( WindowsRuntimeActivationFactoryCallback.DerivedSealed activationFactoryCallback, in Guid iid, @@ -252,10 +239,7 @@ protected WindowsRuntimeObject( /// overload should be used instead, as that is more efficient in case the default signature is sufficient. /// /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected WindowsRuntimeObject( WindowsRuntimeActivationFactoryCallback.DerivedComposed activationFactoryCallback, in Guid iid, @@ -295,10 +279,7 @@ protected WindowsRuntimeObject( /// /// This object reference should point to an IInspectable native object. /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal WindowsRuntimeObjectReference NativeObjectReference { get; } /// @@ -308,10 +289,7 @@ protected WindowsRuntimeObject( /// This value is in aggregation scenarios, as the instance that should be marshalled /// to native is the derived managed type for the projected class, and not the inner object for the base type. /// - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected internal virtual bool HasUnwrappableNativeObjectReference => UnreachableException.Throw(); /// @@ -364,10 +342,7 @@ ConcurrentDictionary InitializeTypeHandleCache() /// /// The interface to check. /// Whether the interface represented by is an overridable interface for the current type. - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] protected virtual bool IsOverridableInterface(in Guid iid) { return UnreachableException.Throw(); @@ -379,10 +354,7 @@ protected virtual bool IsOverridableInterface(in Guid iid) /// The type handle for the interface to retrieve the object reference for. /// The resulting object. /// Thrown if the interface specified by is not implemented. - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public WindowsRuntimeObjectReference GetObjectReferenceForInterface(RuntimeTypeHandle interfaceType) { // Throw an exception if we couldn't resolve the interface reference @@ -411,10 +383,7 @@ static void ThrowArgumentException(RuntimeTypeHandle interfaceType) /// The type handle for the interface to retrieve the object reference for. /// The resulting object, if the interface could be retrieved. /// Whether could be retrieved successfully. - [Obsolete(WindowsRuntimeConstants.PrivateImplementationDetailObsoleteMessage, - DiagnosticId = WindowsRuntimeConstants.PrivateImplementationDetailObsoleteDiagnosticId, - UrlFormat = WindowsRuntimeConstants.CsWinRTDiagnosticsUrlFormat)] - [EditorBrowsable(EditorBrowsableState.Never)] + [WindowsRuntimeImplementationOnlyMember] public bool TryGetObjectReferenceForInterface(RuntimeTypeHandle interfaceType, [NotNullWhen(true)] out WindowsRuntimeObjectReference? interfaceReference) { return TryGetCastResult( @@ -958,4 +927,4 @@ public static NotSupportedException GetNotSupportedException() $"Support for 'IDynamicInterfaceCastable' is disabled (make sure that the 'CsWinRTEnableIDynamicInterfaceCastableSupport' property is not set to 'false'). " + $"In this configuration, runtime casts on Windows Runtime objects will only work if the managed object implements the target interface in metadata."); } -} \ No newline at end of file +} From cd74794d9234b58e935dfd2d0092fa60a9c4c5d9 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:11:56 -0700 Subject: [PATCH 03/28] Remove WindowsRuntimeConstants.cs Delete WindowsRuntimeConstants.cs which contained constants for WinRT private implementation detail messaging, the PrivateImplementationDetailObsoleteDiagnosticId (CSWINRT3001), and the CsWinRT diagnostics URL format. These constants have been removed from the project. --- .../Properties/WindowsRuntimeConstants.cs | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/WinRT.Runtime2/Properties/WindowsRuntimeConstants.cs 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 From 91328fa7d4e7dd16704b1cc8564ae123c2d8506d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:14:49 -0700 Subject: [PATCH 04/28] Remove CSWINRT3001 NoWarn suppression Delete the NoWarn entry and its comment for CSWINRT3001 from src/WinRT.Runtime2/WinRT.Runtime.csproj so warnings about '[Obsolete]' private implementation details are no longer suppressed. This change surfaces those warnings for visibility during builds. --- src/WinRT.Runtime2/WinRT.Runtime.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 2b734d5c1d..110687d446 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -81,9 +81,6 @@ --> $(NoWarn);AD0001 - - $(NoWarn);CSWINRT3001 - true key.snk From 8d28af0514a8ee84cb7e1fa73460d3d18fb884f8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:16:19 -0700 Subject: [PATCH 05/28] Remove AD0001 NoWarn workaround Delete the NoWarn entry and accompanying comment that suppressed AD0001 analyzer warnings from WinRT.Runtime.csproj. This removes the previous workaround for the ILLink analyzer exception so AD0001 warnings will no longer be globally suppressed; signing and other project settings are unchanged. --- src/WinRT.Runtime2/WinRT.Runtime.csproj | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 110687d446..01ac0e7767 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -74,13 +74,6 @@ --> true - - $(NoWarn);AD0001 - true key.snk From 0263523545e11abe9d5d8eef8fad27d106df3a38 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 16:18:37 -0700 Subject: [PATCH 06/28] Update WinRT.Runtime.csproj --- src/WinRT.Runtime2/WinRT.Runtime.csproj | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 01ac0e7767..670d5d3a9b 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -78,6 +78,48 @@ true key.snk + + + + false + + + $(DefineConstants);WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + + + + + $(DefineConstants);REFERENCE_ASSEMBLY + + + $(NoWarn);CS8597;IDE0005;IDE0380 + + + + + + false - - - $(DefineConstants);WINDOWS_RUNTIME_REFERENCE_ASSEMBLY - $(DefineConstants);REFERENCE_ASSEMBLY + $(DefineConstants);WINDOWS_RUNTIME_REFERENCE_ASSEMBLY - - - + + + + + + From 3d44e5915be215e074c37127c860c29683d3cb32 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 17:23:37 -0700 Subject: [PATCH 10/28] Guard attribute usages of impl-only types with WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../InteropServices/Events/EventRegistrationToken.cs | 4 ++++ .../Windows.Foundation/AsyncActionCompletedHandler.cs | 4 ++++ .../AsyncActionProgressHandler{TProgress}.cs | 2 ++ .../AsyncActionWithProgressCompletedHandler{TProgress}.cs | 2 ++ .../AsyncOperationCompletedHandler{TResult}.cs | 2 ++ .../AsyncOperationProgressHandler{TResult, TProgress}.cs | 2 ++ ...ationWithProgressCompletedHandler{TResult, TProgress}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 6 ++++++ .../Windows.Foundation/Collections/CollectionChange.cs | 6 ++++++ .../Collections/IMapChangedEventArgs{K}.cs | 2 ++ .../Windows.Foundation/Collections/IObservableMap{K, V}.cs | 2 ++ .../Windows.Foundation/Collections/IObservableVector{T}.cs | 2 ++ .../Collections/IVectorChangedEventArgs.cs | 2 ++ .../Collections/MapChangedEventHandler{K, V}.cs | 2 ++ .../Collections/VectorChangedEventHandler{T}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs | 2 ++ .../IAsyncActionWithProgress{TProgress}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs | 2 ++ .../IAsyncOperationWithProgress{TResult, TProgress}.cs | 2 ++ .../Windows.Foundation/IAsyncOperation{TResult}.cs | 2 ++ .../Windows.Foundation/IMemoryBufferReference.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IStringable.cs | 2 ++ .../Windows.Foundation/Metadata/ContractVersionAttribute.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/Point.cs | 6 ++++++ src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 6 ++++++ src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 6 ++++++ src/WinRT.Runtime2/Windows.Foundation/Size.cs | 6 ++++++ src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs | 2 ++ .../Windows.Storage.Streams/IRandomAccessStream.cs | 2 ++ .../Windows.Storage.Streams/InputStreamOptions.cs | 6 ++++++ 32 files changed, 96 insertions(+) diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs index 8b590c358c..00d0db4610 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs @@ -11,10 +11,14 @@ namespace WindowsRuntime.InteropServices; /// Represents a reference to a delegate that receives change notifications. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(EventRegistrationToken?))] [ABI.WindowsRuntime.InteropServices.EventRegistrationTokenComWrappersMarshaller] +#endif public struct EventRegistrationToken : IEquatable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs index 6495f0dd0c..bebce1b3a4 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs @@ -11,8 +11,12 @@ namespace Windows.Foundation; /// /// The asynchronous operation. /// One of the enumeration values. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.AsyncActionCompletedHandlerComWrappersMarshaller] +#endif public delegate void AsyncActionCompletedHandler(IAsyncAction asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs index 3e351c0819..7b90fd033e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs @@ -12,6 +12,8 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// The progress information. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void AsyncActionProgressHandler(IAsyncActionWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs index 95a0c87104..e743e3d03b 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs @@ -12,6 +12,8 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// One of the enumeration values. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void AsyncActionWithProgressCompletedHandler(IAsyncActionWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs index 2a8d5b9f1a..a50d400d79 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs @@ -12,6 +12,8 @@ namespace Windows.Foundation; /// The result type. /// The asynchronous action. /// One of the enumeration values. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void AsyncOperationCompletedHandler(IAsyncOperation asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs index b5ae24993f..3e7fd7f94c 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs @@ -13,6 +13,8 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// The progress information. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void AsyncOperationProgressHandler(IAsyncOperationWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs index cd2ffbe218..1d86b849d0 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs @@ -13,6 +13,8 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// One of the enumeration values. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void AsyncOperationWithProgressCompletedHandler(IAsyncOperationWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs index e06e49c0ae..a0e9aa77d3 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs @@ -11,12 +11,18 @@ namespace Windows.Foundation; /// Represents the status for an asynchronous operation. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(AsyncStatus?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.AsyncStatusComWrappersMarshaller] +#endif public enum AsyncStatus { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs index 3f5b381c9b..0b6c90518f 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs @@ -17,13 +17,19 @@ namespace Windows.Foundation.Collections; /// property to determine the location of the change. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadataTypeName("Windows.Foundation.Collections.CollectionChange")] [WindowsRuntimeReferenceType(typeof(CollectionChange?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.Collections.CollectionChangeComWrappersMarshaller] +#endif public enum CollectionChange { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs index 10f8bad5df..f8129a8f27 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs @@ -11,7 +11,9 @@ namespace Windows.Foundation.Collections; /// Provides data for the changed event of a map collection. /// /// The type of keys in the map. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("9939F4DF-050A-4C0F-AA60-77075F9C4777")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IMapChangedEventArgs diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs index 921e0fd227..9b3e750093 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs @@ -14,7 +14,9 @@ namespace Windows.Foundation.Collections; /// /// The type of keys in the observable map. /// The type of values in the observable map. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("65DF2BF5-BF39-41B5-AEBC-5A9D865E472B")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IObservableMap : IDictionary, ICollection>, IEnumerable>, IEnumerable diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs index 31df8a6279..6cf63ef276 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs @@ -13,7 +13,9 @@ namespace Windows.Foundation.Collections; /// Notifies listeners of changes to the vector. /// /// The type of elements in the observable vector. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("5917EB53-50B4-4A0D-B309-65862B3F1DBC")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IObservableVector : IList, ICollection, IEnumerable, IEnumerable diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs index 9f07ae2379..a3ffd9882c 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs @@ -10,7 +10,9 @@ namespace Windows.Foundation.Collections; /// /// Provides data for the changed event of a vector. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("575933DF-34FE-4480-AF15-07691F3D5D9B")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IVectorChangedEventArgs diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs index 8ac1c5b1b3..f98fd847d1 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs @@ -13,6 +13,8 @@ namespace Windows.Foundation.Collections; /// The type of values in the observable map. /// The observable map that changed. /// The description of the change that occurred in the map. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void MapChangedEventHandler(IObservableMap sender, IMapChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs index 5442538045..e6d78b5bf5 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs @@ -12,6 +12,8 @@ namespace Windows.Foundation.Collections; /// The type of elements in the observable vector. /// The observable vector that changed. /// The description of the change that occurred in the vector. +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [ContractVersion(typeof(FoundationContract), 65536u)] public delegate void VectorChangedEventHandler(IObservableVector sender, IVectorChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs index 8d813e3586..819004a703 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs @@ -17,7 +17,9 @@ namespace Windows.Foundation; /// by is invoked, and this is the only result from the action. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("5A648006-843A-4DA9-865B-9D26E5DFAD7B")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IAsyncAction : IAsyncInfo diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs index 7c4c0a86d6..89001e2073 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs @@ -18,7 +18,9 @@ namespace Windows.Foundation; /// of these as there are methods that use , whose APIs don't report progress and don't have a result. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("1F6DB258-E803-48A1-9546-EB7353398884")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IAsyncActionWithProgress : IAsyncInfo diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs index 5bb3b01a9b..f6f7789e6e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs @@ -11,7 +11,9 @@ namespace Windows.Foundation; /// /// Provides support for asynchronous operations. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("00000036-0000-0000-C000-000000000046")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IAsyncInfo diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs index 99c8575730..627ad88b41 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs @@ -20,7 +20,9 @@ namespace Windows.Foundation; /// use another interface, . /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("B5D036D7-E297-498F-BA60-0289E76E23DD")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IAsyncOperationWithProgress : IAsyncInfo diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs index a6ec54b5f1..3ad7aafae9 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs @@ -18,7 +18,9 @@ namespace Windows.Foundation; /// progress and have a result use another interface, . /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("9FC2B0BB-E446-44E2-AA61-9CAB8F636AF2")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IAsyncOperation : IAsyncInfo diff --git a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs index 50bded5a6d..613c290772 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs @@ -11,7 +11,9 @@ namespace Windows.Foundation; /// /// Represents a reference to an IMemoryBuffer object. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [Guid("FBC4DD29-245B-11E4-AF98-689423260CF8")] [ContractVersion(typeof(UniversalApiContract), 65536u)] public interface IMemoryBufferReference : IDisposable diff --git a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs index e599d1083d..ca4d0d6e10 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs @@ -16,7 +16,9 @@ namespace Windows.Foundation; /// method. When exposed to native code, they will implicitly get an implementation /// of that will call the managed override. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [Guid("96369F54-8EB6-48F0-ABCE-C1B211E627C3")] [ContractVersion(typeof(FoundationContract), 65536u)] public interface IStringable diff --git a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs index 49f0db22da..f057afc85e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs @@ -12,7 +12,9 @@ namespace Windows.Foundation.Metadata; /// /// Indicates the version of the API contract. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index 23c0945b70..b70c8dd607 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -17,12 +17,18 @@ namespace Windows.Foundation; /// Represents X and Y coordinate values that define a point in a two-dimensional plane. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Point?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.PointComWrappersMarshaller] +#endif public struct Point : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs index 617fa6327d..cec9c08215 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs @@ -11,12 +11,18 @@ namespace Windows.Foundation; /// Specifies property value types. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(PropertyType?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.PropertyTypeComWrappersMarshaller] +#endif public enum PropertyType { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index 1f2d345de1..eec38cf9a3 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -19,12 +19,18 @@ namespace Windows.Foundation; /// Contains number values that represent the location and size of a rectangle. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Rect?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.RectComWrappersMarshaller] +#endif public struct Rect : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/Windows.Foundation/Size.cs index e2afc8cdb5..2d3fe8185c 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Size.cs @@ -16,12 +16,18 @@ namespace Windows.Foundation; /// Represents number values that specify a height and width. /// /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Size?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.SizeComWrappersMarshaller] +#endif public struct Size : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs index 86642d7f59..992a683328 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs @@ -12,7 +12,9 @@ namespace Windows.Storage.Streams; /// /// Represents a referenced array of bytes used by byte stream read and write interfaces. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [Guid("905A0FE0-BC53-11DF-8C49-001E4FC686DA")] [ContractVersion(typeof(UniversalApiContract), 65536u)] public interface IBuffer diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs index b6e53c825a..f86fab04ff 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs @@ -12,7 +12,9 @@ namespace Windows.Storage.Streams; /// /// Represents a sequential stream of bytes to be read. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [Guid("905A0FE2-BC53-11DF-8C49-001E4FC686DA")] [ContractVersion(typeof(UniversalApiContract), 65536u)] public interface IInputStream : IDisposable diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs index fba084aa86..0d877bfade 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs @@ -12,7 +12,9 @@ namespace Windows.Storage.Streams; /// /// Represents a sequential stream of bytes to be written. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [Guid("905A0FE6-BC53-11DF-8C49-001E4FC686DA")] [ContractVersion(typeof(UniversalApiContract), 65536u)] public interface IOutputStream : IDisposable diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs index 35ec70bb84..258a5e5ac7 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs @@ -12,7 +12,9 @@ namespace Windows.Storage.Streams; /// /// Supports random access of data in input and output streams. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [Guid("905A0FE1-BC53-11DF-8C49-001E4FC686DA")] [ContractVersion(typeof(UniversalApiContract), 65536u)] public interface IRandomAccessStream : IDisposable, IInputStream, IOutputStream diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs index c295319a74..d523b44cfe 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs @@ -14,12 +14,18 @@ namespace Windows.Storage.Streams; /// /// [Flags] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] +#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(InputStreamOptions?))] +#endif [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(UniversalApiContract), 65536u)] +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Storage.Streams.InputStreamOptionsComWrappersMarshaller] +#endif public enum InputStreamOptions : uint { /// From d21d0b44367a59c66d8f637b81718d70feb3c5d6 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 16 Apr 2026 17:29:35 -0700 Subject: [PATCH 11/28] Strip SupportedOSPlatform and ContractVersion from impl assembly for public types Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../System.Runtime.InteropServices/AsyncInfo.cs | 2 ++ .../Windows.Foundation/AsyncActionCompletedHandler.cs | 3 ++- .../AsyncActionProgressHandler{TProgress}.cs | 3 ++- .../AsyncActionWithProgressCompletedHandler{TProgress}.cs | 3 ++- .../AsyncOperationCompletedHandler{TResult}.cs | 3 ++- .../AsyncOperationProgressHandler{TResult, TProgress}.cs | 3 ++- ...perationWithProgressCompletedHandler{TResult, TProgress}.cs | 3 ++- src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 3 ++- .../Windows.Foundation/Collections/CollectionChange.cs | 3 ++- .../Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs | 2 ++ .../Windows.Foundation/Collections/IObservableMap{K, V}.cs | 2 ++ .../Windows.Foundation/Collections/IObservableVector{T}.cs | 2 ++ .../Windows.Foundation/Collections/IVectorChangedEventArgs.cs | 2 ++ .../Collections/MapChangedEventHandler{K, V}.cs | 3 ++- .../Collections/VectorChangedEventHandler{T}.cs | 3 ++- .../Windows.Foundation/Extensions/VectorExtensions.cs | 2 ++ .../Extensions/WindowsRuntimeTaskExtensions.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs | 2 ++ .../Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs | 2 ++ .../IAsyncOperationWithProgress{TResult, TProgress}.cs | 2 ++ .../Windows.Foundation/IAsyncOperation{TResult}.cs | 2 ++ .../Windows.Foundation/IMemoryBufferReference.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IStringable.cs | 2 ++ .../Windows.Foundation/Metadata/ContractVersionAttribute.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/Point.cs | 3 ++- src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 3 ++- src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 3 ++- src/WinRT.Runtime2/Windows.Foundation/Size.cs | 3 ++- src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs | 2 ++ .../Windows.Storage.Streams/IRandomAccessStream.cs | 2 ++ .../Windows.Storage.Streams/InputStreamOptions.cs | 3 ++- 36 files changed, 72 insertions(+), 15 deletions(-) diff --git a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs index d7ca2ace12..ea346bded1 100644 --- a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs +++ b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs @@ -20,7 +20,9 @@ namespace WindowsRuntime.InteropServices; /// that will be wrapped by the returned Windows Runtime adapter. /// /// +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("windows10.0.10240.0")] +#endif public static class AsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs index bebce1b3a4..6945b897e8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs @@ -15,8 +15,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.AsyncActionCompletedHandlerComWrappersMarshaller] #endif public delegate void AsyncActionCompletedHandler(IAsyncAction asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs index 7b90fd033e..36916c019e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs @@ -14,6 +14,7 @@ namespace Windows.Foundation; /// The progress information. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void AsyncActionProgressHandler(IAsyncActionWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs index e743e3d03b..a87033e29e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs @@ -14,6 +14,7 @@ namespace Windows.Foundation; /// One of the enumeration values. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void AsyncActionWithProgressCompletedHandler(IAsyncActionWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs index a50d400d79..d4fd3dc8a8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs @@ -14,6 +14,7 @@ namespace Windows.Foundation; /// One of the enumeration values. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void AsyncOperationCompletedHandler(IAsyncOperation asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs index 3e7fd7f94c..3957f070a0 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs @@ -15,6 +15,7 @@ namespace Windows.Foundation; /// The progress information. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void AsyncOperationProgressHandler(IAsyncOperationWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs index 1d86b849d0..d5df451272 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs @@ -15,6 +15,7 @@ namespace Windows.Foundation; /// One of the enumeration values. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void AsyncOperationWithProgressCompletedHandler(IAsyncOperationWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs index a0e9aa77d3..73fb46e6c7 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs @@ -17,9 +17,10 @@ namespace Windows.Foundation; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(AsyncStatus?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.AsyncStatusComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs index 0b6c90518f..5ac5710101 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs @@ -24,9 +24,10 @@ namespace Windows.Foundation.Collections; #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadataTypeName("Windows.Foundation.Collections.CollectionChange")] [WindowsRuntimeReferenceType(typeof(CollectionChange?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.Collections.CollectionChangeComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs index f8129a8f27..a3a5534443 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs @@ -15,7 +15,9 @@ namespace Windows.Foundation.Collections; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("9939F4DF-050A-4C0F-AA60-77075F9C4777")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IMapChangedEventArgs { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs index 9b3e750093..1ae29d5303 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs @@ -18,7 +18,9 @@ namespace Windows.Foundation.Collections; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("65DF2BF5-BF39-41B5-AEBC-5A9D865E472B")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IObservableMap : IDictionary, ICollection>, IEnumerable>, IEnumerable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs index 6cf63ef276..3c9ff2baf8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs @@ -17,7 +17,9 @@ namespace Windows.Foundation.Collections; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("5917EB53-50B4-4A0D-B309-65862B3F1DBC")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IObservableVector : IList, ICollection, IEnumerable, IEnumerable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs index a3ffd9882c..9fe88068ef 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs @@ -14,7 +14,9 @@ namespace Windows.Foundation.Collections; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("575933DF-34FE-4480-AF15-07691F3D5D9B")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IVectorChangedEventArgs { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs index f98fd847d1..fa1022e6fc 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs @@ -15,6 +15,7 @@ namespace Windows.Foundation.Collections; /// The description of the change that occurred in the map. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void MapChangedEventHandler(IObservableMap sender, IMapChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs index e6d78b5bf5..4c5fb4cc7b 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs @@ -14,6 +14,7 @@ namespace Windows.Foundation.Collections; /// The description of the change that occurred in the vector. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public delegate void VectorChangedEventHandler(IObservableVector sender, IVectorChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Extensions/VectorExtensions.cs b/src/WinRT.Runtime2/Windows.Foundation/Extensions/VectorExtensions.cs index 178d27c026..edec3ea790 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Extensions/VectorExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Extensions/VectorExtensions.cs @@ -9,7 +9,9 @@ namespace Windows.Foundation; /// /// Provides extension methods for converting between and Windows Foundation types. /// +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] +#endif public static class VectorExtensions { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs index ddda8fb90e..88357106e9 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs @@ -15,7 +15,9 @@ namespace Windows.Foundation; /// /// Provides extensions for types to interoperate with types. /// +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("windows10.0.10240.0")] +#endif public static class WindowsRuntimeTaskExtensions { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs b/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs index ee3d36067b..4f55a82c20 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs @@ -11,6 +11,8 @@ namespace Windows.Foundation; /// /// This type is required for ABI projection of the value types and delegates, but marshalling it is not supported. /// +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ApiContract] [ContractVersion(262144u)] +#endif public enum FoundationContract; \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs index 819004a703..31117d8d11 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs @@ -21,7 +21,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("5A648006-843A-4DA9-865B-9D26E5DFAD7B")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IAsyncAction : IAsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs index 89001e2073..d42c151571 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs @@ -22,7 +22,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("1F6DB258-E803-48A1-9546-EB7353398884")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IAsyncActionWithProgress : IAsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs index f6f7789e6e..7fa1db5d33 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs @@ -15,7 +15,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("00000036-0000-0000-C000-000000000046")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IAsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs index 627ad88b41..f1cf231df1 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs @@ -24,7 +24,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("B5D036D7-E297-498F-BA60-0289E76E23DD")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IAsyncOperationWithProgress : IAsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs index 3ad7aafae9..74219e076d 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs @@ -22,7 +22,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("9FC2B0BB-E446-44E2-AA61-9CAB8F636AF2")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IAsyncOperation : IAsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs index 613c290772..20aee151e4 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs @@ -15,7 +15,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif [Guid("FBC4DD29-245B-11E4-AF98-689423260CF8")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif public interface IMemoryBufferReference : IDisposable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs index ca4d0d6e10..9bee5c2d50 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs @@ -20,7 +20,9 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [Guid("96369F54-8EB6-48F0-ABCE-C1B211E627C3")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public interface IStringable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs index f057afc85e..665db6e60f 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs @@ -16,8 +16,10 @@ namespace Windows.Foundation.Metadata; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif [AttributeUsage(AttributeTargets.All, AllowMultiple = true)] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif public sealed class ContractVersionAttribute : Attribute { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index b70c8dd607..75ab62d72d 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -23,9 +23,10 @@ namespace Windows.Foundation; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Point?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.PointComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs index cec9c08215..1fc030be7d 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs @@ -17,9 +17,10 @@ namespace Windows.Foundation; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(PropertyType?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.PropertyTypeComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index eec38cf9a3..7a8364e4a9 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -25,9 +25,10 @@ namespace Windows.Foundation; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Rect?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.RectComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/Windows.Foundation/Size.cs index 2d3fe8185c..32c5b86e0b 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Size.cs @@ -22,9 +22,10 @@ namespace Windows.Foundation; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Size?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Foundation.SizeComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs b/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs index 1479327882..dde7e1671e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs @@ -11,6 +11,8 @@ namespace Windows.Foundation; /// /// This type is required for ABI projection of the value types and delegates, but marshalling it is not supported. /// +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ApiContract] [ContractVersion(1245184u)] +#endif public enum UniversalApiContract; \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs index 992a683328..7bd5bc0365 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs @@ -16,7 +16,9 @@ namespace Windows.Storage.Streams; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif [Guid("905A0FE0-BC53-11DF-8C49-001E4FC686DA")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif public interface IBuffer { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs index f86fab04ff..6dbc0d30c4 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs @@ -16,7 +16,9 @@ namespace Windows.Storage.Streams; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif [Guid("905A0FE2-BC53-11DF-8C49-001E4FC686DA")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif public interface IInputStream : IDisposable { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs index 0d877bfade..0588e24525 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs @@ -16,7 +16,9 @@ namespace Windows.Storage.Streams; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif [Guid("905A0FE6-BC53-11DF-8C49-001E4FC686DA")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif public interface IOutputStream : IDisposable { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs index 258a5e5ac7..5bbaf2c7d6 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs @@ -16,7 +16,9 @@ namespace Windows.Storage.Streams; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif [Guid("905A0FE1-BC53-11DF-8C49-001E4FC686DA")] +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif public interface IRandomAccessStream : IDisposable, IInputStream, IOutputStream { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs index d523b44cfe..cdb0c6778e 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs @@ -20,9 +20,10 @@ namespace Windows.Storage.Streams; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(InputStreamOptions?))] -#endif +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(UniversalApiContract), 65536u)] +#endif #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [ABI.Windows.Storage.Streams.InputStreamOptionsComWrappersMarshaller] #endif From a70b56b70b11ce2879a4cf73d21b2f2ddea79f07 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 17 Apr 2026 11:25:01 -0700 Subject: [PATCH 12/28] Unconditionally apply SupportedOSPlatform attribute Remove the conditional compilation (#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY / #endif) around the [SupportedOSPlatform("windows10.0.10240.0")] attribute in AsyncInfo and WindowsRuntimeTaskExtensions so the attribute is always emitted. This ensures these APIs are annotated for Windows platform compatibility even when the WINDOWS_RUNTIME_REFERENCE_ASSEMBLY symbol is not defined. --- .../InteropServices/System.Runtime.InteropServices/AsyncInfo.cs | 2 -- .../Extensions/WindowsRuntimeTaskExtensions.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs index ea346bded1..d7ca2ace12 100644 --- a/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs +++ b/src/WinRT.Runtime2/InteropServices/System.Runtime.InteropServices/AsyncInfo.cs @@ -20,9 +20,7 @@ namespace WindowsRuntime.InteropServices; /// that will be wrapped by the returned Windows Runtime adapter. /// /// -#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("windows10.0.10240.0")] -#endif public static class AsyncInfo { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs index 88357106e9..ddda8fb90e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs @@ -15,9 +15,7 @@ namespace Windows.Foundation; /// /// Provides extensions for types to interoperate with types. /// -#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("windows10.0.10240.0")] -#endif public static class WindowsRuntimeTaskExtensions { /// From 0fad3cd356c3112890527a7416b17b34496630e5 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 17 Apr 2026 11:45:39 -0700 Subject: [PATCH 13/28] Conditional metadata imports and define impl constant Surround Windows.Foundation.Metadata and System.Runtime.Versioning using directives with #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY across many sources so metadata attributes are only included for reference-assembly builds. Add WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY to DefineConstants in the csproj for normal implementation builds to simplify #if logic (and update related comments to reference WINDOWS_RUNTIME_REFERENCE_ASSEMBLY). Also tidy WindowsRuntimeObject by replacing throw null! with throw null. --- src/WinRT.Runtime2/WinRT.Runtime.csproj | 9 ++++++--- .../Windows.Foundation/AsyncActionCompletedHandler.cs | 2 ++ .../AsyncActionProgressHandler{TProgress}.cs | 2 ++ ...AsyncActionWithProgressCompletedHandler{TProgress}.cs | 2 ++ .../AsyncOperationCompletedHandler{TResult}.cs | 2 ++ .../AsyncOperationProgressHandler{TResult, TProgress}.cs | 2 ++ ...onWithProgressCompletedHandler{TResult, TProgress}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 2 ++ .../Windows.Foundation/Collections/CollectionChange.cs | 2 ++ .../Collections/IMapChangedEventArgs{K}.cs | 2 ++ .../Collections/IObservableMap{K, V}.cs | 2 ++ .../Collections/IObservableVector{T}.cs | 2 ++ .../Collections/IVectorChangedEventArgs.cs | 2 ++ .../Collections/MapChangedEventHandler{K, V}.cs | 2 ++ .../Collections/VectorChangedEventHandler{T}.cs | 2 ++ .../Windows.Foundation/Extensions/VectorExtensions.cs | 2 ++ .../Windows.Foundation/FoundationContract.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs | 2 ++ .../IAsyncActionWithProgress{TProgress}.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs | 2 ++ .../IAsyncOperationWithProgress{TResult, TProgress}.cs | 2 ++ .../Windows.Foundation/IAsyncOperation{TResult}.cs | 2 ++ .../Windows.Foundation/IMemoryBufferReference.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/IStringable.cs | 2 ++ .../Metadata/ContractVersionAttribute.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/Point.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 2 ++ src/WinRT.Runtime2/Windows.Foundation/Size.cs | 2 ++ .../Windows.Foundation/UniversalApiContract.cs | 2 ++ src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs | 2 ++ .../Windows.Storage.Streams/IInputStream.cs | 2 ++ .../Windows.Storage.Streams/IOutputStream.cs | 2 ++ .../Windows.Storage.Streams/IRandomAccessStream.cs | 2 ++ .../Windows.Storage.Streams/InputStreamOptions.cs | 2 ++ src/WinRT.Runtime2/WindowsRuntimeObject.cs | 8 ++++---- 36 files changed, 78 insertions(+), 7 deletions(-) diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 7e294fde02..745847cda7 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -82,17 +82,20 @@ false + + + $(DefineConstants);WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY + + + + + + + + + + + + + + + + + + + + + + + + From 355c05311a58e49ddd28bd2d3ea145aa613338f5 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 17 Apr 2026 13:46:01 -0700 Subject: [PATCH 15/28] Stub method bodies in reference assembly with throw null Wrap method bodies that reference implementation-only types with #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY/#else/#endif so the reference assembly build (CsWinRTBuildReferenceAssembly=true) compiles successfully. Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- .../WindowsRuntimeActivationFactory.cs | 12 ++++ .../Exceptions/RestrictedErrorInfo.cs | 20 ++++++ .../RestrictedErrorInfoExceptionMarshaller.cs | 13 +++- .../AsyncInfo.cs | 64 +++++++++++++++++++ .../WindowsRuntimeBuffer.cs | 16 +++++ .../WindowsRuntimeBufferMarshal.cs | 12 ++++ .../InteropServices/WindowsRuntimeMarshal.cs | 23 +++++++ .../WindowsRuntimeTaskExtensions.cs | 32 ++++++++++ .../Windows.Foundation/Point.cs | 8 +++ src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 8 +++ .../WindowsRuntimeBufferExtensions.cs | 36 +++++++++++ .../WindowsRuntimeStreamExtensions.cs | 36 +++++++++++ 12 files changed, 278 insertions(+), 2 deletions(-) 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/Exceptions/RestrictedErrorInfo.cs b/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs index b228f3776c..9b08ad0b61 100644 --- a/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs +++ b/src/WinRT.Runtime2/InteropServices/Exceptions/RestrictedErrorInfo.cs @@ -38,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) { @@ -176,6 +179,7 @@ public static unsafe class RestrictedErrorInfo restoredExceptionFromGlobalState = false; return exception; +#endif } /// @@ -226,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) { @@ -250,6 +257,7 @@ public static HRESULT GetHRForException(Exception? exception) } return WellKnownExceptionMappings.GetHRForNativeOrManagedErrorCode(hresult); +#endif } /// @@ -259,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 @@ -335,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 } /// @@ -343,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; @@ -413,6 +428,7 @@ internal static void AttachErrorInfo(Exception exception) { WindowsRuntimeUnknownMarshaller.Free(restrictedErrorInfoPtr); } +#endif } /// @@ -429,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(); @@ -439,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/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/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/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/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/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs index ddda8fb90e..bdc4d2c59b 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Extensions/WindowsRuntimeTaskExtensions.cs @@ -38,6 +38,9 @@ public static Task AsTask(this IAsyncAction source) /// Thrown if is . public static Task AsTask(this IAsyncAction source, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); // If the source is already an adapter over a 'Task', return the underlying 'Task' directly @@ -67,6 +70,7 @@ public static Task AsTask(this IAsyncAction source, CancellationToken cancellati source.Completed = bridge.Complete; return bridge.Task; +#endif } /// Gets an awaiter used to await this . @@ -100,6 +104,9 @@ public static Task AsTask(this IAsyncOperation source /// Thrown if is . public static Task AsTask(this IAsyncOperation source, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); if (source is UniversalTaskAdapter { Task: Task task }) @@ -124,6 +131,7 @@ public static Task AsTask(this IAsyncOperation source source.Completed = bridge.Complete; return bridge.Task; +#endif } /// Gets an awaiter used to await this . @@ -158,6 +166,9 @@ public static Task AsTask(this IAsyncActionWithProgress so /// Thrown if is . public static Task AsTask(this IAsyncActionWithProgress source, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); if (source is UniversalTaskAdapter { Task: Task task }) @@ -182,6 +193,7 @@ public static Task AsTask(this IAsyncActionWithProgress so source.Completed = bridge.Complete; return bridge.Task; +#endif } /// @@ -211,6 +223,9 @@ public static Task AsTask( IProgress progress, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentNullException.ThrowIfNull(progress); @@ -230,6 +245,7 @@ public static Task AsTask( source.Completed = bridge.Complete; return bridge.Task; +#endif } /// Gets an awaiter used to await this . @@ -266,6 +282,9 @@ public static Task AsTask(this IAsyncOperationWithP /// Thrown if is . public static Task AsTask(this IAsyncOperationWithProgress source, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); if (source is UniversalTaskAdapter { Task: Task task }) @@ -290,6 +309,7 @@ public static Task AsTask(this IAsyncOperationWithP source.Completed = bridge.Complete; return bridge.Task; +#endif } /// @@ -321,6 +341,9 @@ public static Task AsTask( IProgress progress, CancellationToken cancellationToken) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentNullException.ThrowIfNull(progress); @@ -340,6 +363,7 @@ public static Task AsTask( source.Completed = bridge.Complete; return bridge.Task; +#endif } /// Gets an awaiter used to await this . @@ -361,9 +385,13 @@ public static TaskAwaiter GetAwaiter(this IAsyncOpe /// Thrown if is . public static IAsyncAction AsAsyncAction(this Task source) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); return new TaskAdapter(source, cancellationTokenSource: null); +#endif } /// @@ -375,8 +403,12 @@ public static IAsyncAction AsAsyncAction(this Task source) /// Thrown if is . public static IAsyncOperation AsAsyncOperation(this Task source) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); return new TaskAdapter(source, cancellationTokenSource: null); +#endif } } \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index da0aff6802..d5b284b8da 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -91,14 +91,21 @@ public override readonly int GetHashCode() /// public override readonly string ToString() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else char separator = TokenizerHelper.GetNumericListSeparator(null); return $"{X}{separator}{Y}"; +#endif } /// public readonly string ToString(string? format, IFormatProvider? formatProvider) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // Fast path if both arguments are 'null' if (format is null && formatProvider is null) { @@ -119,6 +126,7 @@ public readonly string ToString(string? format, IFormatProvider? formatProvider) handler.AppendFormatted(Y, format); return handler.ToStringAndClear(); +#endif } /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index bad5ab4028..e44a7a1345 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -299,6 +299,9 @@ public override readonly int GetHashCode() /// public override readonly string ToString() { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else if (IsEmpty) { return "Empty"; @@ -307,11 +310,15 @@ public override readonly string ToString() char separator = TokenizerHelper.GetNumericListSeparator(null); return $"{X}{separator}{Y}{separator}{Width}{separator}{Height}"; +#endif } /// public readonly string ToString(string? format, IFormatProvider? formatProvider) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // Fast path if both arguments are 'null' if (format is null && formatProvider is null) { @@ -336,6 +343,7 @@ public readonly string ToString(string? format, IFormatProvider? formatProvider) handler.AppendFormatted(Height, format); return handler.ToStringAndClear(); +#endif } /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeBufferExtensions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeBufferExtensions.cs index acc1d597f6..722fc07bbd 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeBufferExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeBufferExtensions.cs @@ -59,6 +59,9 @@ public static IBuffer AsBuffer(this byte[] source, int offset, int length) /// Thrown if the specified range is not valid, or if is less than the specified range. public static IBuffer AsBuffer(this byte[] source, int offset, int length, int capacity) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentOutOfRangeException.ThrowIfNegative(offset); ArgumentOutOfRangeException.ThrowIfNegative(length); @@ -68,6 +71,7 @@ public static IBuffer AsBuffer(this byte[] source, int offset, int length, int c ArgumentException.ThrowIfInsufficientBufferCapacity(capacity, length); return new WindowsRuntimeExternalArrayBuffer(source, offset, length, capacity); +#endif } /// @@ -107,6 +111,9 @@ public static void CopyTo(this ReadOnlySpan source, IBuffer destination) /// Thrown if invoking IBufferByteAccess.Buffer on the input buffer fails. public static void CopyTo(this ReadOnlySpan source, IBuffer destination, uint destinationIndex) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(destination); ArgumentException.ThrowIfBufferIndexExceedsCapacity(destinationIndex, destination.Capacity); ArgumentException.ThrowIfInsufficientSpaceInTargetBuffer(destination.Capacity, destinationIndex, (uint)source.Length); @@ -133,6 +140,7 @@ public static void CopyTo(this ReadOnlySpan source, IBuffer destination, u { destination.Length = destinationIndex + (uint)source.Length; } +#endif } /// @@ -214,6 +222,9 @@ public static void CopyTo(this IBuffer source, Span destination) /// Thrown if invoking IBufferByteAccess.Buffer on the input buffer fails. public static void CopyTo(this IBuffer source, uint sourceIndex, Span destination, int count) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentOutOfRangeException.ThrowIfNegative(count); ArgumentException.ThrowIfBufferIndexExceedsLength(sourceIndex, source.Length); @@ -233,6 +244,7 @@ public static void CopyTo(this IBuffer source, uint sourceIndex, Span dest sourceSpan.CopyTo(destination); GC.KeepAlive(source); +#endif } /// @@ -306,6 +318,9 @@ public static void CopyTo(this IBuffer source, IBuffer destination) /// Thrown if invoking IBufferByteAccess.Buffer on either input buffer fails. public static void CopyTo(this IBuffer source, uint sourceIndex, IBuffer destination, uint destinationIndex, uint count) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentNullException.ThrowIfNull(destination); ArgumentException.ThrowIfBufferIndexExceedsLength(sourceIndex, source.Length); @@ -336,6 +351,7 @@ public static void CopyTo(this IBuffer source, uint sourceIndex, IBuffer destina { destination.Length = destinationIndex + count; } +#endif } /// @@ -410,6 +426,9 @@ public static byte[] ToArray(this IBuffer source, uint sourceIndex, int count) /// Thrown if invoking IBufferByteAccess.Buffer on either input buffer fails. public static unsafe bool IsSameData(this IBuffer buffer, [NotNullWhen(true)] IBuffer? otherBuffer) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(buffer); if (otherBuffer is null) @@ -453,6 +472,7 @@ public static unsafe bool IsSameData(this IBuffer buffer, [NotNullWhen(true)] IB // If we got here, it means the buffer is some unrecognized instance we don't know how to unwrap. // Since we're just interested in checking whether the data is the same, we don't need to throw. return false; +#endif } /// @@ -469,6 +489,9 @@ public static unsafe bool IsSameData(this IBuffer buffer, [NotNullWhen(true)] IB /// Thrown if the underlying array that is used can't be accessed. public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else // Note: the naming inconsistency with 'byte[].AsBuffer' is intentional. This extension method will appear on // 'MemoryStream', so consistency with method names on 'MemoryStream' is more important. There we already have // an API called 'GetBuffer,' which returns the underlying array. @@ -486,6 +509,7 @@ public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream) Debug.Assert(stream.Capacity <= int.MaxValue); return new WindowsRuntimeExternalArrayBuffer(arraySegment.Array!, arraySegment.Offset, (int)stream.Length, stream.Capacity); +#endif } /// @@ -523,6 +547,9 @@ public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream) /// Thrown if the underlying array that is used can't be accessed. public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream, int position, int length) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(stream); ArgumentOutOfRangeException.ThrowIfNegative(position); ArgumentOutOfRangeException.ThrowIfNegative(length); @@ -539,6 +566,7 @@ public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream, int posi int bufferLength = Math.Max(0, Math.Min(length, (int)stream.Length - position)); return new WindowsRuntimeExternalArrayBuffer(arraySegment.Array!, bufferOffset, bufferLength, bufferCapacity); +#endif } /// @@ -551,6 +579,9 @@ public static IBuffer GetWindowsRuntimeBuffer(this MemoryStream stream, int posi /// Thrown if invoking IBufferByteAccess.Buffer on either input buffer fails. public static unsafe Stream AsStream(this IBuffer source) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); // If the buffer is backed by a managed array, create a stream around it @@ -567,6 +598,7 @@ public static unsafe Stream AsStream(this IBuffer source) // The buffer is not one we can wrap in a stream throw ArgumentException.GetInvalidIBufferInstanceException(); +#endif } /// @@ -580,6 +612,9 @@ public static unsafe Stream AsStream(this IBuffer source) /// Thrown if invoking IBufferByteAccess.Buffer on either input buffer fails. public static byte GetByte(this IBuffer source, uint byteOffset) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(source); ArgumentException.ThrowIfBufferOffsetOutOfRange(byteOffset, source.Length); @@ -590,5 +625,6 @@ public static byte GetByte(this IBuffer source, uint byteOffset) GC.KeepAlive(source); return value; +#endif } } diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeStreamExtensions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeStreamExtensions.cs index b43c8339f9..5ee69efcb6 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeStreamExtensions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/Extensions/WindowsRuntimeStreamExtensions.cs @@ -21,7 +21,11 @@ public static class WindowsRuntimeStreamExtensions /// Thrown if is . public static Stream AsStreamForRead(this IInputStream windowsRuntimeStream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, WindowsRuntimeIOHelpers.DefaultBufferSize, nameof(AsStreamForRead), forceBufferSize: false); +#endif } /// @@ -34,7 +38,11 @@ public static Stream AsStreamForRead(this IInputStream windowsRuntimeStream) /// Thrown if is negative. public static Stream AsStreamForRead(this IInputStream windowsRuntimeStream, int bufferSize) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, bufferSize, nameof(AsStreamForRead), forceBufferSize: true); +#endif } /// @@ -45,7 +53,11 @@ public static Stream AsStreamForRead(this IInputStream windowsRuntimeStream, int /// Thrown if is . public static Stream AsStreamForWrite(this IOutputStream windowsRuntimeStream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, WindowsRuntimeIOHelpers.DefaultBufferSize, nameof(AsStreamForWrite), forceBufferSize: false); +#endif } /// @@ -58,7 +70,11 @@ public static Stream AsStreamForWrite(this IOutputStream windowsRuntimeStream) /// Thrown if is negative. public static Stream AsStreamForWrite(this IOutputStream windowsRuntimeStream, int bufferSize) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, bufferSize, nameof(AsStreamForWrite), forceBufferSize: true); +#endif } /// @@ -69,7 +85,11 @@ public static Stream AsStreamForWrite(this IOutputStream windowsRuntimeStream, i /// Thrown if is . public static Stream AsStream(this IRandomAccessStream windowsRuntimeStream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, WindowsRuntimeIOHelpers.DefaultBufferSize, nameof(AsStream), forceBufferSize: false); +#endif } /// @@ -82,7 +102,11 @@ public static Stream AsStream(this IRandomAccessStream windowsRuntimeStream) /// Thrown if is negative. public static Stream AsStream(this IRandomAccessStream windowsRuntimeStream, int bufferSize) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else return WindowsRuntimeStreamMapping.AsManagedStream(windowsRuntimeStream, bufferSize, nameof(AsStream), forceBufferSize: true); +#endif } /// @@ -94,10 +118,14 @@ public static Stream AsStream(this IRandomAccessStream windowsRuntimeStream, int /// Thrown if does not support reading. public static IInputStream AsInputStream(this Stream stream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(stream); NotSupportedException.ThrowIfStreamCannotConvertToInputStream(stream.CanRead); return (IInputStream)WindowsRuntimeStreamMapping.AsNativeStream(stream); +#endif } /// @@ -109,10 +137,14 @@ public static IInputStream AsInputStream(this Stream stream) /// Thrown if does not support writing. public static IOutputStream AsOutputStream(this Stream stream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(stream); NotSupportedException.ThrowIfStreamCannotConvertToOutputStream(stream.CanWrite); return (IOutputStream)WindowsRuntimeStreamMapping.AsNativeStream(stream); +#endif } /// @@ -124,9 +156,13 @@ public static IOutputStream AsOutputStream(this Stream stream) /// Thrown if does not support seeking. public static IRandomAccessStream AsRandomAccessStream(this Stream stream) { +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY + throw null; +#else ArgumentNullException.ThrowIfNull(stream); NotSupportedException.ThrowIfStreamCannotConvertToRandomAccessStream(stream.CanSeek); return (IRandomAccessStream)WindowsRuntimeStreamMapping.AsNativeStream(stream); +#endif } } From 34c68027073830e8adff11fd335ce65b28e883e4 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 17 Apr 2026 13:50:48 -0700 Subject: [PATCH 16/28] Add StructLayout attributes and suppress CS1574 Mark interop structs with [StructLayout(LayoutKind.Sequential)] to ensure correct memory layout for COM/WinRT interop: ComCallData, HSTRING_HEADER, and its nested union. Add missing System.Runtime.InteropServices using directives. Also disable CS1574 in WindowsRuntimeFeatureSwitches.cs to suppress documentation reference warnings. --- src/WinRT.Runtime2/InteropServices/Platform/ComCallData.cs | 3 +++ src/WinRT.Runtime2/InteropServices/Platform/HSTRING_HEADER.cs | 4 ++++ .../Properties/WindowsRuntimeFeatureSwitches.cs | 2 ++ 3 files changed, 9 insertions(+) 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/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; /// From 6726a393da60b3742797e6e932b7c5e13378c835 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 29 Mar 2026 18:21:08 -0700 Subject: [PATCH 17/28] Update WinRT.Runtime for ref assemblies Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- .../CsWinRT-Build-Steps.yml | 19 ++++++++++++++++++ .../CsWinRT-PublishToNuGet-Steps.yml | 2 +- nuget/Microsoft.Windows.CsWinRT.nuspec | 1 + src/build.cmd | 20 ++++++++++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-) 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/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/build.cmd b/src/build.cmd index 2941abefaf..388577d0f6 100644 --- a/src/build.cmd +++ b/src/build.cmd @@ -119,6 +119,23 @@ if ErrorLevel 1 ( ) rem skip tests for now +goto :build_runtime_ref + +:build_runtime_ref +rem Build WinRT.Runtime with CsWinRTBuildReferenceAssembly to generate the reference assembly with +rem implementation detail types stripped out. The reference assembly is produced separately from +rem the main solution build so it can be staged before the implementation assembly overwrites it. +echo Building WinRT.Runtime reference assembly +call :exec %msbuild_path%msbuild.exe %cswinrt_build_params% /p:platform=%cswinrt_platform%;configuration=%cswinrt_configuration%;VersionNumber=%cswinrt_version_number%;VersionString=%cswinrt_version_string%;AssemblyVersionNumber=%cswinrt_assembly_version%;CsWinRTBuildReferenceAssembly=true %this_dir%WinRT.Runtime2\WinRT.Runtime.csproj +if ErrorLevel 1 ( + echo. + echo ERROR: Reference assembly build failed + exit /b !ErrorLevel! +) +rem Stage the reference assembly before rebuilding without ProduceReferenceAssembly +set net10_runtime_ref_staging=%this_dir%_build\%cswinrt_platform%\%cswinrt_configuration%\WinRT.Runtime\ref\ +if not exist "%net10_runtime_ref_staging%" mkdir "%net10_runtime_ref_staging%" +copy /y "%this_dir%WinRT.Runtime2\obj\%cswinrt_platform%\%cswinrt_configuration%\net10.0\ref\WinRT.Runtime.dll" "%net10_runtime_ref_staging%WinRT.Runtime.dll" goto :package if "%cswinrt_platform%" NEQ "arm" ( @@ -254,6 +271,7 @@ set cswinrt_exe=%cswinrt_bin_dir%cswinrt.exe set interop_winmd=%cswinrt_bin_dir%WindowsRuntime.Internal.winmd set net10_runtime=%this_dir%WinRT.Runtime2\bin\%cswinrt_configuration%\net10.0\WinRT.Runtime.dll set net10_runtime_xml=%this_dir%WinRT.Runtime2\bin\%cswinrt_configuration%\net10.0\WinRT.Runtime.xml +set net10_runtime_ref=%this_dir%_build\%cswinrt_platform%\%cswinrt_configuration%\WinRT.Runtime2\ref\WinRT.Runtime.dll set source_generator_roslyn4120=%this_dir%Authoring\WinRT.SourceGenerator.Roslyn4120\bin\%cswinrt_configuration%\netstandard2.0\WinRT.SourceGenerator.dll set source_generator=%this_dir%Authoring\WinRT.SourceGenerator2\bin\%cswinrt_configuration%\net10.0\WinRT.SourceGenerator.dll set winrt_host_%cswinrt_platform%=%this_dir%_build\%cswinrt_platform%\%cswinrt_configuration%\WinRT.Host\bin\WinRT.Host.dll @@ -267,7 +285,7 @@ set run_cswinrt_generator_task=%this_dir%WinRT.Generator.Tasks\bin\%cswinrt_conf rem Now call pack echo Creating nuget package -call :exec %nuget_dir%\nuget pack %this_dir%..\nuget\Microsoft.Windows.CsWinRT.nuspec -Properties cswinrt_exe=%cswinrt_exe%;interop_winmd=%interop_winmd%;net10_runtime=%net10_runtime%;net10_runtime_xml=%net10_runtime_xml%;source_generator=%source_generator%;cswinrt_nuget_version=%cswinrt_version_string%;winrt_host_x86=%winrt_host_x86%;winrt_host_x64=%winrt_host_x64%;winrt_host_arm=%winrt_host_arm%;winrt_host_arm64=%winrt_host_arm64%;winrt_host_resource_x86=%winrt_host_resource_x86%;winrt_host_resource_x64=%winrt_host_resource_x64%;winrt_host_resource_arm=%winrt_host_resource_arm%;winrt_host_resource_arm64=%winrt_host_resource_arm64%;winrt_shim=%winrt_shim%;cswinrtinteropgen_x64=%cswinrtinteropgen_x64%;cswinrtinteropgen_arm64=%cswinrtinteropgen_arm64%;cswinrtimplgen_x64=%cswinrtimplgen_x64%;cswinrtimplgen_arm64=%cswinrtimplgen_arm64%;cswinrtprojectiongen_x64=%cswinrtprojectiongen_x64%;cswinrtprojectiongen_arm64=%cswinrtprojectiongen_arm64%;run_cswinrt_generator_task=%run_cswinrt_generator_task%; -OutputDirectory %cswinrt_bin_dir% -NonInteractive -Verbosity Detailed -NoPackageAnalysis +call :exec %nuget_dir%\nuget pack %this_dir%..\nuget\Microsoft.Windows.CsWinRT.nuspec -Properties cswinrt_exe=%cswinrt_exe%;interop_winmd=%interop_winmd%;net10_runtime=%net10_runtime%;net10_runtime_xml=%net10_runtime_xml%;net10_runtime_ref=%net10_runtime_ref%;source_generator=%source_generator%;cswinrt_nuget_version=%cswinrt_version_string%;winrt_host_x86=%winrt_host_x86%;winrt_host_x64=%winrt_host_x64%;winrt_host_arm=%winrt_host_arm%;winrt_host_arm64=%winrt_host_arm64%;winrt_host_resource_x86=%winrt_host_resource_x86%;winrt_host_resource_x64=%winrt_host_resource_x64%;winrt_host_resource_arm=%winrt_host_resource_arm%;winrt_host_resource_arm64=%winrt_host_resource_arm64%;winrt_shim=%winrt_shim%;cswinrtinteropgen_x64=%cswinrtinteropgen_x64%;cswinrtinteropgen_arm64=%cswinrtinteropgen_arm64%;cswinrtimplgen_x64=%cswinrtimplgen_x64%;cswinrtimplgen_arm64=%cswinrtimplgen_arm64%;cswinrtprojectiongen_x64=%cswinrtprojectiongen_x64%;cswinrtprojectiongen_arm64=%cswinrtprojectiongen_arm64%;run_cswinrt_generator_task=%run_cswinrt_generator_task%; -OutputDirectory %cswinrt_bin_dir% -NonInteractive -Verbosity Detailed -NoPackageAnalysis call :exec %nuget_dir%\nuget pack %this_dir%..\nuget\Microsoft.Windows.CsWinMD.nuspec -Properties cswinmd_outpath=%cswinmd_outpath%;source_generator_roslyn4120=%source_generator_roslyn4120%;cswinmd_nuget_version=%cswinrt_version_string%; -OutputDirectory %cswinrt_bin_dir% -NonInteractive -Verbosity Detailed -NoPackageAnalysis goto :eof From 9dc65c832113a75ff6dfbd6ab70db35863adb150 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 29 Mar 2026 20:00:03 -0700 Subject: [PATCH 18/28] Delete CSWINRT3001 diagnostic documentation This diagnostic is no longer applicable now that the private implementation detail [Obsolete] attributes have been removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/diagnostics/cswinrt30001.md | 34 -------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 docs/diagnostics/cswinrt30001.md 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). From c257126249f476d6d64593bc595a122f73c0acc4 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 29 Mar 2026 20:05:18 -0700 Subject: [PATCH 19/28] Update instructions for reference assembly approach Update copilot-instructions.md and interop-generator SKILL.md to reflect that private implementation detail types are now excluded from the reference assembly via #if !REFERENCE_ASSEMBLY, rather than being marked with [Obsolete] and [EditorBrowsable(Never)] attributes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 4 ++-- .github/skills/interop-generator/SKILL.md | 2 +- .github/skills/update-copilot-instructions/SKILL.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2c0342712f..6264051228 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 via `#if !REFERENCE_ASSEMBLY`. The normal build produces the full implementation assembly (for `lib\net10.0\`). 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..db7c5a0d74 100644 --- a/.github/skills/interop-generator/SKILL.md +++ b/.github/skills/interop-generator/SKILL.md @@ -32,7 +32,7 @@ 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 `#if !REFERENCE_ASSEMBLY`), 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. ## Project settings diff --git a/.github/skills/update-copilot-instructions/SKILL.md b/.github/skills/update-copilot-instructions/SKILL.md index 433b0c1c90..f482e40806 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`, `#if !REFERENCE_ASSEMBLY`) is accurately described - Namespace organization matches 2. **WinRT.SourceGenerator2 (`src/Authoring/WinRT.SourceGenerator2/`)** From 934e7e6c8d6d584b21110219632b889b287a367c Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 29 Mar 2026 20:08:37 -0700 Subject: [PATCH 20/28] Document private implementation detail APIs in interop generator skill Expand the version compatibility section to explain how the interop generator uses WinRT.Runtime's implementation assembly (not the reference assembly) to access private implementation detail APIs, with concrete examples of the type categories involved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/skills/interop-generator/SKILL.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/skills/interop-generator/SKILL.md b/.github/skills/interop-generator/SKILL.md index db7c5a0d74..c82eac2a15 100644 --- a/.github/skills/interop-generator/SKILL.md +++ b/.github/skills/interop-generator/SKILL.md @@ -34,6 +34,23 @@ The `WinRT.Interop.dll` assembly is produced by `cswinrtinteropgen`, which is a 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 `#if !REFERENCE_ASSEMBLY`), 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 `#if !REFERENCE_ASSEMBLY`, so consumers never see them. + +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 - **Target**: `net10.0`, C# 14, `AllowUnsafeBlocks` From b9d00bdd6e5c35e3437ae79c2ea4eece9f61092d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 17 Apr 2026 14:19:17 -0700 Subject: [PATCH 21/28] Correct reference assembly mechanism in skills/instructions Update copilot-instructions.md and the interop-generator and update-copilot-instructions skills to describe the actual mechanism used to build the WinRT.Runtime reference assembly: the WINDOWS_RUNTIME_REFERENCE_ASSEMBLY and WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY define constants, the [WindowsRuntimeImplementationOnlyMember] attribute (which triggers MSBuild file removal), the #define WINDOWS_RUNTIME_IMPLEMENTATION_ONLY_FILE opt-out, and the wholesale folder removals. Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- .github/skills/interop-generator/SKILL.md | 4 ++-- .github/skills/update-copilot-instructions/SKILL.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 6264051228..c80ba05162 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -168,7 +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 via `#if !REFERENCE_ASSEMBLY`. The normal build produces the full implementation assembly (for `lib\net10.0\`). This replaces the previous approach of marking implementation details with `[Obsolete]` and `[EditorBrowsable(Never)]` attributes. +- **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:** diff --git a/.github/skills/interop-generator/SKILL.md b/.github/skills/interop-generator/SKILL.md index c82eac2a15..cd2193d6d0 100644 --- a/.github/skills/interop-generator/SKILL.md +++ b/.github/skills/interop-generator/SKILL.md @@ -32,11 +32,11 @@ 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 internal implementation detail APIs in `WinRT.Runtime.dll` — APIs which are public in the implementation assembly but excluded from the reference assembly (via `#if !REFERENCE_ASSEMBLY`), 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 `#if !REFERENCE_ASSEMBLY`, so consumers never see them. +`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: diff --git a/.github/skills/update-copilot-instructions/SKILL.md b/.github/skills/update-copilot-instructions/SKILL.md index f482e40806..63dd24f8d8 100644 --- a/.github/skills/update-copilot-instructions/SKILL.md +++ b/.github/skills/update-copilot-instructions/SKILL.md @@ -26,7 +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`, `#if !REFERENCE_ASSEMBLY`) is accurately described + - 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/`)** From 34f28eaa4ab5bdf348de2f39567ddbdcf1ba511e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 18 Apr 2026 18:40:09 -0700 Subject: [PATCH 22/28] Exclude Exceptions folder from build Add a entry to src/WinRT.Runtime2/WinRT.Runtime.csproj to exclude Exceptions/**/*.cs from compilation. This matches other implementation-only folders removed from the project (e.g. ABI, InteropServices) to minimize the number of code changes and reduce the build surface. --- src/WinRT.Runtime2/WinRT.Runtime.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WinRT.Runtime2/WinRT.Runtime.csproj b/src/WinRT.Runtime2/WinRT.Runtime.csproj index 34d2f38498..3a9d32d392 100644 --- a/src/WinRT.Runtime2/WinRT.Runtime.csproj +++ b/src/WinRT.Runtime2/WinRT.Runtime.csproj @@ -140,6 +140,7 @@ + From 1f69db5edd3b09fae4bb9079b84b23dfa12bb22a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 18 Apr 2026 18:44:58 -0700 Subject: [PATCH 23/28] Strip WindowsRuntimeClassName attribute from reference assembly Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../InteropServices/Events/EventRegistrationToken.cs | 2 -- .../Windows.Foundation/AsyncActionCompletedHandler.cs | 2 +- src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 2 -- .../Windows.Foundation/Collections/CollectionChange.cs | 2 -- src/WinRT.Runtime2/Windows.Foundation/Point.cs | 2 -- src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 2 -- src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 2 -- src/WinRT.Runtime2/Windows.Foundation/Size.cs | 2 -- .../Windows.Storage.Streams/InputStreamOptions.cs | 2 -- 9 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs index 00d0db4610..c31ba3e0e7 100644 --- a/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs +++ b/src/WinRT.Runtime2/InteropServices/Events/EventRegistrationToken.cs @@ -13,9 +13,7 @@ namespace WindowsRuntime.InteropServices; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(EventRegistrationToken?))] [ABI.WindowsRuntime.InteropServices.EventRegistrationTokenComWrappersMarshaller] #endif diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs index 2bc6e85358..825e6eb9d1 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs @@ -15,8 +15,8 @@ namespace Windows.Foundation; /// One of the enumeration values. #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] +#endif #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] #elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs index e6cfaa7faa..ac5e2391a4 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs @@ -15,9 +15,7 @@ namespace Windows.Foundation; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(AsyncStatus?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs index f8c3694f2e..2a338dbc33 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs @@ -21,9 +21,7 @@ namespace Windows.Foundation.Collections; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadataTypeName("Windows.Foundation.Collections.CollectionChange")] [WindowsRuntimeReferenceType(typeof(CollectionChange?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index d5b284b8da..0d1d75695e 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -21,9 +21,7 @@ namespace Windows.Foundation; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Point?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] diff --git a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs index 8b176e6ad0..7f2220c7aa 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs @@ -15,9 +15,7 @@ namespace Windows.Foundation; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(PropertyType?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index e44a7a1345..b568e70558 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -23,9 +23,7 @@ namespace Windows.Foundation; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Rect?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] diff --git a/src/WinRT.Runtime2/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/Windows.Foundation/Size.cs index 67b9a3114d..80a994bdd8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Size.cs @@ -20,9 +20,7 @@ namespace Windows.Foundation; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(Size?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs index d91e24182c..2d20fcf1c9 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs @@ -18,9 +18,7 @@ namespace Windows.Storage.Streams; [Flags] #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeReferenceType(typeof(InputStreamOptions?))] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] From efda739561d172494fbdd2771c96b9c1a312d001 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 18 Apr 2026 19:15:50 -0700 Subject: [PATCH 24/28] Merge adjacent ifdef blocks where attribute order is preserved Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Windows.Foundation/AsyncActionCompletedHandler.cs | 6 ++---- src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 4 +--- .../Windows.Foundation/Collections/CollectionChange.cs | 4 +--- src/WinRT.Runtime2/Windows.Foundation/Point.cs | 4 +--- src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 4 +--- src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 4 +--- src/WinRT.Runtime2/Windows.Foundation/Size.cs | 4 +--- .../Windows.Storage.Streams/InputStreamOptions.cs | 4 +--- 8 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs index 825e6eb9d1..9ab29608bd 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionCompletedHandler.cs @@ -13,13 +13,11 @@ namespace Windows.Foundation; /// /// The asynchronous operation. /// One of the enumeration values. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -[WindowsRuntimeClassName("Windows.Foundation.IReference`1")] -#endif #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] #elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] +[WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [ABI.Windows.Foundation.AsyncActionCompletedHandlerComWrappersMarshaller] #endif public delegate void AsyncActionCompletedHandler(IAsyncAction asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs index ac5e2391a4..50c190065d 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs @@ -17,13 +17,11 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(AsyncStatus?))] +[ABI.Windows.Foundation.AsyncStatusComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.AsyncStatusComWrappersMarshaller] -#endif public enum AsyncStatus { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs index 2a338dbc33..0b97ddc579 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs @@ -24,13 +24,11 @@ namespace Windows.Foundation.Collections; [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeMetadataTypeName("Windows.Foundation.Collections.CollectionChange")] [WindowsRuntimeReferenceType(typeof(CollectionChange?))] +[ABI.Windows.Foundation.Collections.CollectionChangeComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.Collections.CollectionChangeComWrappersMarshaller] -#endif public enum CollectionChange { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index 0d1d75695e..12959a7163 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -23,13 +23,11 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Point?))] +[ABI.Windows.Foundation.PointComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.PointComWrappersMarshaller] -#endif public struct Point : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs index 7f2220c7aa..9fa38e86c9 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs @@ -17,13 +17,11 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(PropertyType?))] +[ABI.Windows.Foundation.PropertyTypeComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.PropertyTypeComWrappersMarshaller] -#endif public enum PropertyType { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index b568e70558..1b3f3e0f18 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -25,13 +25,11 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Rect?))] +[ABI.Windows.Foundation.RectComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.RectComWrappersMarshaller] -#endif public struct Rect : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/Windows.Foundation/Size.cs index 80a994bdd8..77c5d3e182 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Size.cs @@ -22,13 +22,11 @@ namespace Windows.Foundation; [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Size?))] +[ABI.Windows.Foundation.SizeComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Foundation.SizeComWrappersMarshaller] -#endif public struct Size : IEquatable, IFormattable { /// diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs index 2d20fcf1c9..a9622132f7 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs @@ -20,13 +20,11 @@ namespace Windows.Storage.Streams; [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(InputStreamOptions?))] +[ABI.Windows.Storage.Streams.InputStreamOptionsComWrappersMarshaller] #elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(UniversalApiContract), 65536u)] #endif -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[ABI.Windows.Storage.Streams.InputStreamOptionsComWrappersMarshaller] -#endif public enum InputStreamOptions : uint { /// From 7df976bdef1ee1db42bd6de1717bf78eab193cd8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 18 Apr 2026 20:02:13 -0700 Subject: [PATCH 25/28] Put REFERENCE_ASSEMBLY branch first in conditional attribute blocks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../AsyncActionProgressHandler{TProgress}.cs | 6 +++--- .../AsyncActionWithProgressCompletedHandler{TProgress}.cs | 6 +++--- .../AsyncOperationCompletedHandler{TResult}.cs | 6 +++--- .../AsyncOperationProgressHandler{TResult, TProgress}.cs | 6 +++--- ...ionWithProgressCompletedHandler{TResult, TProgress}.cs | 6 +++--- src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs | 8 ++++---- .../Windows.Foundation/Collections/CollectionChange.cs | 8 ++++---- .../Collections/MapChangedEventHandler{K, V}.cs | 6 +++--- .../Collections/VectorChangedEventHandler{T}.cs | 6 +++--- src/WinRT.Runtime2/Windows.Foundation/Point.cs | 8 ++++---- src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs | 8 ++++---- src/WinRT.Runtime2/Windows.Foundation/Rect.cs | 8 ++++---- src/WinRT.Runtime2/Windows.Foundation/Size.cs | 8 ++++---- .../Windows.Storage.Streams/InputStreamOptions.cs | 8 ++++---- 14 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs index a10baad4ea..15588c5054 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionProgressHandler{TProgress}.cs @@ -14,9 +14,9 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// The progress information. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void AsyncActionProgressHandler(IAsyncActionWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs index b8b845d9d6..44ece01fc6 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncActionWithProgressCompletedHandler{TProgress}.cs @@ -14,9 +14,9 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// One of the enumeration values. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void AsyncActionWithProgressCompletedHandler(IAsyncActionWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs index baa3e4ba49..a8bff10332 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationCompletedHandler{TResult}.cs @@ -14,9 +14,9 @@ namespace Windows.Foundation; /// The result type. /// The asynchronous action. /// One of the enumeration values. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void AsyncOperationCompletedHandler(IAsyncOperation asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs index b41fda9842..a64d72eef8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationProgressHandler{TResult, TProgress}.cs @@ -15,9 +15,9 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// The progress information. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void AsyncOperationProgressHandler(IAsyncOperationWithProgress asyncInfo, TProgress progressInfo); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs index 05c1fc0360..6795f337fc 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncOperationWithProgressCompletedHandler{TResult, TProgress}.cs @@ -15,9 +15,9 @@ namespace Windows.Foundation; /// The type of progress information. /// The asynchronous action. /// One of the enumeration values. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void AsyncOperationWithProgressCompletedHandler(IAsyncOperationWithProgress asyncInfo, AsyncStatus asyncStatus); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs index 50c190065d..aa8934b50a 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/AsyncStatus.cs @@ -13,14 +13,14 @@ namespace Windows.Foundation; /// Represents the status for an asynchronous operation. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(AsyncStatus?))] [ABI.Windows.Foundation.AsyncStatusComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public enum AsyncStatus { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs index 0b97ddc579..812e2490cb 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/CollectionChange.cs @@ -19,15 +19,15 @@ namespace Windows.Foundation.Collections; /// property to determine the location of the change. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeMetadataTypeName("Windows.Foundation.Collections.CollectionChange")] [WindowsRuntimeReferenceType(typeof(CollectionChange?))] [ABI.Windows.Foundation.Collections.CollectionChangeComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public enum CollectionChange { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs index aa39ae6264..c8c66a6b36 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/MapChangedEventHandler{K, V}.cs @@ -15,9 +15,9 @@ namespace Windows.Foundation.Collections; /// The type of values in the observable map. /// The observable map that changed. /// The description of the change that occurred in the map. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void MapChangedEventHandler(IObservableMap sender, IMapChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs index e2693b1206..04bb4ae807 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/VectorChangedEventHandler{T}.cs @@ -14,9 +14,9 @@ namespace Windows.Foundation.Collections; /// The type of elements in the observable vector. /// The observable vector that changed. /// The description of the change that occurred in the vector. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public delegate void VectorChangedEventHandler(IObservableVector sender, IVectorChangedEventArgs @event); \ No newline at end of file diff --git a/src/WinRT.Runtime2/Windows.Foundation/Point.cs b/src/WinRT.Runtime2/Windows.Foundation/Point.cs index 12959a7163..cbb16c7dcf 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Point.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Point.cs @@ -19,14 +19,14 @@ namespace Windows.Foundation; /// Represents X and Y coordinate values that define a point in a two-dimensional plane. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Point?))] [ABI.Windows.Foundation.PointComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public struct Point : IEquatable, IFormattable { diff --git a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs index 9fa38e86c9..8268acd583 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/PropertyType.cs @@ -13,14 +13,14 @@ namespace Windows.Foundation; /// Specifies property value types. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(PropertyType?))] [ABI.Windows.Foundation.PropertyTypeComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public enum PropertyType { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs index 1b3f3e0f18..93892e9347 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Rect.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Rect.cs @@ -21,14 +21,14 @@ namespace Windows.Foundation; /// Contains number values that represent the location and size of a rectangle. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Rect?))] [ABI.Windows.Foundation.RectComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public struct Rect : IEquatable, IFormattable { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Size.cs b/src/WinRT.Runtime2/Windows.Foundation/Size.cs index 77c5d3e182..6e8b344177 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Size.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Size.cs @@ -18,14 +18,14 @@ namespace Windows.Foundation; /// Represents number values that specify a height and width. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(Size?))] [ABI.Windows.Foundation.SizeComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(FoundationContract), 65536u)] #endif public struct Size : IEquatable, IFormattable { diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs index a9622132f7..4961feeed1 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/InputStreamOptions.cs @@ -16,14 +16,14 @@ namespace Windows.Storage.Streams; /// /// [Flags] -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +[SupportedOSPlatform("Windows10.0.10240.0")] +[ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] [WindowsRuntimeClassName("Windows.Foundation.IReference`1")] [WindowsRuntimeReferenceType(typeof(InputStreamOptions?))] [ABI.Windows.Storage.Streams.InputStreamOptionsComWrappersMarshaller] -#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY -[SupportedOSPlatform("Windows10.0.10240.0")] -[ContractVersion(typeof(UniversalApiContract), 65536u)] #endif public enum InputStreamOptions : uint { From 08055488c71b56e2b2fdddf3a15e865e63fdd505 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 19 Apr 2026 16:44:40 -0700 Subject: [PATCH 26/28] Put [Guid] attribute first on interfaces and merge ifdef blocks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Collections/IMapChangedEventArgs{K}.cs | 5 ++--- .../Windows.Foundation/Collections/IObservableMap{K, V}.cs | 5 ++--- .../Windows.Foundation/Collections/IObservableVector{T}.cs | 5 ++--- .../Collections/IVectorChangedEventArgs.cs | 5 ++--- src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs | 5 ++--- .../IAsyncActionWithProgress{TProgress}.cs | 5 ++--- src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs | 5 ++--- .../IAsyncOperationWithProgress{TResult, TProgress}.cs | 5 ++--- .../Windows.Foundation/IAsyncOperation{TResult}.cs | 5 ++--- .../Windows.Foundation/IMemoryBufferReference.cs | 5 ++--- src/WinRT.Runtime2/Windows.Foundation/IStringable.cs | 5 ++--- src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs | 5 ++--- src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs | 5 ++--- src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs | 5 ++--- .../Windows.Storage.Streams/IRandomAccessStream.cs | 5 ++--- 15 files changed, 30 insertions(+), 45 deletions(-) diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs index 9f44d796b9..d84ddd8d03 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs @@ -13,12 +13,11 @@ namespace Windows.Foundation.Collections; /// Provides data for the changed event of a map collection. /// /// The type of keys in the map. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("9939F4DF-050A-4C0F-AA60-77075F9C4777")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IMapChangedEventArgs { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs index 2e3e9f5c56..122d1a40c5 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs @@ -16,12 +16,11 @@ namespace Windows.Foundation.Collections; /// /// The type of keys in the observable map. /// The type of values in the observable map. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("65DF2BF5-BF39-41B5-AEBC-5A9D865E472B")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IObservableMap : IDictionary, ICollection>, IEnumerable>, IEnumerable { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs index 039196938a..04bb276b81 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs @@ -15,12 +15,11 @@ namespace Windows.Foundation.Collections; /// Notifies listeners of changes to the vector. /// /// The type of elements in the observable vector. -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("5917EB53-50B4-4A0D-B309-65862B3F1DBC")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IObservableVector : IList, ICollection, IEnumerable, IEnumerable { diff --git a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs index 3795537e89..be5dac0673 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs @@ -12,12 +12,11 @@ namespace Windows.Foundation.Collections; /// /// Provides data for the changed event of a vector. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("575933DF-34FE-4480-AF15-07691F3D5D9B")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IVectorChangedEventArgs { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs index c2665eddd7..adb173307c 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs @@ -19,12 +19,11 @@ namespace Windows.Foundation; /// by is invoked, and this is the only result from the action. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("5A648006-843A-4DA9-865B-9D26E5DFAD7B")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IAsyncAction : IAsyncInfo { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs index d95d26ff72..331cf989c5 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs @@ -20,12 +20,11 @@ namespace Windows.Foundation; /// of these as there are methods that use , whose APIs don't report progress and don't have a result. /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("1F6DB258-E803-48A1-9546-EB7353398884")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IAsyncActionWithProgress : IAsyncInfo { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs index 515d28d851..889596a1ac 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs @@ -13,12 +13,11 @@ namespace Windows.Foundation; /// /// Provides support for asynchronous operations. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("00000036-0000-0000-C000-000000000046")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IAsyncInfo { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs index 2ea855a547..588e399700 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs @@ -22,12 +22,11 @@ namespace Windows.Foundation; /// use another interface, . /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("B5D036D7-E297-498F-BA60-0289E76E23DD")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IAsyncOperationWithProgress : IAsyncInfo { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs index 3ff5e3bc4b..4f085a6ce8 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs @@ -20,12 +20,11 @@ namespace Windows.Foundation; /// progress and have a result use another interface, . /// /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("9FC2B0BB-E446-44E2-AA61-9CAB8F636AF2")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IAsyncOperation : IAsyncInfo { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs index 769e1a616e..f0a6fef368 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs @@ -13,12 +13,11 @@ namespace Windows.Foundation; /// /// Represents a reference to an IMemoryBuffer object. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [Guid("FBC4DD29-245B-11E4-AF98-689423260CF8")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif public interface IMemoryBufferReference : IDisposable { diff --git a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs index f2099d537f..8bbae45779 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/IStringable.cs @@ -18,12 +18,11 @@ namespace Windows.Foundation; /// method. When exposed to native code, they will implicitly get an implementation /// of that will call the managed override. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif [Guid("96369F54-8EB6-48F0-ABCE-C1B211E627C3")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(FoundationContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] #endif public interface IStringable { diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs index c98f77d847..f3512b3d0f 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IBuffer.cs @@ -14,12 +14,11 @@ namespace Windows.Storage.Streams; /// /// Represents a referenced array of bytes used by byte stream read and write interfaces. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [Guid("905A0FE0-BC53-11DF-8C49-001E4FC686DA")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif public interface IBuffer { diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs index 2d872fcc51..2ac73d2111 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IInputStream.cs @@ -14,12 +14,11 @@ namespace Windows.Storage.Streams; /// /// Represents a sequential stream of bytes to be read. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [Guid("905A0FE2-BC53-11DF-8C49-001E4FC686DA")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif public interface IInputStream : IDisposable { diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs index b94873b12f..75d02c2c4e 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IOutputStream.cs @@ -14,12 +14,11 @@ namespace Windows.Storage.Streams; /// /// Represents a sequential stream of bytes to be written. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [Guid("905A0FE6-BC53-11DF-8C49-001E4FC686DA")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif public interface IOutputStream : IDisposable { diff --git a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs index f6a28373c9..bac93ee020 100644 --- a/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs +++ b/src/WinRT.Runtime2/Windows.Storage.Streams/IRandomAccessStream.cs @@ -14,12 +14,11 @@ namespace Windows.Storage.Streams; /// /// Supports random access of data in input and output streams. /// -#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY -[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] -#endif [Guid("905A0FE1-BC53-11DF-8C49-001E4FC686DA")] #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ContractVersion(typeof(UniversalApiContract), 65536u)] +#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY +[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")] #endif public interface IRandomAccessStream : IDisposable, IInputStream, IOutputStream { From b89f76aac3f8ed8d441e8724d86237f623ee3d29 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 27 Apr 2026 13:53:25 -0700 Subject: [PATCH 27/28] Refactor WinRT metadata attributes and conditionals Adjust conditional compilation and attribute placement for WinRT metadata types. Add conditional import of System.Runtime.Versioning and split ApiContractAttribute between implementation (WindowsRuntimeMetadata) and reference (SupportedOSPlatform + ContractVersion) builds, moving AttributeUsage to a shared location. Do the same reordering for ContractVersionAttribute, and remove redundant remarks comments from FoundationContract and UniversalApiContract to clean up source. --- .../Windows.Foundation/FoundationContract.cs | 3 --- .../Windows.Foundation/Metadata/ApiContractAttribute.cs | 7 ++++++- .../Metadata/ContractVersionAttribute.cs | 5 ++--- .../Windows.Foundation/UniversalApiContract.cs | 3 --- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs b/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs index 19afc30041..2c40d916cf 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/FoundationContract.cs @@ -10,9 +10,6 @@ namespace Windows.Foundation; /// /// Represents the Windows Foundation API contract. /// -/// -/// This type is required for ABI projection of the value types and delegates, but marshalling it is not supported. -/// #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ApiContract] [ContractVersion(262144u)] diff --git a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ApiContractAttribute.cs b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ApiContractAttribute.cs index d4725d5e7a..6d8f1457fd 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ApiContractAttribute.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ApiContractAttribute.cs @@ -2,7 +2,9 @@ // Licensed under the MIT License. using System; +#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY using System.Runtime.Versioning; +#endif using WindowsRuntime; namespace Windows.Foundation.Metadata; @@ -10,8 +12,11 @@ namespace Windows.Foundation.Metadata; /// /// Specifies that the type represents an API contract. /// +#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -[AttributeUsage(AttributeTargets.Enum, AllowMultiple = false)] +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] +#endif +[AttributeUsage(AttributeTargets.Enum, AllowMultiple = false)] public sealed class ApiContractAttribute : Attribute; diff --git a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs index 4be70b4cf7..6625d14244 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/Metadata/ContractVersionAttribute.cs @@ -16,12 +16,11 @@ namespace Windows.Foundation.Metadata; /// #if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY [WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")] -#endif -[AttributeUsage(AttributeTargets.All, AllowMultiple = true)] -#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY +#elif WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [SupportedOSPlatform("Windows10.0.10240.0")] [ContractVersion(typeof(FoundationContract), 65536u)] #endif +[AttributeUsage(AttributeTargets.All, AllowMultiple = true)] public sealed class ContractVersionAttribute : Attribute { /// diff --git a/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs b/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs index 090a3c199a..ca9e0cead2 100644 --- a/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs +++ b/src/WinRT.Runtime2/Windows.Foundation/UniversalApiContract.cs @@ -10,9 +10,6 @@ namespace Windows.Foundation; /// /// Represents the Universal API contract. /// -/// -/// This type is required for ABI projection of the value types and delegates, but marshalling it is not supported. -/// #if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY [ApiContract] [ContractVersion(1245184u)] From 73f42a23c6d6c7150b4bdedfd82bdcf6ec6b566b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 27 Apr 2026 13:57:58 -0700 Subject: [PATCH 28/28] Skip emitting [ApiContract] attribute for implementation assemblies Treat [ApiContract] like [ContractVersion] in the metadata attribute filter: only emit it for reference projections and skip it when generating implementation assemblies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/cswinrt/code_writers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cswinrt/code_writers.h b/src/cswinrt/code_writers.h index 7e54fcf9fa..563fe2742f 100644 --- a/src/cswinrt/code_writers.h +++ b/src/cswinrt/code_writers.h @@ -2582,8 +2582,8 @@ remove => %; { allow_multiple = true; } - // ContractVersion is only emitted for reference assemblies - if (attribute_name == "ContractVersion") + // ContractVersion and ApiContract are only emitted for reference assemblies + if (attribute_name == "ContractVersion" || attribute_name == "ApiContract") { if (!settings.reference_projection) {