Пример #1
0
        public void LoadQueueConfig()
        {
            var config = QueueServerConfig.GetConfig();

            var items = config.RemoteQueueSettings;

            foreach (QueueServerConfigItem item in items)
            {
                var prop = new QProperties(item.QueueName, item.IsTrans, (CoverMode)item.CoverMode);
                AddQueue(prop);
                QLog.Info("Queue Added: {0}", prop.Print());
            }

            //if (!QueueLoaded)
            //{
            //    System.Configuration.Configuration config =
            //ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            //    XmlDocument doc = new XmlDocument();
            //    doc.Load(config.FilePath);

            //    Console.WriteLine("Load Config: " + config.FilePath);

            //    XmlNode root = doc.SelectSingleNode("//remoteSettings");
            //    XmlNodeList list = root.ChildNodes;

            //    for (int i = 0; i < list.Count; i++)
            //    {
            //        //n.FirstChild.ChildNodes[1].InnerText
            //        McQueueProperties prop =
            //            new McQueueProperties(list[i]);
            //        //prop.ConnectionString = ConnectionString;
            //        //prop.Provider = Provider;
            //        Console.WriteLine("Load: " + prop.QueueName);

            //        RemoteQueueManager.AddQueue(prop);
            //    }
            //    QueueLoaded = true;
            //}
        }