Class TerminalPropertyExtensions
Terminal block extension for property access
Inheritance
Namespace: Sandbox.ModAPI.Interfaces
Assembly: Sandbox.Common.dll
Syntax
public static class TerminalPropertyExtensions : Object
Methods
As<TValue>(ITerminalProperty)
Property type cast
Declaration
public static ITerminalProperty<TValue> As<TValue>(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
ITerminalProperty<TValue> | reference to ITerminalProperty<TValue> value of specified type |
Type Parameters
Name | Description |
---|---|
TValue | value of type TypeName |
AsBool(ITerminalProperty)
Property type cast
Declaration
public static ITerminalProperty<bool> AsBool(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
ITerminalProperty<System.Boolean> | reference to ITerminalProperty<TValue> value of specified type (bool) |
AsColor(ITerminalProperty)
Property type cast
Declaration
public static ITerminalProperty<Color> AsColor(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
ITerminalProperty<Color> | reference to ITerminalProperty<TValue> value of specified type (Color) |
AsFloat(ITerminalProperty)
Property type cast
Declaration
public static ITerminalProperty<float> AsFloat(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
ITerminalProperty<System.Single> | reference to ITerminalProperty<TValue> value of specified type (float) |
Cast<TValue>(ITerminalProperty)
Property type cast
Declaration
public static ITerminalProperty<TValue> Cast<TValue>(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
ITerminalProperty<TValue> | reference to ITerminalProperty<TValue> value of specified type |
Type Parameters
Name | Description |
---|---|
TValue | value of type TypeName |
GetDefaultValue<T>(IMyTerminalBlock, String)
Returns default value of specified property as TypeName
Declaration
public static T GetDefaultValue<T>(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
T | property value as TypeName |
Type Parameters
Name | Description |
---|---|
T | required value type of TypeName |
GetMaximum<T>(IMyTerminalBlock, String)
Returns maximum value of specified property as TypeName
Declaration
public static T GetMaximum<T>(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
T | property value as TypeName |
Type Parameters
Name | Description |
---|---|
T | required value type of TypeName |
GetMinimum<T>(IMyTerminalBlock, String)
Returns minimum value of specified property as TypeName
Declaration
public static T GetMinimum<T>(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
T | property value as TypeName |
Type Parameters
Name | Description |
---|---|
T | required value type of TypeName |
GetMininum<T>(IMyTerminalBlock, String)
Returns minimum value of specified property as TypeName - this call is obsolete due typo in name, use GetMinimum<T>(IMyTerminalBlock, String)
Declaration
public static T GetMininum<T>(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
T | property value as TypeName |
Type Parameters
Name | Description |
---|---|
T | required value type of TypeName |
GetValue<T>(IMyTerminalBlock, String)
Returns value of specified property as TypeName
Declaration
public static T GetValue<T>(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
T | property value as TypeName |
Type Parameters
Name | Description |
---|---|
T |
GetValueBool(IMyTerminalBlock, String)
Returns value of specified property
Declaration
public static bool GetValueBool(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
System.Boolean | property value as bool |
GetValueColor(IMyTerminalBlock, String)
Returns value of specified property
Declaration
public static Color GetValueColor(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
Color | property value as Color |
GetValueFloat(IMyTerminalBlock, String)
Returns value of specified property
Declaration
public static float GetValueFloat(this IMyTerminalBlock block, string propertyId)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Returns
Type | Description |
---|---|
System.Single | property value as float |
Is<TValue>(ITerminalProperty)
Check property type
Declaration
public static bool Is<TValue>(this ITerminalProperty property)
Parameters
Type | Name | Description |
---|---|---|
ITerminalProperty | property | ITerminalProperty<TValue> reference |
Returns
Type | Description |
---|---|
System.Boolean | true if type matches |
Type Parameters
Name | Description |
---|---|
TValue | value of type TypeName |
SetValue<T>(IMyTerminalBlock, String, T)
Set value of property with type of TypeName
Declaration
public static void SetValue<T>(this IMyTerminalBlock block, string propertyId, T value)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
T | value | value to set |
Type Parameters
Name | Description |
---|---|
T |
SetValueBool(IMyTerminalBlock, String, Boolean)
Set bool value of property
Declaration
public static void SetValueBool(this IMyTerminalBlock block, string propertyId, bool value)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
System.Boolean | value | value to set |
SetValueColor(IMyTerminalBlock, String, Color)
Set bool value of property
Declaration
public static void SetValueColor(this IMyTerminalBlock block, string propertyId, Color value)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
Color | value | value to set |
SetValueFloat(IMyTerminalBlock, String, Single)
Set float value of property
Declaration
public static void SetValueFloat(this IMyTerminalBlock block, string propertyId, float value)
Parameters
Type | Name | Description |
---|---|---|
IMyTerminalBlock | block | block reference |
System.String | propertyId | property id (name) |
System.Single | value | value to set |