2014-04-20 16:57:38 -04:00
|
|
|
|
using NTwain.Data;
|
|
|
|
|
using NTwain.Internals;
|
2014-04-02 19:01:21 -04:00
|
|
|
|
|
|
|
|
|
namespace NTwain.Triplets
|
|
|
|
|
{
|
2014-04-04 22:19:16 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents <see cref="DataArgumentType.XferGroup"/>.
|
|
|
|
|
/// </summary>
|
2014-07-01 07:23:55 -04:00
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
2014-09-15 07:24:13 -04:00
|
|
|
|
public sealed class XferGroup : TripletBase
|
2014-04-02 19:01:21 -04:00
|
|
|
|
{
|
2014-04-20 18:42:51 -04:00
|
|
|
|
internal XferGroup(ITwainSessionInternal session) : base(session) { }
|
2014-04-04 18:51:44 -04:00
|
|
|
|
|
2014-04-02 19:01:21 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns the Data Group (the type of data) for the upcoming transfer. The Source is required to
|
|
|
|
|
/// only supply one of the DGs specified in the SupportedGroups field of origin.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value">The value.</param>
|
|
|
|
|
/// <returns></returns>
|
2014-04-20 20:45:08 -04:00
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#")]
|
2014-04-06 16:25:48 -04:00
|
|
|
|
public ReturnCode Get(ref DataGroups value)
|
2014-04-02 19:01:21 -04:00
|
|
|
|
{
|
2014-04-04 18:51:44 -04:00
|
|
|
|
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Get);
|
2014-05-20 07:25:57 -04:00
|
|
|
|
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, DataGroups.Control, DataArgumentType.XferGroup, Message.Get, ref value);
|
2014-04-02 19:01:21 -04:00
|
|
|
|
}
|
|
|
|
|
|
2014-04-04 18:51:44 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The transfer group determines the kind of data being passed from the Source to the Application.
|
|
|
|
|
/// By default a TWAIN Source must default to DG_IMAGE. Currently the only other data group
|
|
|
|
|
/// supported is DG_AUDIO, which is a feature supported by some digital cameras.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="value">The value.</param>
|
|
|
|
|
/// <returns></returns>
|
2014-04-06 16:25:48 -04:00
|
|
|
|
public ReturnCode Set(DataGroups value)
|
2014-04-02 19:01:21 -04:00
|
|
|
|
{
|
|
|
|
|
Session.VerifyState(6, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Set);
|
2014-05-20 07:25:57 -04:00
|
|
|
|
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, DataGroups.Control, DataArgumentType.XferGroup, Message.Set, ref value);
|
2014-04-02 19:01:21 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|