public static String ErrorCodeToString(ErrorCode value)
{
String str;
switch (value)
{
case ErrorCode.AccessViolated:
str = "scope-of-access-violated";
break;
case ErrorCode.DataBlockNumberInvalid:
str = "data-block-number-invalid";
break;
case ErrorCode.DataBlockUnavailable:
str = "data-block-unavailable";
break;
case ErrorCode.HardwareFault:
str = "hardware-fault";
break;
case ErrorCode.InconsistentClass:
str = "object-class-inconsistent";
break;
case ErrorCode.LongGetOrReadAborted:
str = "long-Get-aborted";
break;
case ErrorCode.LongSetOrWriteAborted:
str = "long-set-aborted";
break;
case ErrorCode.NoLongGetOrReadInProgress:
str = "no-long-Get-in-progress";
break;
case ErrorCode.NoLongSetOrWriteInProgress:
str = "no-long-set-in-progress";
break;
case ErrorCode.Ok:
str = "success";
break;
case ErrorCode.OtherReason:
str = "other-reason";
break;
case ErrorCode.ReadWriteDenied:
str = "read-write-denied";
break;
case ErrorCode.TemporaryFailure:
str = "temporary-failure";
break;
case ErrorCode.UnavailableObject:
str = "object-unavailable";
break;
case ErrorCode.UndefinedObject:
str = "object-undefined";
break;
case ErrorCode.UnmatchedType:
str = "type-unmatched";
break;
default:
throw new ArgumentOutOfRangeException("Error code: " + value);
}
return str;
}