ntwain/NTwain/Triplets/DGControl/DGControl.Callback2.cs

22 lines
776 B
C#
Raw Normal View History

2014-04-03 07:13:15 +08:00
using NTwain.Data;
2014-04-21 04:57:38 +08:00
using NTwain.Internals;
2014-04-03 07:01:21 +08:00
namespace NTwain.Triplets
{
sealed class Callback2 : OpBase
{
2014-04-06 04:48:28 +08:00
internal Callback2(ITwainStateInternal session) : base(session) { }
2014-04-03 07:01:21 +08:00
/// <summary>
/// This triplet is sent to the DSM by the Application to register the applications 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(TWCallback2 callback)
{
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Callback, Message.RegisterCallback);
2014-04-16 18:53:05 +08:00
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.RegisterCallback, callback);
2014-04-03 07:01:21 +08:00
}
}
}