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); }
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()); }
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); }
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); }
public static string[] GetCommandLineArgs() => EnvironmentAugments.GetCommandLineArgs();
public static void FailFast(string message, Exception exception) => EnvironmentAugments.FailFast(message, exception);
public static void Exit(int exitCode) => EnvironmentAugments.Exit(exitCode);
// Still needed by shared\System\Diagnostics\Debug.Unix.cs public static string GetEnvironmentVariable(string variable) => EnvironmentAugments.GetEnvironmentVariable(variable);
public static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target) { EnvironmentAugments.SetEnvironmentVariable(variable, value, target); }
public static void SetEnvironmentVariable(string variable, string value) { EnvironmentAugments.SetEnvironmentVariable(variable, value); }
public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target) { // See comments in GetEnvironmentVariables() return(EnvironmentAugments.EnumerateEnvironmentVariables(target).ToHashtable()); }
public static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target) { return(EnvironmentAugments.GetEnvironmentVariable(variable, target)); }
public static string GetEnvironmentVariable(string variable) { return(EnvironmentAugments.GetEnvironmentVariable(variable)); }
public static string[] GetCommandLineArgs() { return(EnvironmentAugments.GetCommandLineArgs()); }
public static IDictionary GetEnvironmentVariables(EnvironmentVariableTarget target) { // See comments in GetEnvironmentVariables() return(new Hashtable(EnvironmentAugments.GetEnvironmentVariables(target))); }
// Shuts down the class library and returns the process exit code. private static int Shutdown() { EnvironmentAugments.ShutdownCore(); return(EnvironmentAugments.ExitCode); }