Provides methods to help find .json configuration files like settings.json.
Finds the default configuration directory by looking the directory tree upwards from the application location.
public DirectoryInfo FindConfigurationDirectory()
A DirectoryInfo for the cnfg directory or null if it is not found.
Type | Summary |
---|---|
InvalidOperationException | Thrown when the location of the application is not found. |
Finds the configuration directory named directoryName by looking the directory tree upwards from the application location.
public DirectoryInfo FindConfigurationDirectory(directoryName)
A DirectoryInfo for the specified directoryName or null if it is not found.
Name | Type | Summary |
---|---|---|
directoryName | String | The name of the configuration directory to find. |
Type | Summary |
---|---|
ArgumentNullOrEmptyException | Thrown when directoryName is null or empty. |
InvalidOperationException | Thrown when the location of the application is not found. |
Finds the full path of the default configuration file.
public String FindConfigurationFileName()
The full path of the settings.json file.
Finds the full path of fileName in the configuration directory named directoryName.
public String FindConfigurationFileName(directoryName, fileName)
The full path name of the configuration file.
Name | Type | Summary |
---|---|---|
directoryName | String | Name of the configuration directory to find. |
fileName | String | Name of the configuration file to find. |
Type | Summary |
---|---|
ArgumentNullOrEmptyException | Thrown when directoryName is null or empty. |
ArgumentNullOrEmptyException | Thrown when fileName is null or empty. |
DirectoryNotFoundException | Thrown when directoryName cannot be found. |
FileNotFoundException | Thrown when fileName cannot be found. |