Class AppDirectoryLayout
Represents a resolved executable-root directory layout with named writable child directories.
Implements
Inherited Members
Namespace: Eigenverft.NetLib.Infrastructure.Hosting.DirectoryLayout
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public sealed class AppDirectoryLayout : IAppDirectoryLayout
Constructors
| Edit this page View SourceAppDirectoryLayout(string, IReadOnlyDictionary<string, string>)
Initializes a new instance of AppDirectoryLayout.
Declaration
public AppDirectoryLayout(string rootPath, IReadOnlyDictionary<string, string> directoriesByKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rootPath | The executable-root directory path. |
| IReadOnlyDictionary<string, string> | directoriesByKey | Resolved directory paths by semantic key. |
Properties
| Edit this page View SourceGetByKey
Gets resolved directory paths by semantic key.
Declaration
public IReadOnlyDictionary<string, string> GetByKey { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, string> |
this[DefaultDirectory]
Gets a directory path by standard typed key.
Declaration
public string this[DefaultDirectory directory] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultDirectory | directory | The standard directory key. |
Property Value
| Type | Description |
|---|---|
| string |
this[string]
Gets a directory path by custom semantic key.
Declaration
public string this[string key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The semantic key. |
Property Value
| Type | Description |
|---|---|
| string |
RootPath
Gets the executable-root directory path.
Declaration
public string RootPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceGet(DefaultDirectory)
Gets a directory path by standard typed key.
Declaration
public string Get(DefaultDirectory directory)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultDirectory | directory | The standard directory key. |
Returns
| Type | Description |
|---|---|
| string | The resolved directory path. |
Get(string)
Gets a directory path by custom semantic key.
Declaration
public string Get(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The semantic key. |
Returns
| Type | Description |
|---|---|
| string | The resolved directory path. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The key is null, empty, or whitespace. |
| KeyNotFoundException | The key is not configured. |
TryGet(DefaultDirectory, out string)
Tries to get a directory path by standard typed key.
Declaration
public bool TryGet(DefaultDirectory directory, out string directoryPath)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultDirectory | directory | The standard directory key. |
| string | directoryPath | The resolved directory path if found. |
Returns
| Type | Description |
|---|---|
| bool |
|
TryGet(string, out string)
Tries to get a directory path by custom semantic key.
Declaration
public bool TryGet(string key, out string directoryPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The semantic key. |
| string | directoryPath | The resolved directory path if found. |
Returns
| Type | Description |
|---|---|
| bool |
|