Skip to content

Commit d83014f

Browse files
Sergio0694Copilot
andcommitted
Put [Guid] attribute first on interfaces and merge ifdef blocks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0b4a5f0 commit d83014f

15 files changed

Lines changed: 30 additions & 45 deletions

src/WinRT.Runtime2/Windows.Foundation/Collections/IMapChangedEventArgs{K}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ namespace Windows.Foundation.Collections;
1313
/// Provides data for the changed event of a map collection.
1414
/// </summary>
1515
/// <typeparam name="K">The type of keys in the map.</typeparam>
16-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
17-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
18-
#endif
1916
[Guid("9939F4DF-050A-4C0F-AA60-77075F9C4777")]
2017
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2118
[ContractVersion(typeof(FoundationContract), 65536u)]
19+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
20+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2221
#endif
2322
public interface IMapChangedEventArgs<K>
2423
{

src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableMap{K, V}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ namespace Windows.Foundation.Collections;
1616
/// </summary>
1717
/// <typeparam name="K">The type of keys in the observable map.</typeparam>
1818
/// <typeparam name="V">The type of values in the observable map.</typeparam>
19-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
20-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
21-
#endif
2219
[Guid("65DF2BF5-BF39-41B5-AEBC-5A9D865E472B")]
2320
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2421
[ContractVersion(typeof(FoundationContract), 65536u)]
22+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
23+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2524
#endif
2625
public interface IObservableMap<K, V> : IDictionary<K, V>, ICollection<KeyValuePair<K, V>>, IEnumerable<KeyValuePair<K, V>>, IEnumerable
2726
{

src/WinRT.Runtime2/Windows.Foundation/Collections/IObservableVector{T}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ namespace Windows.Foundation.Collections;
1515
/// Notifies listeners of changes to the vector.
1616
/// </summary>
1717
/// <typeparam name="T">The type of elements in the observable vector.</typeparam>
18-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
19-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
20-
#endif
2118
[Guid("5917EB53-50B4-4A0D-B309-65862B3F1DBC")]
2219
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2320
[ContractVersion(typeof(FoundationContract), 65536u)]
21+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
22+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2423
#endif
2524
public interface IObservableVector<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
2625
{

src/WinRT.Runtime2/Windows.Foundation/Collections/IVectorChangedEventArgs.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ namespace Windows.Foundation.Collections;
1212
/// <summary>
1313
/// Provides data for the changed event of a vector.
1414
/// </summary>
15-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
16-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
17-
#endif
1815
[Guid("575933DF-34FE-4480-AF15-07691F3D5D9B")]
1916
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2017
[ContractVersion(typeof(FoundationContract), 65536u)]
18+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
19+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2120
#endif
2221
public interface IVectorChangedEventArgs
2322
{

src/WinRT.Runtime2/Windows.Foundation/IAsyncAction.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ namespace Windows.Foundation;
1919
/// by <see cref="Completed"/> is invoked, and this is the only result from the action.
2020
/// </remarks>
2121
/// <see href="https://learn.microsoft.com/uwp/api/windows.foundation.iasyncaction"/>
22-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
23-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
24-
#endif
2522
[Guid("5A648006-843A-4DA9-865B-9D26E5DFAD7B")]
2623
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2724
[ContractVersion(typeof(FoundationContract), 65536u)]
25+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
26+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2827
#endif
2928
public interface IAsyncAction : IAsyncInfo
3029
{

src/WinRT.Runtime2/Windows.Foundation/IAsyncActionWithProgress{TProgress}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ namespace Windows.Foundation;
2020
/// of these as there are methods that use <see cref="IAsyncAction"/>, whose APIs don't report progress and don't have a result.
2121
/// </remarks>
2222
/// <see href="https://learn.microsoft.com/uwp/api/windows.foundation.iasyncactionwithprogress-1"/>
23-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
24-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
25-
#endif
2623
[Guid("1F6DB258-E803-48A1-9546-EB7353398884")]
2724
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2825
[ContractVersion(typeof(FoundationContract), 65536u)]
26+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
27+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2928
#endif
3029
public interface IAsyncActionWithProgress<TProgress> : IAsyncInfo
3130
{

src/WinRT.Runtime2/Windows.Foundation/IAsyncInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ namespace Windows.Foundation;
1313
/// <summary>
1414
/// Provides support for asynchronous operations.
1515
/// </summary>
16-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
17-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
18-
#endif
1916
[Guid("00000036-0000-0000-C000-000000000046")]
2017
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2118
[ContractVersion(typeof(FoundationContract), 65536u)]
19+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
20+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2221
#endif
2322
public interface IAsyncInfo
2423
{

src/WinRT.Runtime2/Windows.Foundation/IAsyncOperationWithProgress{TResult, TProgress}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ namespace Windows.Foundation;
2222
/// use another interface, <see cref="IAsyncOperation{TResult}"/>.
2323
/// </remarks>
2424
/// <see href="https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperationwithprogress-2"/>
25-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
26-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
27-
#endif
2825
[Guid("B5D036D7-E297-498F-BA60-0289E76E23DD")]
2926
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
3027
[ContractVersion(typeof(FoundationContract), 65536u)]
28+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
29+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
3130
#endif
3231
public interface IAsyncOperationWithProgress<TResult, TProgress> : IAsyncInfo
3332
{

src/WinRT.Runtime2/Windows.Foundation/IAsyncOperation{TResult}.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ namespace Windows.Foundation;
2020
/// progress and have a result use another interface, <see cref="IAsyncOperationWithProgress{TResult, TProgress}"/>.
2121
/// </remarks>
2222
/// <see href="https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1"/>
23-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
24-
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
25-
#endif
2623
[Guid("9FC2B0BB-E446-44E2-AA61-9CAB8F636AF2")]
2724
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2825
[ContractVersion(typeof(FoundationContract), 65536u)]
26+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
27+
[WindowsRuntimeMetadata("Windows.Foundation.FoundationContract")]
2928
#endif
3029
public interface IAsyncOperation<TResult> : IAsyncInfo
3130
{

src/WinRT.Runtime2/Windows.Foundation/IMemoryBufferReference.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ namespace Windows.Foundation;
1313
/// <summary>
1414
/// Represents a reference to an <see href="https://learn.microsoft.com/uwp/api/windows.foundation.imemorybuffer"><c>IMemoryBuffer</c></see> object.
1515
/// </summary>
16-
#if WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
17-
[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")]
18-
#endif
1916
[Guid("FBC4DD29-245B-11E4-AF98-689423260CF8")]
2017
#if WINDOWS_RUNTIME_REFERENCE_ASSEMBLY
2118
[ContractVersion(typeof(UniversalApiContract), 65536u)]
19+
#elif WINDOWS_RUNTIME_IMPLEMENTATION_ASSEMBLY
20+
[WindowsRuntimeMetadata("Windows.Foundation.UniversalApiContract")]
2221
#endif
2322
public interface IMemoryBufferReference : IDisposable
2423
{

0 commit comments

Comments
 (0)