Made it possible to create event args externally for testing.

This commit is contained in:
soukoku
2014-09-12 07:16:10 -04:00
parent 81710b7e99
commit 0cd02ac16e
10 changed files with 245 additions and 161 deletions

View File

@@ -1730,12 +1730,13 @@ namespace NTwain.Data
public string ProductName { get { return _productName; } set { value.VerifyLengthUnder(TwainConst.String32 - 1); _productName = value; } }
/// <summary>
/// Creates a <see cref="TWIdentity"/> from assembly values.
/// Creates a <see cref="TWIdentity" /> from assembly values.
/// </summary>
/// <param name="supportedGroups">The supported groups.</param>
/// <param name="assembly">The assembly.</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException">assembly</exception>
/// <exception cref="System.ArgumentNullException">assembly</exception>
/// <exception cref="System.ArgumentException"></exception>
public static TWIdentity CreateFromAssembly(DataGroups supportedGroups, Assembly assembly)
{
if (assembly == null) { throw new ArgumentNullException("assembly"); }
@@ -1755,10 +1756,16 @@ namespace NTwain.Data
/// <param name="productName">Name of the product.</param>
/// <param name="productDescription">The product description.</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException">version</exception>
/// <exception cref="System.ArgumentNullException">assembly</exception>
/// <exception cref="System.ArgumentException"></exception>
public static TWIdentity Create(DataGroups supportedGroups, Version version,
string manufacturer, string productFamily, string productName, string productDescription)
{
if ((supportedGroups & DataGroups.Image) == 0 &&
(supportedGroups & DataGroups.Audio) == 0)
{
throw new ArgumentException(Resources.BadDataGroupsForAppId);
}
if (version == null) { throw new ArgumentNullException("version"); }
return new TWIdentity