mirror of
https://github.com/soukoku/ntwain.git
synced 2025-04-05 20:59:23 +08:00
Some CA updates.
This commit is contained in:
parent
830d8a5497
commit
a8891efe3b
@ -35,7 +35,7 @@ namespace NTwain
|
||||
/// The memory data.
|
||||
/// </value>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public byte[] MemData { get; internal set; }
|
||||
public byte[] MemoryData { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the final image information if applicable.
|
||||
|
@ -12,7 +12,7 @@ namespace NTwain.Internals
|
||||
/// The MSG structure in Windows for TWAIN use.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MESSAGE
|
||||
struct MESSAGE
|
||||
{
|
||||
public MESSAGE(IntPtr hwnd, int message, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
|
@ -441,7 +441,7 @@ namespace NTwain.Internals
|
||||
session.SafeSyncableRaiseEvent(new DataTransferredEventArgs
|
||||
{
|
||||
NativeData = dataPtr,
|
||||
MemData = dataArray,
|
||||
MemoryData = dataArray,
|
||||
FileDataPath = filePath,
|
||||
ImageInfo = imgInfo,
|
||||
//ExImageInfo = extInfo
|
||||
|
@ -63,11 +63,11 @@ namespace NTwain
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowsFormsMessageLoopHook"/> class.
|
||||
/// </summary>
|
||||
/// <param name="hwnd">The handle to the app window.</param>
|
||||
/// <param name="windowHandle">The handle to the app window.</param>
|
||||
/// <exception cref="System.ArgumentException">A valid window handle is required.</exception>
|
||||
public WindowsFormsMessageLoopHook(IntPtr hwnd)
|
||||
public WindowsFormsMessageLoopHook(IntPtr windowHandle)
|
||||
{
|
||||
if (hwnd == IntPtr.Zero) { throw new ArgumentException("A valid window handle is required."); }
|
||||
if (windowHandle == IntPtr.Zero) { throw new ArgumentException("A valid window handle is required."); }
|
||||
|
||||
if (!System.Windows.Forms.Application.MessageLoop)
|
||||
{
|
||||
@ -78,7 +78,7 @@ namespace NTwain
|
||||
{
|
||||
ThrowInvalidOp();
|
||||
}
|
||||
Handle = hwnd;
|
||||
Handle = windowHandle;
|
||||
SyncContext = sync;
|
||||
}
|
||||
internal override string InvalidMessage
|
||||
@ -133,11 +133,11 @@ namespace NTwain
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WpfMessageLoopHook"/> class.
|
||||
/// </summary>
|
||||
/// <param name="hwnd">The handle to the app window.</param>
|
||||
/// <param name="windowHandle">The handle to the app window.</param>
|
||||
/// <exception cref="System.ArgumentException">A valid window handle is required.</exception>
|
||||
public WpfMessageLoopHook(IntPtr hwnd)
|
||||
public WpfMessageLoopHook(IntPtr windowHandle)
|
||||
{
|
||||
if (hwnd == IntPtr.Zero) { throw new ArgumentException("A valid window handle is required."); }
|
||||
if (windowHandle == IntPtr.Zero) { throw new ArgumentException("A valid window handle is required."); }
|
||||
|
||||
if (System.Windows.Application.Current == null ||
|
||||
!System.Windows.Application.Current.Dispatcher.CheckAccess())
|
||||
@ -149,7 +149,7 @@ namespace NTwain
|
||||
{
|
||||
ThrowInvalidOp();
|
||||
}
|
||||
Handle = hwnd;
|
||||
Handle = windowHandle;
|
||||
SyncContext = sync;
|
||||
}
|
||||
internal override string InvalidMessage
|
||||
|
@ -16,6 +16,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode Get(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, (DataArgumentType)customDAT, Message.Get);
|
||||
@ -28,6 +29,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode GetCurrent(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, (DataArgumentType)customDAT, Message.GetCurrent);
|
||||
@ -40,6 +42,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode GetDefault(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, (DataArgumentType)customDAT, Message.GetDefault);
|
||||
@ -53,6 +56,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode GetHelp(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, (DataArgumentType)customDAT, Message.GetHelp);
|
||||
@ -66,6 +70,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode GetLabel(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, (DataArgumentType)customDAT, Message.GetLabel);
|
||||
@ -79,6 +84,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode GetLabelEnum(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, (DataArgumentType)customDAT, Message.GetLabelEnum);
|
||||
@ -91,6 +97,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode QuerySupport(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, (DataArgumentType)customDAT, Message.QuerySupport);
|
||||
@ -104,6 +111,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode Reset(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, (DataArgumentType)customDAT, Message.Reset);
|
||||
@ -117,6 +125,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode ResetAll(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, (DataArgumentType)customDAT, Message.ResetAll);
|
||||
@ -133,6 +142,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode Set(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, (DataArgumentType)customDAT, Message.Set);
|
||||
@ -148,6 +158,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="customDAT">The custom DAT_* value from manufacturer.</param>
|
||||
/// <param name="capability">The capability.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "DAT")]
|
||||
public ReturnCode SetConstraint(ushort customDAT, TWCapability capability)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, (DataArgumentType)customDAT, Message.SetConstraint);
|
||||
|
@ -16,7 +16,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Get);
|
||||
@ -29,7 +29,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.GetDefault);
|
||||
@ -43,7 +43,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Reset);
|
||||
@ -60,7 +60,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Set(TWSetupFileXfer setupFileXfer)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
||||
public ReturnCode Set(TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Set);
|
||||
return Dsm.DsmEntry(Session.AppId, Session.CurrentSource.Identity, Message.Set, setupFileXfer);
|
||||
|
@ -6,7 +6,7 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.SetupMemXfer"/>.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mem")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mem")]
|
||||
public sealed class SetupMemXfer : OpBase
|
||||
{
|
||||
internal SetupMemXfer(ITwainSessionInternal session) : base(session) { }
|
||||
@ -16,7 +16,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupMemXfer">The setup mem xfer.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mem"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWSetupMemXfer setupMemXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupMemXfer, Message.Get);
|
||||
|
@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.XferGroup"/>.
|
||||
/// </summary>
|
||||
public sealed class XferGroup : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
||||
public sealed class XferGroup : OpBase
|
||||
{
|
||||
internal XferGroup(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
|
@ -28,6 +28,7 @@ namespace NTwain.Triplets
|
||||
/// <param name="message">The message.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "3#"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "dat"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Dsm")]
|
||||
public ReturnCode DsmEntry(
|
||||
DataGroups group,
|
||||
DataArgumentType dat,
|
||||
|
@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.CieColor"/>.
|
||||
/// </summary>
|
||||
public sealed class CieColor : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cie")]
|
||||
public sealed class CieColor : OpBase
|
||||
{
|
||||
internal CieColor(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
@ -16,7 +17,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="cieColor">Color data.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "cie"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWCieColor cieColor)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.CieColor, Message.Get);
|
||||
|
@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.IccProfile"/>.
|
||||
/// </summary>
|
||||
public sealed class IccProfile : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Icc")]
|
||||
public sealed class IccProfile : OpBase
|
||||
{
|
||||
internal IccProfile(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
|
@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.RgbResponse"/>.
|
||||
/// </summary>
|
||||
public sealed class RgbResponse : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rgb")]
|
||||
public sealed class RgbResponse : OpBase
|
||||
{
|
||||
internal RgbResponse(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
|
@ -19,6 +19,7 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Gets the operations defined for DAT_CIECOLOR.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cie")]
|
||||
public CieColor CieColor
|
||||
{
|
||||
get
|
||||
@ -73,6 +74,7 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Gets the operations defined for DAT_ICCPROFILE.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Icc")]
|
||||
public IccProfile IccProfile
|
||||
{
|
||||
get
|
||||
@ -175,6 +177,7 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Gets the operations defined for DAT_RGBRESPONSE.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rgb")]
|
||||
public RgbResponse RgbResponse
|
||||
{
|
||||
get
|
||||
|
Loading…
Reference in New Issue
Block a user