ntwain/NTwain/Triplets/DGControl/DGControl.SetupFileXfer.cs

71 lines
3.8 KiB
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
{
2014-04-05 10:19:16 +08:00
/// <summary>
/// Represents <see cref="DataArgumentType.SetupFileXfer"/>.
/// </summary>
2014-04-21 08:45:08 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
public sealed class SetupFileXfer : OpBase
2014-04-03 07:01:21 +08:00
{
internal SetupFileXfer(ITwainSessionInternal session) : base(session) { }
2014-04-03 07:01:21 +08:00
/// <summary>
/// Returns information about the file into which the Source has or will put the acquired image
/// or audio data.
/// </summary>
/// <param name="setupFileXfer">The setup file xfer.</param>
/// <returns></returns>
2014-07-01 19:23:55 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
2014-04-21 08:45:08 +08:00
public ReturnCode Get(out TWSetupFileXfer setupFileXfer)
2014-04-03 07:01:21 +08:00
{
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Get);
setupFileXfer = new TWSetupFileXfer();
2014-05-20 19:25:57 +08:00
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Get, setupFileXfer);
2014-04-03 07:01:21 +08:00
}
/// <summary>
/// Returns information for the default image or audio file.
/// </summary>
/// <param name="setupFileXfer">The setup file xfer.</param>
/// <returns></returns>
2014-07-01 19:23:55 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
2014-04-21 08:45:08 +08:00
public ReturnCode GetDefault(out TWSetupFileXfer setupFileXfer)
2014-04-03 07:01:21 +08:00
{
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.GetDefault);
setupFileXfer = new TWSetupFileXfer();
2014-05-20 19:25:57 +08:00
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.GetDefault, setupFileXfer);
2014-04-03 07:01:21 +08:00
}
/// <summary>
/// Resets the current file information to the image or audio default file information and
/// returns that default information.
/// </summary>
/// <param name="setupFileXfer">The setup file xfer.</param>
/// <returns></returns>
2014-07-01 19:23:55 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
2014-04-21 08:45:08 +08:00
public ReturnCode Reset(out TWSetupFileXfer setupFileXfer)
2014-04-03 07:01:21 +08:00
{
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Reset);
setupFileXfer = new TWSetupFileXfer();
2014-05-20 19:25:57 +08:00
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Reset, setupFileXfer);
2014-04-03 07:01:21 +08:00
}
/// <summary>
/// Sets the file transfer information for the next file transfer. The application is responsible for
/// verifying that the specified file name is valid and that the file either does not currently exist (in
/// which case, the Source is to create the file), or that the existing file is available for opening and
/// read/write operations. The application should also assure that the file format it is requesting
/// can be provided by the Source
/// </summary>
/// <param name="setupFileXfer">The setup file xfer.</param>
/// <returns></returns>
2014-07-01 19:23:55 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
public ReturnCode Set(TWSetupFileXfer setupFileXfer)
2014-04-03 07:01:21 +08:00
{
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Set);
2014-05-20 19:25:57 +08:00
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Set, setupFileXfer);
2014-04-03 07:01:21 +08:00
}
}
}