Class Option
- Namespace
- ArcanaDevelopment.adTempus.Client
- Assembly
- ArcanaDevelopment.adTempus.Client.dll
Represents a server option
public sealed class Option : ObjectBase
- Inheritance
-
objectOption
Remarks
Options are available through ServerSettings.
Properties
ClassKeyName
The key name for the class.
public override string ClassKeyName { get; }
Property Value
- string
Remarks
This name the name used by adTempus to identify the class and is intended for programmatic use only. Use the ClassName for a user-friendly name.
HasValue
Indicates whether the option has a value set
public bool HasValue { get; }
Property Value
- bool
IsReadOnly
Indicates whether the option is read-only.
public override bool IsReadOnly { get; }
Property Value
- bool
OptionName
The name of the option
public string OptionName { get; }
Property Value
- string
OptionType
The type of the option
public OptionType OptionType { get; }
Property Value
OptionValue
The value of the option
public string OptionValue { get; set; }
Property Value
- string
Remarks
All values are stored as string regardless of the ValueType. Use one of the Get or Set methods to get or set the value as a specific data type.
ValueType
The data type of the option's value
public OptionValueType ValueType { get; }
Property Value
Methods
GetObjectDescription()
Gets a description of the object's key settings.
protected override string GetObjectDescription()
Returns
- string
Remarks
This method is called by GetDescription() to get a user-friendly description of the object (such as its key settings) for display to the user. The description should contain enough information to distinguish this object from others of the same class.
GetValueAsBool()
Attempts to return the value as a bool.
public bool? GetValueAsBool()
Returns
- bool?
The bool value of the option, or null if no value is set or if the value is not a bool.
GetValueAsBool(bool)
Attempts to return the value as an bool
public bool GetValueAsBool(bool defaultValue)
Parameters
| Name | Type | Description |
|---|---|---|
defaultValue |
bool | The default value to return if the value is not set or cannot be converted to a bool |
Returns
- bool
GetValueAsDateTime()
Attempts to return the value as a DateTime.
public DateTime? GetValueAsDateTime()
Returns
- DateTime?
The date/time value of the option, or null if no value is set or if the value is not a date/time.
GetValueAsEnum<T>()
Attempts to return the value as an enum of type T.
public T? GetValueAsEnum<T>() where T : struct, Enum
Returns
- T?
The
Tvalue of the option, or null if no value is set or if the value cannot be converted toT.
Type Parameters
| Name | Description |
|---|---|
T |
GetValueAsEnum<T>(T)
Attempts to return the value as an enum of type T.
public T GetValueAsEnum<T>(T defaultValue) where T : struct, Enum
Parameters
| Name | Type | Description |
|---|---|---|
defaultValue |
T |
Returns
- T
The
Tvalue of the option, or null if no value is set or if the value cannot be converted toT.
Type Parameters
| Name | Description |
|---|---|
T |
GetValueAsInt()
Attempts to return the value as an int.
public int? GetValueAsInt()
Returns
- int?
The int value of the option, or null if no value is set or if the value is not an int.
GetValueAsInt(int)
Attempts to return the value as an int.
public int GetValueAsInt(int defaultValue)
Parameters
| Name | Type | Description |
|---|---|---|
defaultValue |
int | The default value to return if the value is not set or cannot be converted to an int |
Returns
- int
SetValue(bool?)
Sets a new bool value
public void SetValue(bool? value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
bool? | The new value for the option |
Remarks
Setting the value does not change the ValueType
SetValue(DateTime?)
Sets a new date/time value
public void SetValue(DateTime? value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
DateTime? | The new value for the option |
Remarks
Setting the value does not change the ValueType
SetValue(int?)
Sets a new int value
public void SetValue(int? value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
int? | The new value for the option |
Remarks
Setting the value does not change the ValueType
SetValue<T>(T?)
Sets a new enum value
public void SetValue<T>(T? value) where T : struct, Enum
Parameters
| Name | Type | Description |
|---|---|---|
value |
T? | The new value for the option |
Type Parameters
| Name | Description |
|---|---|
T |
Remarks
Setting the value does not change the ValueType
WriteToConfigurationReport(IADTObjectConfigurationReportWriter)
Writes the object and any contained objects to a configuration report
public override void WriteToConfigurationReport(IADTObjectConfigurationReportWriter reportBuilder)
Parameters
| Name | Type | Description |
|---|---|---|
reportBuilder |
IADTObjectConfigurationReportWriter | The report builder to write the object to. |
Inherited Members
- ObjectBase.IsDirty
- ObjectBase.IsNew
- ObjectBase.IsStub
- ObjectBase.IsDependent
- ObjectBase.ClassName
- ObjectBase.GetDescriptionWithClassName()
- ObjectBase.GetDescription()
- ObjectBase.ParentObject
- ObjectBase.BeginEdit()
- ObjectBase.BeginEdit(UndoLevelAction)
- ObjectBase.CommitEdit(Guid)
- ObjectBase.CommitEdit()
- ObjectBase.UndoEdit()
- ObjectBase.UndoEdit(Guid)