private bool ValidResult(int result)
{
switch(result) {
case NativeMethods.ERRORCODE_INITIALIZATION: {
Debug.ReportWarning("Context not initialized");
break;
}
case NativeMethods.ERRORCODE_INVALID_CONTEXT: {
Debug.ReportWarning("Invalid context Id");
break;
}
case NativeMethods.ERRORCODE_INVALID_REQUEST: {
Debug.ReportWarning("Invalid request");
break;
}
case NativeMethods.ERRORCODE_NO_MORE_CONTEXTS: {
Debug.ReportWarning("No more context slots available");
break;
}
}
return (result == NativeMethods.ERRORCODE_SUCCESS);
}