Table of Contents

Class Option

Namespace
ArcanaDevelopment.adTempus.Client
Assembly
ArcanaDevelopment.adTempus.Client.dll

Represents a server option

public sealed class Option : ObjectBase
Inheritance
object
Option

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

OptionType

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

OptionValueType

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

NameTypeDescription
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 T value of the option, or null if no value is set or if the value cannot be converted to T.

Type Parameters

NameDescription
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

NameTypeDescription
defaultValue T

Returns

T

The T value of the option, or null if no value is set or if the value cannot be converted to T.

Type Parameters

NameDescription
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

NameTypeDescription
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

NameTypeDescription
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

NameTypeDescription
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

NameTypeDescription
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

NameTypeDescription
value T?

The new value for the option

Type Parameters

NameDescription
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

NameTypeDescription
reportBuilder IADTObjectConfigurationReportWriter

The report builder to write the object to.

Inherited Members