using System; namespace ArchestrAServices.Contract; public static class EnumASBFactory { public static ArchestrAError IntToArchestrAError(ushort iValue) { try { return (ArchestrAError)iValue; } catch (Exception) { return ArchestrAError.Unknown; } } public static ushort ArchestrAErrorToInt(ArchestrAError eValue) { return (ushort)eValue; } public static CredentialType IntToCredentialType(ushort iValue) { try { return (CredentialType)iValue; } catch (Exception) { return CredentialType.Other; } } public static ushort CredentialTypeToInt(CredentialType eValue) { return (ushort)eValue; } public static EncryptionType IntToEncryptionType(ushort iValue) { try { return (EncryptionType)iValue; } catch (Exception) { return EncryptionType.None; } } public static ushort EncryptionTypeToInt(EncryptionType eValue) { return (ushort)eValue; } public static CredentialValidity IntToCredentialValidity(ushort iValue) { try { return (CredentialValidity)iValue; } catch (Exception) { return CredentialValidity.UesrIdentityValidityUnknown; } } public static ushort CredentialValidityToInt(CredentialValidity eValue) { return (ushort)eValue; } }