Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateVariableAndValue()

static void System.Environment.ValidateVariableAndValue ( string variable,
ref string value )
inlinestaticprivate

Definition at line 538 of file Environment.cs.

539 {
540 if (variable == null)
541 {
542 throw new ArgumentNullException("variable");
543 }
544 if (variable.Length == 0)
545 {
546 throw new ArgumentException(SR.Argument_StringZeroLength, "variable");
547 }
548 if (variable[0] == '\0')
549 {
550 throw new ArgumentException(SR.Argument_StringFirstCharIsZero, "variable");
551 }
552 if (variable.Contains('='))
553 {
554 throw new ArgumentException(SR.Argument_IllegalEnvVarName, "variable");
555 }
556 if (string.IsNullOrEmpty(value) || value[0] == '\0')
557 {
558 value = null;
559 }
560 }

References System.SR.Argument_IllegalEnvVarName, System.SR.Argument_StringFirstCharIsZero, System.SR.Argument_StringZeroLength, and System.value.

Referenced by System.Environment.SetEnvironmentVariable(), and System.Environment.SetEnvironmentVariable().