View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.DS / Contents

Capability Category

Instead of using the above attributes you can override DataSource.OnCapabilityValueNeeded method.

protected override void OnCapabilityValueNeeded(CapabilityEventArgs e) {
    // ...
    for(var _cap = e.Capability.CapabilityInfo.Capability; this._Handlers.ContainsKey(_cap);) {
        this._Handlers[_cap](e.Capability);
        break;
    }

    // CAP_DEVICEONLINE 
    switch(e.Capability.CapabilityInfo.Capability) {
        case TwCap.DeviceOnline:
            e.Capability.Value=this._Screen!=null;
            break;
    }
    // ...
}