Skip to content

Commit

Permalink
Revert "[release/5.0] Backport Browser Unsupported Attribute Changes (d…
Browse files Browse the repository at this point in the history
…otnet#41967)"

This reverts commit e032f4f.
  • Loading branch information
Mitchell Hwang committed Sep 10, 2020
1 parent e032f4f commit ade6e12
Show file tree
Hide file tree
Showing 33 changed files with 7 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

namespace System.Threading
{
Expand Down Expand Up @@ -160,7 +159,6 @@ private bool ValidHandle() =>
private static extern bool UnregisterWaitNative(IntPtr handle, SafeHandle? waitObject);
}

[UnsupportedOSPlatform("browser")]
public sealed class RegisteredWaitHandle : MarshalByRefObject
{
private readonly RegisteredWaitHandleSafe internalRegisteredWait;
Expand Down Expand Up @@ -354,7 +352,6 @@ public static bool BindHandle(IntPtr osHandle)
return BindIOCompletionCallbackNative(osHandle);
}

[SupportedOSPlatform("windows")]
public static bool BindHandle(SafeHandle osHandle)
{
if (osHandle == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,7 @@ public sealed partial class LicenseManager
internal LicenseManager() { }
public static System.ComponentModel.LicenseContext CurrentContext { get { throw null; } set { } }
public static System.ComponentModel.LicenseUsageMode UsageMode { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static object CreateWithContext(System.Type type, System.ComponentModel.LicenseContext creationContext) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static object CreateWithContext(System.Type type, System.ComponentModel.LicenseContext creationContext, object[] args) { throw null; }
public static bool IsLicensed(System.Type type) { throw null; }
public static bool IsValid(System.Type type) { throw null; }
Expand Down Expand Up @@ -870,7 +868,6 @@ public MaskedTextProvider(string mask, System.Globalization.CultureInfo culture,
public bool Add(string input, out int testPosition, out System.ComponentModel.MaskedTextResultHint resultHint) { throw null; }
public void Clear() { }
public void Clear(out System.ComponentModel.MaskedTextResultHint resultHint) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public object Clone() { throw null; }
public int FindAssignedEditPositionFrom(int position, bool direction) { throw null; }
public int FindAssignedEditPositionInRange(int startPosition, int endPosition, bool direction) { throw null; }
Expand Down Expand Up @@ -1308,7 +1305,6 @@ public abstract partial class TypeDescriptionProvider
{
protected TypeDescriptionProvider() { }
protected TypeDescriptionProvider(System.ComponentModel.TypeDescriptionProvider parent) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public virtual object CreateInstance(System.IServiceProvider provider, System.Type objectType, System.Type[] argTypes, object[] args) { throw null; }
public virtual System.Collections.IDictionary GetCache(object instance) { throw null; }
public virtual System.ComponentModel.ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance) { throw null; }
Expand Down Expand Up @@ -1351,7 +1347,6 @@ public static void CreateAssociation(object primary, object secondary) { }
public static System.ComponentModel.Design.IDesigner CreateDesigner(System.ComponentModel.IComponent component, System.Type designerBaseType) { throw null; }
public static System.ComponentModel.EventDescriptor CreateEvent(System.Type componentType, System.ComponentModel.EventDescriptor oldEventDescriptor, params System.Attribute[] attributes) { throw null; }
public static System.ComponentModel.EventDescriptor CreateEvent(System.Type componentType, string name, System.Type type, params System.Attribute[] attributes) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static object CreateInstance(System.IServiceProvider provider, System.Type objectType, System.Type[] argTypes, object[] args) { throw null; }
public static System.ComponentModel.PropertyDescriptor CreateProperty(System.Type componentType, System.ComponentModel.PropertyDescriptor oldPropertyDescriptor, params System.Attribute[] attributes) { throw null; }
public static System.ComponentModel.PropertyDescriptor CreateProperty(System.Type componentType, string name, System.Type type, params System.Attribute[] attributes) { throw null; }
Expand Down Expand Up @@ -2222,7 +2217,6 @@ public partial class ExtendedProtectionPolicyTypeConverter : System.ComponentMod
{
public ExtendedProtectionPolicyTypeConverter() { }
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { throw null; }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading;

namespace System.ComponentModel
Expand Down Expand Up @@ -117,7 +116,6 @@ private static void CacheProvider(Type type, LicenseProvider provider)
/// creationContext
/// as the context in which the licensed instance can be used.
/// </summary>
[UnsupportedOSPlatform("browser")]
public static object CreateWithContext(Type type, LicenseContext creationContext)
{
return CreateWithContext(type, creationContext, Array.Empty<object>());
Expand All @@ -128,7 +126,6 @@ public static object CreateWithContext(Type type, LicenseContext creationContext
/// specified arguments, using creationContext as the context in which the licensed
/// instance can be used.
/// </summary>
[UnsupportedOSPlatform("browser")]
public static object CreateWithContext(Type type, LicenseContext creationContext, object[] args)
{
object created = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Versioning;
using System.Text;

namespace System.ComponentModel
Expand Down Expand Up @@ -468,7 +467,6 @@ private void Initialize()
/// Derived classes can override this method and call base.Clone to get proper cloning semantics but must
/// implement the full-parameter constructor (passing parameters to the base constructor as well).
/// </summary>
[UnsupportedOSPlatform("browser")]
public object Clone()
{
MaskedTextProvider clonedProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections;
using System.Runtime.Versioning;

namespace System.ComponentModel
{
Expand Down Expand Up @@ -50,7 +49,6 @@ protected TypeDescriptionProvider(TypeDescriptionProvider parent)
/// parent provider was passed. If a parent provider was passed, this
/// method will invoke the parent provider's CreateInstance method.
/// </summary>
[UnsupportedOSPlatform("browser")]
public virtual object CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, object[] args)
{
if (_parent != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Runtime.Versioning;
using System.Threading;

namespace System.ComponentModel
Expand Down Expand Up @@ -429,7 +428,6 @@ public static EventDescriptor CreateEvent(Type componentType, EventDescriptor ol
/// a TypeDescriptionProvider object that is associated with the given
/// data type. If it finds one, it will delegate the call to that object.
/// </summary>
[UnsupportedOSPlatform("browser")]
public static object CreateInstance(IServiceProvider provider, Type objectType, Type[] argTypes, object[] args)
{
if (objectType == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.ComponentModel.Design.Serialization;
using System.Globalization;
using System.Reflection;
using System.Runtime.Versioning;

namespace System.Security.Authentication.ExtendedProtection
{
Expand All @@ -17,7 +16,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati
return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType);
}

[UnsupportedOSPlatform("browser")]
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(InstanceDescriptor))
Expand Down
35 changes: 7 additions & 28 deletions src/libraries/System.Console/ref/System.Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,81 +8,60 @@ namespace System
{
public static partial class Console
{
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.ConsoleColor BackgroundColor { get { throw null; } set { } }
public static int BufferHeight { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int BufferWidth { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int BufferHeight { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int BufferWidth { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static bool CapsLock { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int CursorLeft { get { throw null; } set { } }
public static int CursorSize { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int CursorSize { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int CursorTop { get { throw null; } set { } }
public static bool CursorVisible { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] get { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] set { } }
public static bool CursorVisible { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] get { throw null; } set { } }
public static System.IO.TextWriter Error { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.ConsoleColor ForegroundColor { get { throw null; } set { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.TextReader In { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.Text.Encoding InputEncoding { get { throw null; } set { } }
public static bool IsErrorRedirected { get { throw null; } }
public static bool IsInputRedirected { get { throw null; } }
public static bool IsOutputRedirected { get { throw null; } }
public static bool KeyAvailable { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int LargestWindowHeight { get { throw null; } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int LargestWindowWidth { get { throw null; } }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static bool NumberLock { get { throw null; } }
public static System.IO.TextWriter Out { get { throw null; } }
public static System.Text.Encoding OutputEncoding { get { throw null; } set { } }
public static string Title { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] get { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] set { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static string Title { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] get { throw null; } set { } }
public static bool TreatControlCAsInput { get { throw null; } set { } }
public static int WindowHeight { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int WindowHeight { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int WindowLeft { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int WindowTop { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static int WindowWidth { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int WindowWidth { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static event System.ConsoleCancelEventHandler? CancelKeyPress { add { } remove { } }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void Beep() { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Beep(int frequency, int duration) { }
public static void Clear() { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static (int Left, int Top) GetCursorPosition() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop) { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, System.ConsoleColor sourceForeColor, System.ConsoleColor sourceBackColor) { }
public static System.IO.Stream OpenStandardError() { throw null; }
public static System.IO.Stream OpenStandardError(int bufferSize) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.Stream OpenStandardInput() { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.IO.Stream OpenStandardInput(int bufferSize) { throw null; }
public static System.IO.Stream OpenStandardOutput() { throw null; }
public static System.IO.Stream OpenStandardOutput(int bufferSize) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static int Read() { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.ConsoleKeyInfo ReadKey() { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.ConsoleKeyInfo ReadKey(bool intercept) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static string? ReadLine() { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void ResetColor() { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void SetBufferSize(int width, int height) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void SetCursorPosition(int left, int top) { }
public static void SetError(System.IO.TextWriter newError) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void SetIn(System.IO.TextReader newIn) { }
public static void SetOut(System.IO.TextWriter newOut) { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
Expand Down
Loading

0 comments on commit ade6e12

Please sign in to comment.