public static string EncryptServerEdition(ServerEditionType edition)
        {
            ServerEditionValue serverEditionValue;
            ServerEditionValue serverEditionValue2;

            switch (edition)
            {
            case ServerEditionType.Standard:
                serverEditionValue  = ServerEditionValue.Standard;
                serverEditionValue2 = ServerEditionValue.Standard;
                break;

            case ServerEditionType.StandardEvaluation:
                serverEditionValue  = ServerEditionValue.Standard;
                serverEditionValue2 = ServerEditionValue.Evaluation;
                break;

            case ServerEditionType.Enterprise:
                serverEditionValue  = ServerEditionValue.Enterprise;
                serverEditionValue2 = ServerEditionValue.Enterprise;
                break;

            case ServerEditionType.EnterpriseEvaluation:
                serverEditionValue  = ServerEditionValue.Enterprise;
                serverEditionValue2 = ServerEditionValue.Evaluation;
                break;

            case ServerEditionType.Coexistence:
                serverEditionValue  = ServerEditionValue.Coexistence;
                serverEditionValue2 = ServerEditionValue.Coexistence;
                break;

            case ServerEditionType.CoexistenceEvaluation:
                serverEditionValue  = ServerEditionValue.Coexistence;
                serverEditionValue2 = ServerEditionValue.Evaluation;
                break;

            default:
                throw new ArgumentException(DataStrings.UnsupportServerEdition(edition.ToString()), "edition");
            }
            ServerEdition serverEdition = new ServerEdition(serverEditionValue, serverEditionValue2);

            return(serverEdition.EncryptServerType());
        }
        public static ServerEditionType DecryptServerEdition(string serverTypeInAD)
        {
            if (serverTypeInAD == null)
            {
                throw new ArgumentNullException("serverTypeInAD");
            }
            if (serverTypeInAD.Length != 32)
            {
                return(ServerEditionType.Unknown);
            }
            ServerEdition serverEdition = new ServerEdition(serverTypeInAD);

            if (serverEdition.IsStandard && !serverEdition.IsEvaluation)
            {
                return(ServerEditionType.Standard);
            }
            if (serverEdition.IsStandard && serverEdition.IsEvaluation)
            {
                return(ServerEditionType.StandardEvaluation);
            }
            if (serverEdition.IsEnterprise && !serverEdition.IsEvaluation)
            {
                return(ServerEditionType.Enterprise);
            }
            if (serverEdition.IsEnterprise && serverEdition.IsEvaluation)
            {
                return(ServerEditionType.EnterpriseEvaluation);
            }
            if (serverEdition.IsCoexistence && !serverEdition.IsEvaluation)
            {
                return(ServerEditionType.Coexistence);
            }
            if (serverEdition.IsCoexistence && serverEdition.IsEvaluation)
            {
                return(ServerEditionType.CoexistenceEvaluation);
            }
            return(ServerEditionType.Unknown);
        }