Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a6cfa45

Browse files
committed
Hide obsolete platform IDs from Editor
1 parent 380d3f8 commit a6cfa45

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/System.Runtime.Extensions/ref/System.Runtime.Extensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,13 @@ public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, S
857857
}
858858
public enum PlatformID
859859
{
860-
Win32S = 0,
861-
Win32Windows = 1,
860+
[ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] Win32S = 0,
861+
[ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] Win32Windows = 1,
862862
Win32NT = 2,
863-
WinCE = 3,
863+
[ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] WinCE = 3,
864864
Unix = 4,
865-
Xbox = 5,
866-
MacOSX = 6
865+
[ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] Xbox = 5,
866+
[ComponentModel.EditorBrowsable(ComponentModel.EditorBrowsableState.Never)] MacOSX = 6
867867
}
868868
public partial class Progress<T> : System.IProgress<T>
869869
{

src/System.Runtime.Extensions/src/System/Environment.Unix.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ public static string MachineName
327327
revision = FindAndParseNextNumber(release, ref i);
328328
}
329329

330+
// For compatibility reasons with Mono, PlatformID.Unix is returned on MacOSX. PlatformID.MacOSX
331+
// is hidden from the editor and shouldn't be used.
330332
return new OperatingSystem(PlatformID.Unix, new Version(major, minor, build, revision));
331333
});
332334

src/System.Runtime.Extensions/src/System/PlatformID.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System.ComponentModel;
6+
57
namespace System
68
{
79
public enum PlatformID
810
{
9-
Win32S = 0,
10-
Win32Windows = 1,
11+
[EditorBrowsable(EditorBrowsableState.Never)] Win32S = 0,
12+
[EditorBrowsable(EditorBrowsableState.Never)] Win32Windows = 1,
1113
Win32NT = 2,
12-
WinCE = 3,
14+
[EditorBrowsable(EditorBrowsableState.Never)] WinCE = 3,
1315
Unix = 4,
14-
Xbox = 5,
15-
MacOSX = 6
16+
[EditorBrowsable(EditorBrowsableState.Never)] Xbox = 5,
17+
[EditorBrowsable(EditorBrowsableState.Never)] MacOSX = 6
1618
}
1719
}

0 commit comments

Comments
 (0)