Added named state enum.

This commit is contained in:
soukoku
2015-01-07 21:34:56 -05:00
parent 1ae051e933
commit 1ce7c5caf5
5 changed files with 73 additions and 2 deletions

View File

@@ -41,7 +41,10 @@ namespace NTwain
_appId = appId;
_ownedSources = new Dictionary<string, DataSource>();
((ITwainSessionInternal)this).ChangeState(1, false);
if (PlatformInfo.Current.IsSupported)
{
((ITwainSessionInternal)this).ChangeState(2, false);
}
#if DEBUG
// defaults to false on release since it's only useful during dev
EnforceState = true;
@@ -144,7 +147,7 @@ namespace NTwain
return null;
}
int _state;
int _state = 1;
/// <summary>
/// Gets the current state number as defined by the TWAIN spec.
/// </summary>
@@ -165,6 +168,20 @@ namespace NTwain
}
}
/// <summary>
/// Gets the named state value as defined by the TWAIN spec.
/// </summary>
/// <value>
/// The state.
/// </value>
public State StateEx
{
get
{
return (State)_state;
}
}
/// <summary>
/// Quick flag to check if the DSM has been opened.
/// </summary>