Exemple #1
0
        public static string GetRegKeyValue(string keyName, string valueName, object defaultValue)
        {
            string defaultValue2 = string.Empty;

            if (defaultValue != null)
            {
                defaultValue2 = defaultValue.ToString();
            }
            return(ConfigApplicationFactory.GetValue(GetFullKeyName(keyName), valueName, defaultValue2));
        }
Exemple #2
0
        public static BMCInstallationType GetInstallationType()
        {
            BMCInstallationType insType = BMCInstallationType.None;

            try
            {
                string installationType = ConfigApplicationFactory.GetValue("Honeyframe", "InstallationType").ToUpper();
                switch (installationType)
                {
                case "EXCHANGECLIENT":
                    insType = BMCInstallationType.ExchangeClient;
                    break;

                case "EXCHANGESERVER":
                    insType = BMCInstallationType.ExchangeServer;
                    break;

                case "ENTERPRISECLIENT":
                    insType = BMCInstallationType.EnterpriseClient;
                    break;

                case "ENTERPRISESERVER":
                    insType = BMCInstallationType.EnterpriseServer;
                    break;

                default:
                    break;
                }

                ActualInstallationType = ((insType == BMCInstallationType.EnterpriseServer) || (insType == BMCInstallationType.EnterpriseClient) ?
                                          BMCCategorizedInstallationTypes.Enterprise : BMCCategorizedInstallationTypes.Exchange);
                ActualApplicationType = ((insType == BMCInstallationType.EnterpriseServer) || (insType == BMCInstallationType.ExchangeServer) ?
                                         BMCCategoriedApplicationTypes.Server : BMCCategoriedApplicationTypes.Client);

                if (ActiveInstallationType == BMCCategorizedInstallationTypes.None)
                {
                    ActiveInstallationType = ActualInstallationType;
                }
                BMC.Common.LogManagement.LogManager.WriteLog("GetInstallationType returns : " + insType.ToString(), BMC.Common.LogManagement.LogManager.enumLogLevel.Debug);
                BMC.Common.LogManagement.LogManager.WriteLog("ActiveInstallationType  returns : " + ActiveInstallationType.ToString(), BMC.Common.LogManagement.LogManager.enumLogLevel.Debug);
            }
            catch { }

            if (insType == BMCInstallationType.None)
            {
                Environment.FailFast("Installation Type does not available.");
            }
            return(insType);
        }