示例#1
0
        public static void Success(D2fErrorCode result)
        {
            if (result == D2fErrorCode.D2FS_SUCCESS)
            {
                return;
            }

            HandleError(result);
        }
示例#2
0
        public static void BooleanResult(D2fErrorCode result)
        {
            if (result == D2fErrorCode.D2FS_YES || result == D2fErrorCode.D2FS_NO)
            {
                return;
            }

            HandleError(result);
        }
示例#3
0
文件: Ensure.cs 项目: Dawid1990/ndapi
        public static void Success(D2fErrorCode result)
        {
            var success = (result == D2fErrorCode.D2FS_SUCCESS);
            var shouldIgnoreMissingSubclass = (result == D2fErrorCode.D2FS_MISSINGSUBCLMOD && NdapiContext.IgnoreMissingSubclass);
            var shouldIgnoreMissingLibrary  = (result == D2fErrorCode.D2FS_MISSINGLIBMOD && NdapiContext.IgnoreMissingLibrary);

            if (success || shouldIgnoreMissingLibrary || shouldIgnoreMissingSubclass)
            {
                return;
            }

            HandleError(result);
        }
示例#4
0
 private static void HandleError(D2fErrorCode result)
 {
     throw new NdapiException($"The Forms API returned an error. Error code: {result}", result);
 }
示例#5
0
 internal NdapiException(string message, D2fErrorCode code) : this(message)
 {
     ErrorCode = code;
     Data.Add("ndapi.code", (int)ErrorCode);
 }