View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.DS / Contents

EndOfXfers

Finishes a series of transfers whose count is indeterminate (ICAP_XFERCOUNT is -1).

Syntax

protected void EndOfXfers()

Remarks

When ICAP_XFERCOUNT is -1, the number of pending transfers is indeterminate: XferEnvironment.PendingXfersIndeterminate is true, DAT_PENDINGXFERS reports 0xFFFF, and the Source stays in State 6. Call EndOfXfers() from a derived Source when there is no more data to supply for the series. The method clears the indeterminate state, resets PendingXfers to 0, clears the Ready/Transferring state flags and resets ImageInfo.

EndOfXfers() is a protected method of DataSource; it is also available in an AudioDataSource for ending a series of audio snippets.

Examples

protected override void OnEndXfer() {
    this._Dispose();
    if(this.XferEnvironment.PendingXfersIndeterminate) {
        if(!this._HasMoreData()) {
            this.EndOfXfers();
        }
    } else if(this.XferEnvironment.PendingXfers>0) {
        this._Acquire();
    }

    base.OnEndXfer();
}