mirror of
https://github.com/soukoku/ntwain.git
synced 2026-02-25 13:04:07 +08:00
Added wrapper for all caps. String types will need more testing.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user