Base class for input controls with a specific value type.
Inheritance
System.Object
InputControl<TValue>
public abstract class InputControl<TValue> : InputControl where TValue : struct
Type Parameters
Name |
Description |
TValue |
Type of value captured by the control. Note that this does not mean
that the control has to store data in the given value format. A control that captures float
values, for example, may be stored in state as byte values instead.
|
Properties
Declaration
public override int valueSizeInBytes { get; }
Property Value
Type |
Description |
System.Int32 |
|
Overrides
Declaration
public override Type valueType { get; }
Property Value
Type |
Description |
System.Type |
|
Overrides
Methods
Declaration
public override bool CompareValue(void *firstStatePtr, void *secondStatePtr)
Parameters
Type |
Name |
Description |
System.Void* |
firstStatePtr |
|
System.Void* |
secondStatePtr |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Declaration
public TValue ProcessValue(TValue value)
Parameters
Type |
Name |
Description |
TValue |
value |
|
Returns
Get the control's default value.
Declaration
public TValue ReadDefaultValue()
Returns
Type |
Description |
TValue |
The control's default value.
|
Declaration
public TValue ReadUnprocessedValue()
Returns
Declaration
public abstract TValue ReadUnprocessedValueFromState(void *statePtr)
Parameters
Type |
Name |
Description |
System.Void* |
statePtr |
|
Returns
Declaration
public TValue ReadValue()
Returns
Type |
Description |
TValue |
The control's current value.
|
Declaration
public override object ReadValueFromBufferAsObject(void *buffer, int bufferSize)
Parameters
Type |
Name |
Description |
System.Void* |
buffer |
|
System.Int32 |
bufferSize |
|
Returns
Type |
Description |
System.Object |
|
Overrides
Declaration
public TValue ReadValueFromPreviousFrame()
Returns
Type |
Description |
TValue |
The control's value in the previous frame.
|
Declaration
public TValue ReadValueFromState(void *statePtr)
Parameters
Type |
Name |
Description |
System.Void* |
statePtr |
|
Returns
Read the control's final, processed value from the given state and return the value as an object.
Declaration
public override object ReadValueFromStateAsObject(void *statePtr)
Parameters
Type |
Name |
Description |
System.Void* |
statePtr |
|
Returns
Type |
Description |
System.Object |
The control's value as stored in statePtr .
|
Overrides
Exceptions
Type |
Condition |
System.ArgumentNullException |
statePtr is null.
|
Read the control's final, processed value from the given state and store it in the given buffer.
Declaration
public override void ReadValueFromStateIntoBuffer(void *statePtr, void *bufferPtr, int bufferSize)
Parameters
Type |
Name |
Description |
System.Void* |
statePtr |
State to read the value for the control from.
|
System.Void* |
bufferPtr |
Buffer to store the value in.
|
System.Int32 |
bufferSize |
Size of bufferPtr in bytes. Must be at least valueSizeInBytes.
If it is smaller, System.ArgumentException will be thrown.
|
Overrides
Exceptions
Type |
Condition |
System.ArgumentNullException |
statePtr is null, or bufferPtr is null.
|
System.ArgumentException |
bufferSize is smaller than valueSizeInBytes.
|
Declaration
public override void WriteValueFromBufferIntoState(void *bufferPtr, int bufferSize, void *statePtr)
Parameters
Type |
Name |
Description |
System.Void* |
bufferPtr |
|
System.Int32 |
bufferSize |
|
System.Void* |
statePtr |
|
Overrides
Read a value object and store it as state in the given memory.
Declaration
public override void WriteValueFromObjectIntoState(object value, void *statePtr)
Parameters
Type |
Name |
Description |
System.Object |
value |
Value for the control.
|
System.Void* |
statePtr |
State containing the control's stateBlock. Will receive
the state state as converted from the given value.
|
Overrides
Exceptions
Type |
Condition |
System.NotSupportedException |
The control does not support writing. This is the case, for
example, that compute values (such as the magnitude of a vector).
|
Declaration
public virtual void WriteValueIntoState(TValue value, void *statePtr)
Parameters
Type |
Name |
Description |
TValue |
value |
|
System.Void* |
statePtr |
|
Extension Methods