From 802543648478f9b0b9f7e07ee9bbde823cd90a64 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Sat, 31 Oct 2020 18:36:26 +0200 Subject: [PATCH] Remove WinRT leftovers from mono's CoreLib (#44102) --- .../System.Private.CoreLib.csproj | 8 ------ .../src/Internal/Resources/PRIExceptionInfo.cs | 11 -------- .../Resources/WindowsRuntimeResourceManagerBase.cs | 24 ----------------- .../WindowsRuntime/ExceptionSupport.cs | 25 ----------------- .../WindowsRuntime/EventRegistrationToken.cs | 26 ------------------ .../WindowsRuntime/EventRegistrationTokenTable.cs | 31 ---------------------- .../WindowsRuntime/WindowsRuntimeMarshal.cs | 18 ------------- 7 files changed, 143 deletions(-) delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/PRIExceptionInfo.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ExceptionSupport.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationToken.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs delete mode 100644 src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 0c8cde1..4818332 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -271,14 +271,6 @@ - - - - - - - - diff --git a/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/PRIExceptionInfo.cs b/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/PRIExceptionInfo.cs deleted file mode 100644 index 18d3bc2..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/PRIExceptionInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Internal.Resources -{ - public class PRIExceptionInfo - { - public string? PackageSimpleName; - public string? ResWFile; - } -} diff --git a/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs b/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs deleted file mode 100644 index 3d4abd7..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Globalization; - -namespace Internal.Resources -{ - public abstract class WindowsRuntimeResourceManagerBase - { - public abstract bool Initialize(string libpath, string reswFilename, out PRIExceptionInfo? exceptionInfo); - - public abstract string? GetString(string stringName, string? startingCulture, string? neutralResourcesCulture); - - public abstract CultureInfo? GlobalResourceContextBestFitCultureInfo - { - get; - } - - public abstract bool SetGlobalResourceContextDefaultCulture(CultureInfo ci); - - public static bool IsValidCulture(string? cultureName) => throw new PlatformNotSupportedException(); - } -} diff --git a/src/mono/netcore/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ExceptionSupport.cs b/src/mono/netcore/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ExceptionSupport.cs deleted file mode 100644 index 348bb0c..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ExceptionSupport.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics.CodeAnalysis; - -namespace Internal.Runtime.InteropServices.WindowsRuntime -{ - public static class ExceptionSupport - { - /// - /// Attach restricted error information to the exception if it may apply to that exception, returning - /// back the input value - /// - [return: NotNullIfNotNull("e")] - public static Exception? AttachRestrictedErrorInfo(Exception? e) => throw new PlatformNotSupportedException(); - - /// - /// Report that an exception has occurred which went user unhandled. This allows the global error handler - /// for the application to be invoked to process the error. - /// - /// true if the error was reported, false if not (ie running on Win8) - public static bool ReportUnhandledError(Exception? ex) => throw new PlatformNotSupportedException(); - } -} diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationToken.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationToken.cs deleted file mode 100644 index 5fc7495..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationToken.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.InteropServices.WindowsRuntime -{ - public struct EventRegistrationToken : IEquatable - { - [CLSCompliant(false)] - public EventRegistrationToken(ulong value) => throw new PlatformNotSupportedException(); - - [CLSCompliant(false)] - public ulong Value => throw new PlatformNotSupportedException(); - - public static bool operator ==(EventRegistrationToken left, EventRegistrationToken right) => - throw new PlatformNotSupportedException(); - - public static bool operator !=(EventRegistrationToken left, EventRegistrationToken right) => - throw new PlatformNotSupportedException(); - - public override bool Equals(object? obj) => throw new PlatformNotSupportedException(); - - public override int GetHashCode() => throw new PlatformNotSupportedException(); - - public bool Equals(EventRegistrationToken other) => throw new PlatformNotSupportedException(); - } -} diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs deleted file mode 100644 index 61ec1f1..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Threading; - -namespace System.Runtime.InteropServices.WindowsRuntime -{ - public sealed class EventRegistrationTokenTable where T : class - { - public EventRegistrationTokenTable() => throw new PlatformNotSupportedException(); - - public T? InvocationList - { - get => throw new PlatformNotSupportedException(); - set => throw new PlatformNotSupportedException(); - } - - public EventRegistrationToken AddEventHandler(T? handler) => throw new PlatformNotSupportedException(); - - public bool RemoveEventHandler(EventRegistrationToken token, [NotNullWhen(true)] out T? handler) => throw new PlatformNotSupportedException(); - - public void RemoveEventHandler(EventRegistrationToken token) => throw new PlatformNotSupportedException(); - - public void RemoveEventHandler(T? handler) => throw new PlatformNotSupportedException(); - - public static EventRegistrationTokenTable GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable? refEventTable) => throw new PlatformNotSupportedException(); - } -} diff --git a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs b/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs deleted file mode 100644 index 2b97337..0000000 --- a/src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Runtime.InteropServices.WindowsRuntime -{ - public static class WindowsRuntimeMarshal - { - public static void AddEventHandler(Func addMethod, - Action removeMethod, - T handler) => throw new PlatformNotSupportedException(); - - public static void RemoveEventHandler(Action removeMethod, T handler) => throw new PlatformNotSupportedException(); - - public static void RemoveAllEventHandlers(Action removeMethod) => throw new PlatformNotSupportedException(); - - public static object GetUniqueObjectForIUnknownWithoutUnboxing(IntPtr unknown) => throw new PlatformNotSupportedException(); - } -} -- 2.7.4