mirror of
https://github.com/soukoku/ntwain.git
synced 2025-11-08 10:34:47 +08:00
Added one direct triplet call for custom values.
This commit is contained in:
@@ -202,6 +202,9 @@
|
|||||||
<Compile Include="..\NTwain\Triplets\DGControl\DGControl.XferGroup.cs">
|
<Compile Include="..\NTwain\Triplets\DGControl\DGControl.XferGroup.cs">
|
||||||
<Link>Triplets\DGControl\DGControl.XferGroup.cs</Link>
|
<Link>Triplets\DGControl\DGControl.XferGroup.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\NTwain\Triplets\DGCustom.cs">
|
||||||
|
<Link>Triplets\DGCustom.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\NTwain\Triplets\DGImage\DGImage.CieColor.cs">
|
<Compile Include="..\NTwain\Triplets\DGImage\DGImage.CieColor.cs">
|
||||||
<Link>Triplets\DGImage\DGImage.CieColor.cs</Link>
|
<Link>Triplets\DGImage\DGImage.CieColor.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ namespace NTwain
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
DGImage DGImage { get; }
|
DGImage DGImage { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the direct triplet operation entry for custom values.
|
||||||
|
/// </summary>
|
||||||
|
DGCustom DGCustom { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens the data source manager. This must be the first method used
|
/// Opens the data source manager. This must be the first method used
|
||||||
/// before using other TWAIN functions. Calls to this must be followed by <see cref="CloseManager"/> when done with a TWAIN session.
|
/// before using other TWAIN functions. Calls to this must be followed by <see cref="CloseManager"/> when done with a TWAIN session.
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
<Compile Include="Triplets\DGControl\DGControl.Callback2.cs" />
|
<Compile Include="Triplets\DGControl\DGControl.Callback2.cs" />
|
||||||
<Compile Include="Triplets\DGControl\DGControl.CapabilityCustom.cs" />
|
<Compile Include="Triplets\DGControl\DGControl.CapabilityCustom.cs" />
|
||||||
<Compile Include="Triplets\DGImage\DGImage.Filter.cs" />
|
<Compile Include="Triplets\DGImage\DGImage.Filter.cs" />
|
||||||
|
<Compile Include="Triplets\DGCustom.cs" />
|
||||||
<Compile Include="Triplets\OpBase.cs" />
|
<Compile Include="Triplets\OpBase.cs" />
|
||||||
<Compile Include="Triplets\Dsm.Linux.cs" />
|
<Compile Include="Triplets\Dsm.Linux.cs" />
|
||||||
<Compile Include="Triplets\Dsm.WinOld.cs" />
|
<Compile Include="Triplets\Dsm.WinOld.cs" />
|
||||||
|
|||||||
43
NTwain/Triplets/DGCustom.cs
Normal file
43
NTwain/Triplets/DGCustom.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using NTwain.Data;
|
||||||
|
using NTwain.Internals;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NTwain.Triplets
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides direct access to the triplet call.
|
||||||
|
/// </summary>
|
||||||
|
public class DGCustom
|
||||||
|
{
|
||||||
|
ITwainSessionInternal _session;
|
||||||
|
internal DGCustom(ITwainSessionInternal session)
|
||||||
|
{
|
||||||
|
if (session == null) { throw new ArgumentNullException("session"); }
|
||||||
|
_session = session;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Direct DSM_Entry call with full arguments for custom values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="group">The group.</param>
|
||||||
|
/// <param name="dat">The dat.</param>
|
||||||
|
/// <param name="message">The message.</param>
|
||||||
|
/// <param name="data">The data.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public ReturnCode DsmEntry(
|
||||||
|
DataGroups group,
|
||||||
|
DataArgumentType dat,
|
||||||
|
Message message,
|
||||||
|
ref IntPtr data)
|
||||||
|
{
|
||||||
|
_session.VerifyState(3, 7, group, dat, message);
|
||||||
|
return Dsm.DsmEntry(_session.AppId, _session.SourceId, group, dat, message, ref data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo: add other data value types?
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -204,6 +204,19 @@ namespace NTwain
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DGCustom _dgCustom;
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the direct triplet operation entry for custom values.
|
||||||
|
/// </summary>
|
||||||
|
public DGCustom DGCustom
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_dgCustom == null) { _dgCustom = new DGCustom(this); }
|
||||||
|
return _dgCustom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region INotifyPropertyChanged Members
|
#region INotifyPropertyChanged Members
|
||||||
|
|||||||
Reference in New Issue
Block a user