namespace SimConnect.Attribute
{
///
/// Indicates the property should be registered as a SimConnect variable in the definition to receive updates.
///
public class SimConnectVariableAttribute : System.Attribute
{
///
/// The name of the SimConnect variable
///
public string VariableName { get; }
///
/// The SimConnect data type. If null, the SimConnect data type will be determined from the .NET type.
///
public SimConnectDataType? DataType { get; }
///
/// The requested units for the value. See the SimConnect documentation for available units
///
public string UnitsName { get; }
///
/// For integer and floating point types, determines how much the value must change before an update is sent
///
public float Epsilon { get; }
///
/// Indicates the property should be registered as a SimConnect variable in the definition to receive updates.
///
/// The name of the SimConnect variable
/// The SimConnect data type. If null, the SimConnect data type will be determined from the .NET type.
/// The requested units for the value. See the SimConnect documentation for available units
/// For integer and floating point types, determines how much the value must change before an update is sent
public SimConnectVariableAttribute(string variableName, SimConnectDataType dataType, string unitsName = "", float epsilon = 0)
{
VariableName = variableName;
DataType = dataType;
UnitsName = unitsName;
Epsilon = epsilon;
}
///
/// Indicates the property should be registered as a SimConnect variable in the definition to receive updates.
///
/// The name of the SimConnect variable
/// The requested units for the value. See the SimConnect documentation for available units
/// For integer and floating point types, determines how much the value must change before an update is sent
public SimConnectVariableAttribute(string variableName, string unitsName = "", float epsilon = 0)
{
VariableName = variableName;
DataType = null;
UnitsName = unitsName;
Epsilon = epsilon;
}
}
}