Class SettingInfo
SettingInfo class. Used primarily to pass information from the SettingsCategory objects to the Settings UI through the settings manager.
Inheritance
Implements
Namespace: Phoenix.Settings
Assembly: Phoenix.Settings.dll
Syntax
public class SettingInfo : BindableBase, IDataErrorInfo
Constructors
View SourceSettingInfo(String, String, String, Object, AllowedValuesModel, SettingMetadata)
Initializes a new instance of the SettingInfo class.
Declaration
public SettingInfo(string categoryName, string settingName, string settingDisplayName, object value, AllowedValuesModel allowedValues, SettingMetadata metadata)
Parameters
Type | Name | Description |
---|---|---|
System.String | categoryName | Name of the category. |
System.String | settingName | Name of the setting. |
System.String | settingDisplayName | Display name of the setting. |
System.Object | value | Value of the setting. |
AllowedValuesModel | allowedValues | Allowed values of the setting. |
SettingMetadata | metadata | the metadata for how to display in the UI and validate. |
Properties
View SourceAllowedValues
Gets the allowed values of the setting.
Declaration
public AllowedValuesModel AllowedValues { get; }
Property Value
Type | Description |
---|---|
AllowedValuesModel |
CategoryName
Gets the name of the category the setting belongs to.
Declaration
public string CategoryName { get; }
Property Value
Type | Description |
---|---|
System.String |
IsDirty
Gets a value indicating whether or not the SettingsInfo object is dirty.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsValid
Gets a value indicating whether or not the setting's value is a valid value.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
OldValue
Gets or sets the old value of the setting.
Declaration
public object OldValue { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
SettingDisplayName
Gets the display name of the setting for UI purposes.
Declaration
public string SettingDisplayName { get; }
Property Value
Type | Description |
---|---|
System.String |
SettingMetadata
Gets the setting's metadata.
Declaration
public SettingMetadata SettingMetadata { get; }
Property Value
Type | Description |
---|---|
SettingMetadata |
SettingName
Gets the name of the setting.
Declaration
public string SettingName { get; }
Property Value
Type | Description |
---|---|
System.String |
Value
Gets or sets the value of the setting.
Declaration
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
ValueType
Gets the type that the value is supposed to be.
Declaration
public Type ValueType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
View SourceTryConvertValue(out Object)
Converts a value to the correct type as specified by ValueType.
Declaration
public bool TryConvertValue(out object convertedValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | convertedValue | the out parameter where the correctly typed value is stored or null. |
Returns
Type | Description |
---|---|
System.Boolean | a value representing whether or not the conversion was a success. |
ValidateValue()
Validates the current value against the allowed values and type expectations.
Declaration
public bool ValidateValue()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the value is valid. |
Explicit Interface Implementations
View SourceIDataErrorInfo.Error
Gets a string with error information [Not used].
Declaration
string IDataErrorInfo.Error { get; }
Returns
Type | Description |
---|---|
System.String |
IDataErrorInfo.Item[String]
Gets a string with the validation errors if any.
Declaration
string IDataErrorInfo.this[string propertyName] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to validate. |
Returns
Type | Description |
---|---|
System.String | Null if there was no error or a string indicating the error. |