mirror of
https://github.com/soukoku/ntwain.git
synced 2025-11-25 18:00:27 +08:00
Some internal refactoring.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Callback : OpBase
|
||||
{
|
||||
internal Callback(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Callback2 : OpBase
|
||||
{
|
||||
internal Callback2(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class Capability : OpBase
|
||||
{
|
||||
internal Capability(TwainSession session) : base(session) { }
|
||||
internal Capability(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the Source’s Current, Default and Available Values for a specified capability.
|
||||
/// </summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class CustomDSData : OpBase
|
||||
{
|
||||
internal CustomDSData(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class DeviceEvent : OpBase
|
||||
{
|
||||
internal DeviceEvent(TwainSession 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);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class EntryPoint : OpBase
|
||||
{
|
||||
internal EntryPoint(TwainSession session) : base(session) { }
|
||||
internal EntryPoint(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Gets the function entry points for twain 2.0 or higher.
|
||||
/// </summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Event : OpBase
|
||||
{
|
||||
internal Event(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class FileSystem : OpBase
|
||||
{
|
||||
internal FileSystem(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class Identity : OpBase
|
||||
{
|
||||
internal Identity(TwainSession 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
|
||||
@@ -19,8 +19,8 @@ namespace NTwain.Triplets
|
||||
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.Identity, Message.CloseDS);
|
||||
var rc = PInvoke.DsmEntry(Session.AppId, Message.CloseDS, Session.SourceId);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.State = 3;
|
||||
{
|
||||
Session.ChangeState(3, true);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -74,8 +74,8 @@ namespace NTwain.Triplets
|
||||
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Identity, Message.OpenDS);
|
||||
var rc = PInvoke.DsmEntry(Session.AppId, Message.OpenDS, source);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.State = 4;
|
||||
{
|
||||
Session.ChangeState(4, true);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class Parent : OpBase
|
||||
{
|
||||
internal Parent(TwainSession 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
|
||||
@@ -23,7 +23,7 @@ namespace NTwain.Triplets
|
||||
var rc = PInvoke.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm, ref handle);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.State = 2;
|
||||
Session.ChangeState(2, true);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace NTwain.Triplets
|
||||
var rc = PInvoke.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm, ref handle);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.State = 3;
|
||||
Session.ChangeState(3, true);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class PassThru : OpBase
|
||||
{
|
||||
internal PassThru(TwainSession 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.
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class PendingXfers : OpBase
|
||||
{
|
||||
internal PendingXfers(TwainSession 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
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class SetupFileXfer : OpBase
|
||||
{
|
||||
internal SetupFileXfer(TwainSession 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.
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class SetupMemXfer : OpBase
|
||||
{
|
||||
internal SetupMemXfer(TwainSession session) : base(session) { }
|
||||
internal SetupMemXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the Source’s preferred, minimum, and maximum allocation sizes for transfer memory
|
||||
/// buffers.
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class Status : OpBase
|
||||
{
|
||||
internal Status(TwainSession session) : base(session) { }
|
||||
internal Status(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
/// Returns the current Condition Code for the Source Manager.
|
||||
/// </summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class StatusUtf8 : OpBase
|
||||
{
|
||||
internal StatusUtf8(TwainSession 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.
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
sealed class UserInterface : OpBase
|
||||
{
|
||||
internal UserInterface(TwainSession 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
|
||||
@@ -23,7 +23,7 @@ namespace NTwain.Triplets
|
||||
var rc = PInvoke.DsmEntry(Session.AppId, Session.SourceId, Message.DisableDS, userInterface);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.State = 4;
|
||||
Session.ChangeState(4, true);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
{
|
||||
public sealed class XferGroup : OpBase
|
||||
{
|
||||
internal XferGroup(TwainSession 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
|
||||
/// only supply one of the DGs specified in the SupportedGroups field of origin.
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
public sealed class DGControl
|
||||
{
|
||||
TwainSession _session;
|
||||
internal DGControl(TwainSession session)
|
||||
ITwainSessionInternal _session;
|
||||
internal DGControl(ITwainSessionInternal session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
_session = session;
|
||||
|
||||
Reference in New Issue
Block a user