internal ExchangeConfigStore() { _executor = ExecutorServiceFactory.CreateExecutorService(); _cfgExchange = ConfigApplicationFactory.Get <IConfig_ExchangeServer>(); ConfigStoreManager.PullValues(this); //ConfigStoreManager.Register(new System.Runtime.Remoting.ObjectHandle(this)); }
static void Main(string[] args) { if (args == null || args.Length < 1) { Console.WriteLine("Invalid arguments passed."); return; } string getEnv = string.Empty; getEnv = Environment.GetEnvironmentVariable("BMCConfigPath", EnvironmentVariableTarget.Machine); Console.WriteLine("getEnv :" + getEnv); if (string.IsNullOrWhiteSpace(getEnv)) { getEnv = Path.GetFullPath(Path.Combine(Extensions.GetStartupDirectory(), "..")); Environment.SetEnvironmentVariable("BMCConfigPath", getEnv, EnvironmentVariableTarget.Machine); } IConfigApplication app = null; switch (args[0].ToLower()) { case "exchangeserver": app = ConfigApplicationFactory.Get <IConfig_ExchangeServer>(); break; case "exchangeclient": app = ConfigApplicationFactory.Get <IConfig_ExchangeClient>(); break; case "enterpriseserver": app = ConfigApplicationFactory.Get <IConfig_EnterpriseServer>(); break; case "enterpriseclient": app = ConfigApplicationFactory.Get <IConfig_EnterpriseClient>(); break; default: break; } if (app == null) { Console.WriteLine("Invalid arguments passed."); return; } if (args.Length > 1 && args[1].ToLower() == "u") { app.RemoveValues(); } else { app.InitializeToDefaultValues(); } app.Save(); Console.WriteLine("Configuration saved successfully."); }
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)); }
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); }
internal EBSConfigStore() { _executor = ExecutorServiceFactory.CreateExecutorService(); _cfgExchange = ConfigApplicationFactory.Get <IConfig_ExchangeServer>(); ConfigStoreManager.PullValues(this); }
public static void SetRegKeyValue(string keyName, string valueName, RegistryValueKind valueType, object value) { ConfigApplicationFactory.SetValue(GetFullKeyName(keyName), valueName, value.ToString()); }
static MonitorHandlerBase() { _configExchange = ConfigApplicationFactory.GetAny <IConfig_ExchangeServer>(); }
private void cboInstallationTypes_SelectedIndexChanged(object sender, EventArgs e) { ModuleProc PROC = new ModuleProc("", "cboInstallationTypes_SelectedIndexChanged"); try { ComboBoxItem <string> cbItem = cboInstallationTypes.SelectedItem as ComboBoxItem <string>; _config = ConfigApplicationFactory.Get(cbItem.Value); ConfigKeyValuePairTopDictionary keyValues = _config.KeyValues; _classRoot = null; _selectedClass = null; tvwSections.Nodes.Clear(); // find the class hierarchy char[] dirChars = new char[] { '\\' }; RegClassNames classNames = new RegClassNames(); RegClassName classParent = null; foreach (var pair1 in keyValues) { string[] values = pair1.Key.Split(dirChars); foreach (string value in values) { if (!classNames.ContainsKey(value)) { RegClassName child = new RegClassName(value); child.RefKeyName = pair1.Key; TreeNode node = new TreeNode(child.ClassName, 2, 2); child.Node = node; node.Tag = child; if (classParent != null) { classParent.Children.Add(child); } classNames.Add(value, child); if (classParent == null) { _classRoot = child; tvwSections.Nodes.Add(node); } else { classParent.Node.Nodes.Add(node); classParent = child; } } else { classParent = classNames[value]; } } } if (tvwSections.Nodes.Count > 0) { tvwSections.Nodes[0].ExpandAll(); tvwSections.SelectedNode = tvwSections.Nodes[0]; } } catch (Exception ex) { Log.Exception(PROC, ex); } }