Method Get
Get<T>(string, SettingsScope, T)
Get a value with key of type T, or return the fallback value if no matching key is found.
Declaration
public T Get<T>(string key, SettingsScope scope = SettingsScope.Project, T fallback = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The settings key. |
| SettingsScope | scope | Which scope this settings should be retrieved from. |
| T | fallback | If no key with a value of type T is found, this value is returned. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Type of value to search for. |
Get<T>(string, string, SettingsScope, T)
Get a value with key of type T, or return the fallback value if no matching key is found.
Declaration
public T Get<T>(string key, string repositoryName, SettingsScope scope = SettingsScope.Project, T fallback = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The settings key. |
| string | repositoryName | The repository name to match. |
| SettingsScope | scope | Which scope this settings should be retrieved from. |
| T | fallback | If no key with a value of type T is found, this value is returned. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Type of value to search for. |
Get<T, K>(string, T, string)
Get a value with key of type T, or return the fallback value if no matching key is found.
Declaration
public T Get<T, K>(string key, T fallback = default, string repositoryName = null) where K : ISettingsRepository
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The settings key. |
| T | fallback | If no key with a value of type T is found, this value is returned. |
| string | repositoryName | If provided, only repositories with a matching name will be searched for the key. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Type of value to search for. |
| K | Only repositories of type K will be searched for matching keys. |