This project has moved. For the latest updates, please go here.

Adding new capabilities

To create new capability, you must declare a class that derives from the DataSourceCapability (OneDataSourceCapability<TValue>, ArrayDataSourceCapability<TValue>, EnumDataSourceCapability<TValue>).

// Standard a capability.
[DataSourceCapability(
    TwCap.FeederEnabled, 
    TwType.Bool, 
    SupportedOperations=TwQC.Get|TwQC.GetCurrent|TwQC.GetDefault|TwQC.Set|TwQC.Reset, 
    Get=TwOn.Enum)]
internal sealed class FeederEnabledDataSourceCapability:EnumDataSourceCapability<bool> {
    // ...
}

//Custom a capability.
[DataSourceCapability(
    (TwCap)0x8001, 
    TwType.Int16, 
    SupportedOperations=TwQC.Get|TwQC.GetCurrent|TwQC.GetDefault|TwQC.Set, 
    Get=TwOn.One)]
internal sealed class FeederXferCountDataSourceCapability:OneDataSourceCapability<short> {
}

Define relationship the capability to a DS.

[Capability(typeof(Capabilities.FeederEnabledDataSourceCapability))]
public abstract class DataSource:IDataSource {
    // ...
}

[Capability(typeof(Capabilities.FeederXferCountDataSourceCapability))]
public sealed class ScreenDataSource:BitmapDataSource {
    // ...
}

Last edited Aug 27, 2016 at 7:54 PM by SARAFF, version 6