using TSManagementApp.Enums;
using TSManagementApp.Properties;

namespace TSManagementApp.Utils
{
    public static class GetEnumDescription
    {
        public static string GetTsrStatusString(int status)
        {
            switch(status)
            {
                case (int)TimeStampResponseStatus.Granted:
                    return Resources.TsrStatusString_Granted;
                case (int)TimeStampResponseStatus.GrantedWithMods:
                    return Resources.TsrStatusString_GrantedWithMods;
                case (int)TimeStampResponseStatus.Rejected:
                    return Resources.TsrStatusString_Rejected;
                case (int)TimeStampResponseStatus.Waiting:
                    return Resources.TsrStatusString_Waiting;
                case (int)TimeStampResponseStatus.RevocationWarning:
                    return Resources.TsrStatusString_RevocationWarning;
                case (int)TimeStampResponseStatus.RevocationNotification:
                    return Resources.TsrStatusString_RevocationNotification;
                default:
                    return Resources.TsrStatusString_SwitchDefault;
            }
        }

        public static string GetTsrPkiFailureInfo(int code)
        {
            switch(code)
            {
                case 128:
                    return Resources.TsrPkiFailureInfo_128;
                case 32:
                    return Resources.TsrPkiFailureInfo_32;
                case 4:
                    return Resources.TsrPkiFailureInfo_4;
                case 512:
                    return Resources.TsrPkiFailureInfo_512;
                case 256:
                    return Resources.TsrPkiFailureInfo_256;
                case 8388608:
                    return Resources.TsrPkiFailureInfo_8388608;
                case 4194304:
                    return Resources.TsrPkiFailureInfo_4194304;
                case 1073741824:
                    return Resources.TsrPkiFailureInfo_1073741824;
                default: return Resources.TsrPkiFailureInfo_Default;
            }
        }
    }
}
