Class EnvironmentVariables
- Namespace
- CENTREL.XIA.Configuration.Types
- Assembly
- CENTREL.XIA.Configuration.Types.dll
Represents the of environment variables configured on a Windows machine.
public class EnvironmentVariables : BypassSection
- Inheritance
-
EnvironmentVariables
- Inherited Members
Constructors
EnvironmentVariables()
Initializes a new instance of the CENTREL.XIA.Configuration.Types.EnvironmentVariables class.
public EnvironmentVariables()
Properties
Items
Gets or sets the items in the collection.
public EnvironmentVariableCollection Items { get; set; }
Property Value
Methods
AddSystemVariable(string, string)
Adds a new system enivronment variable to the collection.
public void AddSystemVariable(string name, string value)
Parameters
name
stringThe name of the environment variable to add, with or without percentage % signs.
value
stringThe value of the variable.
Expand()
Expands any environment variables contained within the collection.
public void Expand()
Remarks
Note that several passes are made to ensure that all variables are expanded.
Expand(string)
Expands any environment variables contained within the specified string value.
public string Expand(string value)
Parameters
value
stringThe value to be expanded - for example "%TEMP%\output.xml".
Returns
- string
The value with the environment variables expanded.
Remarks
Note that several passes are made to ensure that all variables are expanded.
FindByName(string)
Returns the environment variable with the specified name, or null if no variable with that name is found.
public EnvironmentVariable FindByName(string name)
Parameters
name
stringThe name of the environment variable with or without percentage % signs.
Returns
- EnvironmentVariable
The environment variable with the specified name,
ToString()
Returns the environment variables as a human readable string - for example "10 Environment Variables" or "{Not Documented}".
public override string ToString()
Returns
- string
The environment variables as a human readable string.