Ejemplo n.º 1
0
 internal static unsafe void InitializeCommandLineArgsW(int argc, char **argv)
 {
     string[] args = new string[argc];
     for (int i = 0; i < argc; ++i)
     {
         args[i] = new string(argv[i]);
     }
     EnvironmentAugments.SetCommandLineArgs(args);
 }
Ejemplo n.º 2
0
 public static IDictionary GetEnvironmentVariables()
 {
     // To maintain complete compatibility with prior versions we need to return a Hashtable.
     // We did ship a prior version of Core with LowLevelDictionary, which does iterate the
     // same (e.g. yields DictionaryEntry), but it is not a public type.
     //
     // While we could pass Hashtable back from CoreCLR the type is also defined here. We only
     // want to surface the local Hashtable.
     return(EnvironmentAugments.EnumerateEnvironmentVariables().ToHashtable());
 }
Ejemplo n.º 3
0
 internal static unsafe void InitializeCommandLineArgs(int argc, byte **argv)
 {
     string[] args = new string[argc];
     for (int i = 0; i < argc; ++i)
     {
         byte *argval = argv[i];
         int   len    = CStrLen(argval);
         args[i] = Encoding.UTF8.GetString(argval, len);
     }
     EnvironmentAugments.SetCommandLineArgs(args);
 }
Ejemplo n.º 4
0
        private static string[] GetMainMethodArguments()
        {
            // GetCommandLineArgs includes the executable name, Main() arguments do not.
            string[] args = EnvironmentAugments.GetCommandLineArgs();

            Debug.Assert(args.Length > 0);

            string[] mainArgs = new string[args.Length - 1];
            Array.Copy(args, 1, mainArgs, 0, mainArgs.Length);

            return(mainArgs);
        }
Ejemplo n.º 5
0
 public static string[] GetCommandLineArgs() => EnvironmentAugments.GetCommandLineArgs();
Ejemplo n.º 6
0
 public static void FailFast(string message, Exception exception) => EnvironmentAugments.FailFast(message, exception);
Ejemplo n.º 7
0
 public static void Exit(int exitCode) => EnvironmentAugments.Exit(exitCode);
Ejemplo n.º 8
0
 // Still needed by shared\System\Diagnostics\Debug.Unix.cs
 public static string GetEnvironmentVariable(string variable) => EnvironmentAugments.GetEnvironmentVariable(variable);
Ejemplo n.º 9
0
 public static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target)
 {
     EnvironmentAugments.SetEnvironmentVariable(variable, value, target);
 }
Ejemplo n.º 10
0
 public static void SetEnvironmentVariable(string variable, string value)
 {
     EnvironmentAugments.SetEnvironmentVariable(variable, value);
 }
Ejemplo n.º 11
0
 public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target)
 {
     // See comments in GetEnvironmentVariables()
     return(EnvironmentAugments.EnumerateEnvironmentVariables(target).ToHashtable());
 }
Ejemplo n.º 12
0
 public static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target)
 {
     return(EnvironmentAugments.GetEnvironmentVariable(variable, target));
 }
Ejemplo n.º 13
0
 public static string GetEnvironmentVariable(string variable)
 {
     return(EnvironmentAugments.GetEnvironmentVariable(variable));
 }
Ejemplo n.º 14
0
 public static string[] GetCommandLineArgs()
 {
     return(EnvironmentAugments.GetCommandLineArgs());
 }
Ejemplo n.º 15
0
 public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target)
 {
     // See comments in GetEnvironmentVariables()
     return(new Hashtable(EnvironmentAugments.GetEnvironmentVariables(target)));
 }
Ejemplo n.º 16
0
        // Shuts down the class library and returns the process exit code.
        private static int Shutdown()
        {
            EnvironmentAugments.ShutdownCore();

            return(EnvironmentAugments.ExitCode);
        }