Typos and others.

This commit is contained in:
soukoku
2014-05-22 21:29:22 -04:00
parent 407a529268
commit 3b31c465e6
8 changed files with 18 additions and 24 deletions

View File

@@ -8,10 +8,10 @@ using System.Runtime.InteropServices;
namespace NTwain
{
/// <summary>
/// The one-stop class for reading TWAIN cap values.
/// The one-stop class for reading raw TWAIN cap values.
/// This contains all the properties for the 4 container types.
/// </summary>
public class CapabilityReadOut
public class CapabilityReader
{
/// <summary>
/// Reads the value from a <see cref="TWCapability"/> that was returned
@@ -25,7 +25,7 @@ namespace NTwain
/// or
/// capability
/// </exception>
public static CapabilityReadOut ReadValue(TWCapability capability)
public static CapabilityReader ReadValue(TWCapability capability)
{
if (capability == null) { throw new ArgumentNullException("capability"); }
if (capability.Container == IntPtr.Zero) { throw new ArgumentException(Resources.CapHasNoData, "capability"); }
@@ -37,22 +37,22 @@ namespace NTwain
switch (capability.ContainerType)
{
case ContainerType.Array:
return new CapabilityReadOut
return new CapabilityReader
{
ContainerType = capability.ContainerType,
}.ReadArrayValue(baseAddr);
case ContainerType.Enum:
return new CapabilityReadOut
return new CapabilityReader
{
ContainerType = capability.ContainerType,
}.ReadEnumValue(baseAddr);
case ContainerType.OneValue:
return new CapabilityReadOut
return new CapabilityReader
{
ContainerType = capability.ContainerType,
}.ReadOneValue(baseAddr);
case ContainerType.Range:
return new CapabilityReadOut
return new CapabilityReader
{
ContainerType = capability.ContainerType,
}.ReadRangeValue(baseAddr);
@@ -161,7 +161,7 @@ namespace NTwain
#region reader methods
CapabilityReadOut ReadOneValue(IntPtr baseAddr)
CapabilityReader ReadOneValue(IntPtr baseAddr)
{
int offset = 0;
ItemType = (ItemType)(ushort)Marshal.ReadInt16(baseAddr, offset);
@@ -170,7 +170,7 @@ namespace NTwain
return this;
}
CapabilityReadOut ReadArrayValue(IntPtr baseAddr)
CapabilityReader ReadArrayValue(IntPtr baseAddr)
{
int offset = 0;
ItemType = (ItemType)(ushort)Marshal.ReadInt16(baseAddr, offset);
@@ -188,7 +188,7 @@ namespace NTwain
return this;
}
CapabilityReadOut ReadEnumValue(IntPtr baseAddr)
CapabilityReader ReadEnumValue(IntPtr baseAddr)
{
int offset = 0;
ItemType = (ItemType)(ushort)Marshal.ReadInt16(baseAddr, offset);
@@ -210,7 +210,7 @@ namespace NTwain
return this;
}
CapabilityReadOut ReadRangeValue(IntPtr baseAddr)
CapabilityReader ReadRangeValue(IntPtr baseAddr)
{
int offset = 0;
ItemType = (ItemType)(ushort)Marshal.ReadInt16(baseAddr, offset);

View File

@@ -926,7 +926,7 @@ namespace NTwain.Data
{
if (toPopulate == null) { toPopulate = new List<object>(); }
var read = CapabilityReadOut.ReadValue(this);
var read = CapabilityReader.ReadValue(this);
switch (read.ContainerType)
{

View File

@@ -93,14 +93,12 @@ namespace NTwain
/// <summary>
/// Gets the manager status. Only call this at state 2 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
TWStatus GetStatus();
/// <summary>
/// Gets the manager status. Only call this at state 3 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
TWStatusUtf8 GetStatusUtf8();
}

View File

@@ -52,7 +52,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="CapabilityReadout.cs" />
<Compile Include="CapabilityReader.cs" />
<Compile Include="Data\TypeReader.cs" />
<Compile Include="Data\TwainTypesExtended.cs" />
<Compile Include="DeviceEventArgs.cs" />

View File

@@ -318,7 +318,6 @@ namespace NTwain
/// <summary>
/// Gets the manager status. Only call this at state 2 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
public TWStatus GetStatus()
{
@@ -330,7 +329,6 @@ namespace NTwain
/// <summary>
/// Gets the manager status. Only call this at state 3 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
public TWStatusUtf8 GetStatusUtf8()
{

View File

@@ -21,7 +21,7 @@ namespace NTwain
var rc = _session.DGControl.Capability.QuerySupport(cap);
if (rc == ReturnCode.Success)
{
var read = CapabilityReadOut.ReadValue(cap);
var read = CapabilityReader.ReadValue(cap);
if (read.ContainerType == ContainerType.OneValue)
{
@@ -44,7 +44,7 @@ namespace NTwain
var rc = _session.DGControl.Capability.GetCurrent(cap);
if (rc == ReturnCode.Success)
{
var read = CapabilityReadOut.ReadValue(cap);
var read = CapabilityReader.ReadValue(cap);
switch (read.ContainerType)
{

View File

@@ -20,7 +20,7 @@ namespace NTwain
internal static TwainSource GetInstance(ITwainSessionInternal session, TWIdentity sourceId)
{
var key = string.Format("{0}|{1}", sourceId.Manufacturer, sourceId.ProductFamily, sourceId.ProductName);
var key = string.Format(CultureInfo.InvariantCulture, "{0}|{1}|{2}", sourceId.Manufacturer, sourceId.ProductFamily, sourceId.ProductName);
if (__globalInstances.ContainsKey(key))
{
return __globalInstances[key];
@@ -88,7 +88,6 @@ namespace NTwain
/// <summary>
/// Gets the source status. Only call this at state 4 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
public TWStatus GetStatus()
{
@@ -99,7 +98,6 @@ namespace NTwain
/// <summary>
/// Gets the source status. Only call this at state 4 or higher.
/// </summary>
/// <param name="session">The session.</param>
/// <returns></returns>
public TWStatusUtf8 GetStatusUtf8()
{