Remove WinRT leftovers from mono's CoreLib (#44102)
authorAdeel Mujahid <3840695+am11@users.noreply.github.com>
Sat, 31 Oct 2020 16:36:26 +0000 (18:36 +0200)
committerGitHub <noreply@github.com>
Sat, 31 Oct 2020 16:36:26 +0000 (09:36 -0700)
src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj
src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/PRIExceptionInfo.cs [deleted file]
src/mono/netcore/System.Private.CoreLib/src/Internal/Resources/WindowsRuntimeResourceManagerBase.cs [deleted file]
src/mono/netcore/System.Private.CoreLib/src/Internal/Runtime/InteropServices/WindowsRuntime/ExceptionSupport.cs [deleted file]
src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationToken.cs [deleted file]
src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs [deleted file]
src/mono/netcore/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs [deleted file]

index 0c8cde1..4818332 100644 (file)
 
       <Compile Include="$(BclSourcesRoot)\System\IO\MonoIOError.cs" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
-      <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationToken.cs" />
-      <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\EventRegistrationTokenTable.cs" />
-      <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\WindowsRuntime\WindowsRuntimeMarshal.cs" />
-      <Compile Include="$(BclSourcesRoot)\Internal\Resources\PRIExceptionInfo.cs" />
-      <Compile Include="$(BclSourcesRoot)\Internal\Resources\WindowsRuntimeResourceManagerBase.cs" />
-      <Compile Include="$(BclSourcesRoot)\Internal\Runtime\InteropServices\WindowsRuntime\ExceptionSupport.cs" />
-  </ItemGroup>
   <ItemGroup Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
       <Compile Include="$(BclSourcesRoot)\System\Environment.iOS.cs" />
       <Compile Include="$(CommonPath)Interop\OSX\System.Native\Interop.SearchPath.cs">
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 (file)
index 18d3bc2..0000000
+++ /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 (file)
index 3d4abd7..0000000
+++ /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 (file)
index 348bb0c..0000000
+++ /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
-    {
-        /// <summary>
-        /// Attach restricted error information to the exception if it may apply to that exception, returning
-        /// back the input value
-        /// </summary>
-        [return: NotNullIfNotNull("e")]
-        public static Exception? AttachRestrictedErrorInfo(Exception? e) => throw new PlatformNotSupportedException();
-
-        /// <summary>
-        /// 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.
-        /// </summary>
-        /// <returns>true if the error was reported, false if not (ie running on Win8)</returns>
-        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 (file)
index 5fc7495..0000000
+++ /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<EventRegistrationToken>
-    {
-        [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 (file)
index 61ec1f1..0000000
+++ /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<T> 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<T> GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable<T>? 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 (file)
index 2b97337..0000000
+++ /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<T>(Func<T, EventRegistrationToken> addMethod,
-                                              Action<EventRegistrationToken> removeMethod,
-                                              T handler) => throw new PlatformNotSupportedException();
-
-        public static void RemoveEventHandler<T>(Action<EventRegistrationToken> removeMethod, T handler) => throw new PlatformNotSupportedException();
-
-        public static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod) => throw new PlatformNotSupportedException();
-
-        public static object GetUniqueObjectForIUnknownWithoutUnboxing(IntPtr unknown) => throw new PlatformNotSupportedException();
-    }
-}