Add EnvironmentAugments to coreclr
authorStephen Toub <stoub@microsoft.com>
Sat, 9 Jul 2016 21:46:12 +0000 (17:46 -0400)
committerStephen Toub <stoub@microsoft.com>
Wed, 13 Jul 2016 20:49:36 +0000 (16:49 -0400)
src/mscorlib/model.xml
src/mscorlib/mscorlib.shared.sources.props
src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs [new file with mode: 0644]

index 4b363a229d7c6808a58b08cc885939cd98138323..b951881869ade16f09622b2cf6e71a3638a9013c 100644 (file)
       <Member Name="FailFast(System.String,System.Exception)"  />
       <Member Name="Exit(System.Int32)" />
     </Type>
+    <Type Name="Internal.Runtime.Augments.EnvironmentAugments">
+      <Member MemberType="Property" Name="CurrentManagedThreadId"  />
+      <Member MemberType="Property" Name="ExitCode" />
+      <Member MemberType="Property" Name="HasShutdownStarted" />
+      <Member MemberType="Property" Name="StackTrace" />
+      <Member MemberType="Property" Name="TickCount" />
+      <Member Name="get_CurrentManagedThreadId"  />
+      <Member Name="get_ExitCode" />
+      <Member Name="set_ExitCode(System.Int32)" />
+      <Member Name="get_HasShutdownStarted"  />
+      <Member Name="get_StackTrace" />
+      <Member Name="get_TickCount" />
+      <Member Name="Exit(System.Int32)" />
+      <Member Name="FailFast(System.String,System.Exception)"  />
+      <Member Name="GetCommandLineArgs" />
+    </Type>
     <Type Name="System.EventArgs">
       <Member MemberType="Field" Name="Empty" />
       <Member Name="#ctor" />
index 78983c0639c86d690e7f39935e943bbfe05c6c18..3fcfd2703291b6a17c63dbe4de14154aff3fc0be 100644 (file)
     <SystemSources Condition="'$(FeatureCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\Variant.cs" />
     <SystemSources Condition="'$(FeatureClassicCominterop)' == 'true'" Include="$(BclSourcesRoot)\System\OleAutBinder.cs" />
   </ItemGroup>
+  <ItemGroup>
+    <SystemSources Include="$(BclSourcesRoot)\Internal\Runtime\Augments\EnvironmentAugments.cs" />
+  </ItemGroup>
   <ItemGroup>
     <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\__Filters.cs" />
     <ReflectionSources Include="$(BclSourcesRoot)\System\Reflection\AmbiguousMatchException.cs" />
diff --git a/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs b/src/mscorlib/src/Internal/Runtime/Augments/EnvironmentAugments.cs
new file mode 100644 (file)
index 0000000..2810468
--- /dev/null
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+
+namespace Internal.Runtime.Augments
+{
+    /// <summary>For internal use only.  Exposes runtime functionality to the Environments implementation in corefx.</summary>
+    public static class EnvironmentAugments
+    {
+        public static int CurrentManagedThreadId => Environment.CurrentManagedThreadId;
+        public static void Exit(int exitCode) => Environment.Exit(exitCode);
+        public static int ExitCode { get { return Environment.ExitCode; } set { Environment.ExitCode = value; } }
+        public static void FailFast(string message, Exception error) => Environment.FailFast(message, error);
+        public static string[] GetCommandLineArgs() => Environment.GetCommandLineArgs();
+        public static bool HasShutdownStarted => Environment.HasShutdownStarted;
+        public static string StackTrace => Environment.StackTrace;
+        public static int TickCount => Environment.TickCount;
+    }
+}