public bool GetContextStatus(out ContextStatus status)
{
CheckContextOpen();
status = ContextStatus.Stopped;
int result = NativeMethods.GetContextStatus(_contextId);
if(result != NativeMethods.ERRORCODE_INVALID_CONTEXT) {
switch(result) {
case NativeMethods.STATUS_PAUSED: {
status = ContextStatus.Paused;
break;
}
case NativeMethods.STATUS_STOPPED: {
status = ContextStatus.Stopped;
break;
}
case NativeMethods.STATUS_WIPE: {
status = ContextStatus.Wipe;
break;
}
}
// synchronize the native status with the managed one
_status = status;
return true;
}
return false;
}