mirror of
https://github.com/soukoku/ntwain.git
synced 2025-09-18 17:47:57 +08:00
Refactoring xfer logic from twainsession out.
This commit is contained in:
@@ -9,7 +9,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class AudioFileXfer : OpBase
|
||||
{
|
||||
internal AudioFileXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal AudioFileXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// This operation is used to initiate the transfer of audio from the Source to the application via the
|
||||
/// disk-file transfer mechanism. It causes the transfer to begin.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class AudioInfo : OpBase
|
||||
{
|
||||
internal AudioInfo(ITwainStateInternal session) : base(session) { }
|
||||
internal AudioInfo(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Used to get the information of the current audio data ready to transfer.
|
||||
/// </summary>
|
||||
|
@@ -9,7 +9,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class AudioNativeXfer : OpBase
|
||||
{
|
||||
internal AudioNativeXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal AudioNativeXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Causes the transfer of an audio data from the Source to the application, via the Native
|
||||
/// transfer mechanism, to begin. The resulting data is stored in main memory in a single block.
|
||||
|
@@ -8,8 +8,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class DGAudio
|
||||
{
|
||||
ITwainStateInternal _session;
|
||||
internal DGAudio(ITwainStateInternal session)
|
||||
ITwainSessionInternal _session;
|
||||
internal DGAudio(ITwainSessionInternal session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
_session = session;
|
||||
|
@@ -5,7 +5,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Callback : OpBase
|
||||
{
|
||||
internal Callback(ITwainStateInternal session) : base(session) { }
|
||||
internal Callback(ITwainSessionInternal session) : base(session) { }
|
||||
/// <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
|
||||
|
@@ -5,7 +5,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Callback2 : OpBase
|
||||
{
|
||||
internal Callback2(ITwainStateInternal session) : base(session) { }
|
||||
internal Callback2(ITwainSessionInternal session) : base(session) { }
|
||||
/// <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
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class Capability : OpBase
|
||||
{
|
||||
internal Capability(ITwainStateInternal session) : base(session) { }
|
||||
internal Capability(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the Source’s Current, Default and Available Values for a specified capability.
|
||||
/// </summary>
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class CustomDSData : OpBase
|
||||
{
|
||||
internal CustomDSData(ITwainStateInternal session) : base(session) { }
|
||||
internal CustomDSData(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// This operation is used by the application to query the data source for its current settings, e.g.
|
||||
/// DPI, paper size, color format. The actual format of the data is data source dependent and not
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class DeviceEvent : OpBase
|
||||
{
|
||||
internal DeviceEvent(ITwainStateInternal session) : base(session) { }
|
||||
internal DeviceEvent(ITwainSessionInternal session) : base(session) { }
|
||||
public ReturnCode Get(out TWDeviceEvent sourceDeviceEvent)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get);
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class EntryPoint : OpBase
|
||||
{
|
||||
internal EntryPoint(ITwainStateInternal session) : base(session) { }
|
||||
internal EntryPoint(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Gets the function entry points for twain 2.0 or higher.
|
||||
/// </summary>
|
||||
|
@@ -5,7 +5,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Event : OpBase
|
||||
{
|
||||
internal Event(ITwainStateInternal session) : base(session) { }
|
||||
internal Event(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation supports the distribution of events from the application to Sources so that the
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class FileSystem : OpBase
|
||||
{
|
||||
internal FileSystem(ITwainStateInternal session) : base(session) { }
|
||||
internal FileSystem(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// This operation selects the destination directory within the Source (camera, storage, etc), where
|
||||
/// images captured using CapAutomaticCapture will be stored. This command only selects
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class Identity : OpBase
|
||||
{
|
||||
internal Identity(ITwainStateInternal session) : base(session) { }
|
||||
internal Identity(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// When an application is finished with a Source, it must formally close the session between them
|
||||
/// using this operation. This is necessary in case the Source only supports connection with a single
|
||||
|
@@ -9,7 +9,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class Parent : OpBase
|
||||
{
|
||||
internal Parent(ITwainStateInternal session) : base(session) { }
|
||||
internal Parent(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// When the application has closed all the Sources it had previously opened, and is finished with
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class PassThru : OpBase
|
||||
{
|
||||
internal PassThru(ITwainStateInternal session) : base(session) { }
|
||||
internal PassThru(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// PASSTHRU is intended for the use of Source writers writing diagnostic applications. It allows
|
||||
/// raw communication with the currently selected device in the Source.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class PendingXfers : OpBase
|
||||
{
|
||||
internal PendingXfers(ITwainStateInternal session) : base(session) { }
|
||||
internal PendingXfers(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// This triplet is used to cancel or terminate a transfer. Issued in state 6, this triplet cancels the next
|
||||
/// pending transfer, discards the transfer data, and decrements the pending transfers count. In
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class SetupFileXfer : OpBase
|
||||
{
|
||||
internal SetupFileXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal SetupFileXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns information about the file into which the Source has or will put the acquired image
|
||||
/// or audio data.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class SetupMemXfer : OpBase
|
||||
{
|
||||
internal SetupMemXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal SetupMemXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the Source’s preferred, minimum, and maximum allocation sizes for transfer memory
|
||||
/// buffers.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class Status : OpBase
|
||||
{
|
||||
internal Status(ITwainStateInternal session) : base(session) { }
|
||||
internal Status(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the current Condition Code for the Source Manager.
|
||||
/// </summary>
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class StatusUtf8 : OpBase
|
||||
{
|
||||
internal StatusUtf8(ITwainStateInternal session) : base(session) { }
|
||||
internal StatusUtf8(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Translate the contents of a TW_STATUS structure received from a Source into a localized UTF-8
|
||||
/// encoded string.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class UserInterface : OpBase
|
||||
{
|
||||
internal UserInterface(ITwainStateInternal session) : base(session) { }
|
||||
internal UserInterface(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// This operation causes the Source’s user interface, if displayed during the
|
||||
/// EnableDS operation, to be lowered. The Source is returned to
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class XferGroup : OpBase
|
||||
{
|
||||
internal XferGroup(ITwainStateInternal session) : base(session) { }
|
||||
internal XferGroup(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Data Group (the type of data) for the upcoming transfer. The Source is required to
|
||||
|
@@ -8,8 +8,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class DGControl
|
||||
{
|
||||
ITwainStateInternal _session;
|
||||
internal DGControl(ITwainStateInternal session)
|
||||
ITwainSessionInternal _session;
|
||||
internal DGControl(ITwainSessionInternal session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
_session = session;
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class CieColor : OpBase
|
||||
{
|
||||
internal CieColor(ITwainStateInternal session) : base(session) { }
|
||||
internal CieColor(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation causes the Source to report the currently active parameters to be used in
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class ExtImageInfo : OpBase
|
||||
{
|
||||
internal ExtImageInfo(ITwainStateInternal session) : base(session) { }
|
||||
internal ExtImageInfo(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWExtImageInfo info)
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class Filter : OpBase
|
||||
{
|
||||
internal Filter(ITwainStateInternal session) : base(session) { }
|
||||
internal Filter(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class GrayResponse : OpBase
|
||||
{
|
||||
internal GrayResponse(ITwainStateInternal session) : base(session) { }
|
||||
internal GrayResponse(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// The Reset operation causes the Source to use its "identity response curve." The identity
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class IccProfile : OpBase
|
||||
{
|
||||
internal IccProfile(ITwainStateInternal session) : base(session) { }
|
||||
internal IccProfile(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation provides the application with the ICC profile associated with the image which is
|
||||
|
@@ -9,7 +9,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
sealed class ImageFileXfer : OpBase
|
||||
{
|
||||
internal ImageFileXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageFileXfer(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation is used to initiate the transfer of an image from the Source to the application via
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class ImageInfo : OpBase
|
||||
{
|
||||
internal ImageInfo(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageInfo(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWImageInfo info)
|
||||
{
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class ImageLayout : OpBase
|
||||
{
|
||||
internal ImageLayout(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageLayout(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWImageLayout layout)
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class ImageMemFileXfer : OpBase
|
||||
{
|
||||
internal ImageMemFileXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageMemFileXfer(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation is used to initiate the transfer of an image from the Source to the application via
|
||||
|
@@ -5,7 +5,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class ImageMemXfer : OpBase
|
||||
{
|
||||
internal ImageMemXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageMemXfer(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation is used to initiate the transfer of an image from the Source to the application via
|
||||
|
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class ImageNativeXfer : OpBase
|
||||
{
|
||||
internal ImageNativeXfer(ITwainStateInternal session) : base(session) { }
|
||||
internal ImageNativeXfer(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// Causes the transfer of an image’s data from the Source to the application, via the Native transfer
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class JpegCompression : OpBase
|
||||
{
|
||||
internal JpegCompression(ITwainStateInternal session) : base(session) { }
|
||||
internal JpegCompression(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// Causes the Source to return the parameters that will be used during the compression of data
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class Palette8 : OpBase
|
||||
{
|
||||
internal Palette8(ITwainStateInternal session) : base(session) { }
|
||||
internal Palette8(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// This operation causes the Source to report its current palette information.
|
||||
|
@@ -8,7 +8,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class RgbResponse : OpBase
|
||||
{
|
||||
internal RgbResponse(ITwainStateInternal session) : base(session) { }
|
||||
internal RgbResponse(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
/// <summary>
|
||||
/// Causes the Source to use its "identity" response curves for future RGB transfers. The identity
|
||||
|
@@ -8,8 +8,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class DGImage
|
||||
{
|
||||
ITwainStateInternal _session;
|
||||
internal DGImage(ITwainStateInternal session)
|
||||
ITwainSessionInternal _session;
|
||||
internal DGImage(ITwainSessionInternal session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
_session = session;
|
||||
|
@@ -13,7 +13,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="session">The session.</param>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
internal OpBase(ITwainStateInternal session)
|
||||
internal OpBase(ITwainSessionInternal session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
Session = session;
|
||||
@@ -25,6 +25,6 @@ namespace NTwain.Triplets
|
||||
/// <value>
|
||||
/// The session.
|
||||
/// </value>
|
||||
internal ITwainStateInternal Session { get; private set; }
|
||||
internal ITwainSessionInternal Session { get; private set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user