Added wrapper for all caps. String types will need more testing.

This commit is contained in:
soukoku
2015-02-20 07:12:02 -05:00
parent 35b0550c3d
commit 20a8305214
2 changed files with 243 additions and 12 deletions

View File

@@ -102,7 +102,7 @@ namespace NTwain.Data
}
/// <summary>
/// Tries to convert to a value to <see cref="TWFix32"/> if possible.
/// Tries to convert a value to <see cref="TWFix32"/> if possible.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
@@ -119,6 +119,34 @@ namespace NTwain.Data
return default(TWFix32);
}
/// <summary>
/// Tries to cast a value to <see cref="TWFrame"/> if possible.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
public static TWFrame ConvertToFrame(this object value)
{
if (value != null)
{
if (value is TWFrame)
{
return (TWFrame)value;
}
}
return default(TWFrame);
}
/// <summary>
/// Converts object to string.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
public static string ConvertToString(this object value)
{
if (value == null) { return null; }
return value.ToString();
}
///// <summary>
///// Routine that does nothing.