Struct SettingDefinition<T>
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
Represents the definition of a setting in the application.
public readonly struct SettingDefinition<T> : IEquatable<SettingDefinition<T>>
Type Parameters
TThe type of value of the setting
- Implements
- Inherited Members
- Extension Methods
Constructors
SettingDefinition(T, bool, Assembly, string)
Initializes a new instance of the SettingDefinition<T> structure.
public SettingDefinition(T defaultValue, bool canBeControlledByAdmin, Assembly callingAssembly, string name = null)
Parameters
defaultValueTThe default value of the setting.
canBeControlledByAdminboolIndicates whether the setting can be controlled by an administrator.
callingAssemblyAssemblyThe assembly that creates this setting.
namestringThe name of the setting. Should be unique.
SettingDefinition(T, Assembly, string)
Initializes a new instance of the SettingDefinition<T> structure.
public SettingDefinition(T defaultValue, Assembly callingAssembly, string name = null)
Parameters
defaultValueTThe default value of the setting.
callingAssemblyAssemblyThe assembly that creates this setting.
namestringThe name of the setting. Should be unique.
Properties
CanBeControlledByAdmin
Gets a value indicating whether this setting can be overridden by an administrator.
When true, a value set by an admin in the Windows registry at
HKEY_LOCAL_MACHINE\Software\WindowSill[Name] will take precedence over the user's setting,
and the setting will be read-only.
public bool CanBeControlledByAdmin { get; }
Property Value
DefaultValue
Gets the default value of the setting.
public T DefaultValue { get; }
Property Value
- T
Name
Gets the name of the setting.
public string Name { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
Equals(SettingDefinition<T>)
Determines whether the specified SettingDefinition<T> is equal to the current SettingDefinition<T>.
public bool Equals(SettingDefinition<T> other)
Parameters
otherSettingDefinition<T>The SettingDefinition<T> to compare with the current SettingDefinition<T>.
Returns
- bool
true if the specified SettingDefinition<T> is equal to the current SettingDefinition<T>; otherwise, false.
GetHashCode()
Returns the hash code for this SettingDefinition<T>.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
Operators
operator ==(SettingDefinition<T>, SettingDefinition<T>)
Determines whether two specified SettingDefinition<T> objects have the same value.
public static bool operator ==(SettingDefinition<T> left, SettingDefinition<T> right)
Parameters
leftSettingDefinition<T>The first SettingDefinition<T> to compare.
rightSettingDefinition<T>The second SettingDefinition<T> to compare.
Returns
- bool
true if the value of left is the same as the value of right; otherwise, false.
operator !=(SettingDefinition<T>, SettingDefinition<T>)
Determines whether two specified SettingDefinition<T> objects have different values.
public static bool operator !=(SettingDefinition<T> left, SettingDefinition<T> right)
Parameters
leftSettingDefinition<T>The first SettingDefinition<T> to compare.
rightSettingDefinition<T>The second SettingDefinition<T> to compare.
Returns
- bool
true if the value of left is different from the value of right; otherwise, false.