Provides members for setting and retrieving data about an application's context.
More...
|
static object | GetData (string name) |
| Returns the value of the named data element assigned to the current application domain. More...
|
|
static bool | TryGetSwitch (string switchName, out bool isEnabled) |
| Tries to get the value of a switch. More...
|
|
static void | SetSwitch (string switchName, bool isEnabled) |
| Sets the value of a switch. More...
|
|
|
static string | BaseDirectory => ((string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY")) ?? AppDomain.CurrentDomain.BaseDirectory |
| Gets the pathname of the base directory that the assembly resolver uses to probe for assemblies. More...
|
|
static string | TargetFrameworkName => AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName |
| Gets the name of the framework version targeted by the current application. More...
|
|
Provides members for setting and retrieving data about an application's context.
Definition at line 6 of file AppContext.cs.
◆ GetData()
static object System.AppContext.GetData |
( |
string |
name | ) |
|
|
static |
Returns the value of the named data element assigned to the current application domain.
- Parameters
-
name | The name of the data element. |
- Returns
- The value of name , if name identifies a named value; otherwise,
null
.
Definition at line 32 of file AppContext.cs.
◆ SetSwitch()
static void System.AppContext.SetSwitch |
( |
string |
switchName, |
|
|
bool |
isEnabled |
|
) |
| |
|
static |
Sets the value of a switch.
- Parameters
-
switchName | The name of the switch. |
isEnabled | The value of the switch. |
- Exceptions
-
T:System.ArgumentNullException | switchName is null . |
T:System.ArgumentException | switchName is F:System.String.Empty. |
Definition at line 112 of file AppContext.cs.
◆ TryGetSwitch()
static bool System.AppContext.TryGetSwitch |
( |
string |
switchName, |
|
|
out bool |
isEnabled |
|
) |
| |
|
static |
Tries to get the value of a switch.
- Parameters
-
switchName | The name of the switch. |
isEnabled | When this method returns, contains the value of switchName if switchName was found, or false if switchName was not found. This parameter is passed uninitialized. |
- Returns
true
if switchName was set and the isEnabled argument contains the value of the switch; otherwise, false
.
- Exceptions
-
T:System.ArgumentNullException | switchName is null . |
T:System.ArgumentException | switchName is F:System.String.Empty. |
Definition at line 58 of file AppContext.cs.
◆ BaseDirectory
string System.AppContext.BaseDirectory => ((string)AppDomain.CurrentDomain.GetData("APP_CONTEXT_BASE_DIRECTORY")) ?? AppDomain.CurrentDomain.BaseDirectory |
|
static |
Gets the pathname of the base directory that the assembly resolver uses to probe for assemblies.
- Returns
- the pathname of the base directory that the assembly resolver uses to probe for assemblies.
Definition at line 23 of file AppContext.cs.
◆ TargetFrameworkName
string System.AppContext.TargetFrameworkName => AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName |
|
static |
Gets the name of the framework version targeted by the current application.
- Returns
- The name of the framework version targeted by the current application.
Definition at line 27 of file AppContext.cs.
The documentation for this class was generated from the following file: