internal ExchangeConfigStore()
 {
     _executor    = ExecutorServiceFactory.CreateExecutorService();
     _cfgExchange = ConfigApplicationFactory.Get <IConfig_ExchangeServer>();
     ConfigStoreManager.PullValues(this);
     //ConfigStoreManager.Register(new System.Runtime.Remoting.ObjectHandle(this));
 }
示例#2
0
        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.");
        }
示例#3
0
 internal EBSConfigStore()
 {
     _executor    = ExecutorServiceFactory.CreateExecutorService();
     _cfgExchange = ConfigApplicationFactory.Get <IConfig_ExchangeServer>();
     ConfigStoreManager.PullValues(this);
 }
示例#4
0
        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);
            }
        }