2014-04-02 19:13:15 -04:00
|
|
|
|
using NTwain.Data;
|
2014-04-20 16:57:38 -04:00
|
|
|
|
using NTwain.Internals;
|
2014-04-02 19:01:21 -04:00
|
|
|
|
|
|
|
|
|
namespace NTwain.Triplets
|
|
|
|
|
{
|
|
|
|
|
sealed class Callback : OpBase
|
|
|
|
|
{
|
2014-04-20 18:42:51 -04:00
|
|
|
|
internal Callback(ITwainSessionInternal session) : base(session) { }
|
2014-04-02 19:01:21 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// This triplet is sent to the DSM by the Application to register the application’s entry point with
|
|
|
|
|
/// the DSM, so that the DSM can use callbacks to inform the application of events generated by the
|
|
|
|
|
/// DS.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="callback">The callback.</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public ReturnCode RegisterCallback(TWCallback callback)
|
|
|
|
|
{
|
|
|
|
|
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback);
|
2014-05-20 07:25:57 -04:00
|
|
|
|
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.RegisterCallback, callback);
|
2014-04-02 19:01:21 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|