/// <summary> /// Evaluate the result code and will raise an exception if necessary. /// </summary> /// <param name="resultCode">Native result code.</param> private void EvaluateResultCode(ErrorCodes resultCode) { if (resultCode != ErrorCodes.DS_ERR_OK) { throw new ArgumentException(NativeImp.DS_ErrorCodeToErrorMessage((int)resultCode).PtrToString()); } }