Volume Control
Application-specific hotkeys for Windows
|
Manages ITemplateProvider & ITemplateDictionaryProvider instances to provide action settings with a suitable value editor DataTemplate. More...
Public Types | |
enum class | FallbackMode { Never = 0 , OnNullTemplate = 1 , OnMissingKey = 2 , OnFailedProvider = 4 , Always = OnNullTemplate | OnMissingKey | OnFailedProvider } |
Defines the cases when the FindDataTemplateFor(Type?, string?, Type, FallbackMode) method will fall back to fall back to providers that weren't explicitly specified. More... | |
Public Member Functions | |
int | IndexOfProviderType (Type providerType) |
Gets the index of the ITemplateProvider type specified by providerType in TemplateProviders. More... | |
int | IndexOfDictionaryProviderType (Type dictionaryProviderType) |
Gets the index of the ITemplateDictionaryProvider type specified by dictionaryProviderType in DictionaryProviders. More... | |
bool | TryGetProvider (Type providerType, out ITemplateProvider provider) |
Attempts to get the provider instance with the specified providerType . More... | |
bool | TryGetDictionaryProvider (Type dictionaryProviderType, out ITemplateDictionaryProvider dictionaryProvider) |
Attempts to get the dictionaryProvider instance with the specified dictionaryProviderType . More... | |
DataTemplate? | FindDataTemplate (string key) |
Finds the DataTemplate with the specified key in the TemplateDictionaryProviders list. More... | |
DataTemplate? | FindDataTemplate (Type valueType) |
Finds the most recent DataTemplate instance that supports the specified valueType . More... | |
DataTemplate? | FindDataTemplateFor (Type? providerType, string? templateKey, Type valueType, FallbackMode fallbackMode) |
Finds a suitable DataTemplate instance with the specified parameters. More... | |
DataTemplate? | FindDataTemplateFor (Type? providerType, string? templateKey, Type valueType, bool allowFallbackOnMissingKey=false) |
Finds a suitable DataTemplate instance with the specified parameters. More... | |
ResourceDictionary[] | GetProviderResourceDictionaries () |
Gets all of the ResourceDictionary objects from the list of template dictionary providers. More... | |
Properties | |
IReadOnlyList< ITemplateProvider > | TemplateProviders [get] |
Gets the list of ITemplateProvider instances. More... | |
IReadOnlyList< ITemplateDictionaryProvider > | TemplateDictionaryProviders [get] |
Gets the list of ITemplateDictionaryProvider instances. More... | |
IReadOnlySet< Type > | FailedTypes [get] |
Gets the list of types that failed to initialize for any reason. If initialization of a provider type fails, it is added to this list and not attempted again. More... | |
Manages ITemplateProvider & ITemplateDictionaryProvider instances to provide action settings with a suitable value editor DataTemplate.
Defines the cases when the FindDataTemplateFor(Type?, string?, Type, FallbackMode) method will fall back to fall back to providers that weren't explicitly specified.
DataTemplate? VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplate | ( | string | key | ) |
Finds the DataTemplate with the specified key in the TemplateDictionaryProviders list.
key | The key name of the target DataTemplate instance. |
null
.References VolumeControl.Log.FLog.FilterEventType(), VolumeControl.Core.Input.TemplateProviderManager.TemplateDictionaryProviders, and VolumeControl.Log.FLog.Trace().
Referenced by VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor().
DataTemplate? VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplate | ( | Type | valueType | ) |
Finds the most recent DataTemplate instance that supports the specified valueType .
valueType | The type of value displayed in the data template. |
null
.References VolumeControl.Log.FLog.FilterEventType(), VolumeControl.Core.Input.TemplateProviderManager.TemplateDictionaryProviders, VolumeControl.Core.Input.TemplateProviderManager.TemplateProviders, and VolumeControl.Log.FLog.Trace().
DataTemplate? VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor | ( | Type? | providerType, |
string? | templateKey, | ||
Type | valueType, | ||
bool | allowFallbackOnMissingKey = false |
||
) |
Finds a suitable DataTemplate instance with the specified parameters.
providerType | Optional type that implements |
templateKey | Optional key for a specific ActionSettingDataTemplate instance in a ITemplateDictionaryProvider. When providerType is null |
valueType | The type of value that will be displayed in the DataTemplate. |
allowFallbackOnMissingKey | When true & templateKey wasn't found and isn't null , fallback to searching all dictionaries for a DataTemplate that supports the specified valueType instead of returning null . |
null
.InvalidProviderTypeException | providerType does not implement ITemplateProvider or ITemplateDictionaryProvider. |
ArgumentNullException | valueType was null and the providerType and templateKey didn't resolve to a valid template. |
References VolumeControl.Log.FLog.Debug(), VolumeControl.Log.FLog.Error(), VolumeControl.Core.Input.TemplateProviderManager.FailedTypes, VolumeControl.Log.FLog.FilterEventType(), VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplate(), VolumeControl.Log.FLog.Trace(), VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider(), VolumeControl.Core.Input.TemplateProviderManager.TryGetProvider(), and VolumeControl.Log.FLog.Warning().
DataTemplate? VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor | ( | Type? | providerType, |
string? | templateKey, | ||
Type | valueType, | ||
FallbackMode | fallbackMode | ||
) |
Finds a suitable DataTemplate instance with the specified parameters.
providerType | Optional type that implements |
templateKey | Optional key for a specific ActionSettingDataTemplate instance in a ITemplateDictionaryProvider. When providerType is null |
valueType | The type of value that will be displayed in the DataTemplate. |
fallbackMode | The FallbackMode to use when searching for a template. |
null
.InvalidProviderTypeException | providerType does not implement ITemplateProvider or ITemplateDictionaryProvider. |
ArgumentNullException | valueType was null and the providerType and templateKey didn't resolve to a valid template. |
References VolumeControl.Log.FLog.Debug(), VolumeControl.Log.FLog.Error(), VolumeControl.Core.Input.TemplateProviderManager.FailedTypes, VolumeControl.Log.FLog.FilterEventType(), VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplate(), VolumeControl.Log.FLog.Trace(), VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider(), VolumeControl.Core.Input.TemplateProviderManager.TryGetProvider(), and VolumeControl.Log.FLog.Warning().
Referenced by VolumeControl.Core.Input.HotkeyActionAddonLoader.LoadActions().
ResourceDictionary [] VolumeControl.Core.Input.TemplateProviderManager.GetProviderResourceDictionaries | ( | ) |
Gets all of the ResourceDictionary objects from the list of template dictionary providers.
Not all ITemplateDictionaryProvider instances are derived from ResourceDictionary, so the number of returned objects may be different.
References VolumeControl.Core.Input.TemplateProviderManager.TemplateDictionaryProviders.
int VolumeControl.Core.Input.TemplateProviderManager.IndexOfDictionaryProviderType | ( | Type | dictionaryProviderType | ) |
Gets the index of the ITemplateDictionaryProvider type specified by dictionaryProviderType in DictionaryProviders.
dictionaryProviderType | A type that implements ITemplateDictionaryProvider. |
InvalidProviderTypeException | dictionaryProviderType does not implement ITemplateDictionaryProvider. |
References VolumeControl.Core.Input.TemplateProviderManager.TemplateDictionaryProviders.
Referenced by VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider().
int VolumeControl.Core.Input.TemplateProviderManager.IndexOfProviderType | ( | Type | providerType | ) |
Gets the index of the ITemplateProvider type specified by providerType in TemplateProviders.
providerType | A type that implements ITemplateProvider. |
InvalidProviderTypeException | providerType does not implement ITemplateProvider. |
References VolumeControl.Core.Input.TemplateProviderManager.TemplateProviders.
Referenced by VolumeControl.Core.Input.TemplateProviderManager.TryGetProvider().
bool VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider | ( | Type | dictionaryProviderType, |
out ITemplateDictionaryProvider | dictionaryProvider | ||
) |
Attempts to get the dictionaryProvider instance with the specified dictionaryProviderType .
If no provider was found, a new instance is created. This method can fail if the provider initializer fails.
dictionaryProviderType | A type that implements ITemplateDictionaryProvider. |
dictionaryProvider | The requested ITemplateDictionaryProvider instance when successful; otherwise null . |
true
when successful and dictionaryProvider is not null
; false
when the provider failed.InvalidProviderTypeException | dictionaryProviderType does not implement ITemplateDictionaryProvider. |
References VolumeControl.Log.LogMessage.Add(), VolumeControl.Log.FLog.Debug(), VolumeControl.Core.Input.TemplateProviderManager.FailedTypes, VolumeControl.Log.FLog.FilterEventType(), VolumeControl.Core.Input.TemplateProviderManager.IndexOfDictionaryProviderType(), VolumeControl.Log.LogMessage.Lines, VolumeControl.Log.FLog.LogMessage(), VolumeControl.Core.Input.TemplateProviderManager.TemplateDictionaryProviders, and VolumeControl.Log.FLog.Warning().
Referenced by VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor().
bool VolumeControl.Core.Input.TemplateProviderManager.TryGetProvider | ( | Type | providerType, |
out ITemplateProvider | provider | ||
) |
Attempts to get the provider instance with the specified providerType .
If no provider was found, a new instance is created. This method can fail if the provider initializer fails.
providerType | A type that implements ITemplateProvider. |
provider | The requested ITemplateProvider instance when successful; otherwise null . |
true
when successful and provider is not null
; false
when the provider failed.InvalidProviderTypeException | providerType does not implement ITemplateProvider. |
References VolumeControl.Core.Input.TemplateProviderManager.FailedTypes, VolumeControl.Core.Input.TemplateProviderManager.IndexOfProviderType(), and VolumeControl.Core.Input.TemplateProviderManager.TemplateProviders.
Referenced by VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor().
|
get |
Gets the list of types that failed to initialize for any reason.
If initialization of a provider type fails, it is added to this list and not attempted again.
Referenced by VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplateFor(), VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider(), and VolumeControl.Core.Input.TemplateProviderManager.TryGetProvider().
|
get |
Gets the list of ITemplateDictionaryProvider instances.
Referenced by VolumeControl.Core.Input.TemplateProviderManager.FindDataTemplate(), VolumeControl.Core.Input.TemplateProviderManager.GetProviderResourceDictionaries(), VolumeControl.Core.Input.TemplateProviderManager.IndexOfDictionaryProviderType(), and VolumeControl.Core.Input.TemplateProviderManager.TryGetDictionaryProvider().
|
get |