Trac.Core.TracConfiguration.Load C# (CSharp) Method

Load() public method

public Load ( ) : void
return void
        public void Load()
        {
            var xmlDocument = new XmlDocument();
            xmlDocument.Load(_xmlPath);

            var tracAdminNode = xmlDocument.SelectSingleNode("/configuration/tracConfig");
            TracAdmin = tracAdminNode.Attributes["tracAdmin"].Value;
            var node = tracAdminNode.Attributes["inherit"];
            InheritInit = node == null ? null : node.Value;

            var pluginNodes = xmlDocument.SelectNodes("/configuration/tracConfig/plugins/add[@service]");
            Plugins = new Dictionary<string, PluginConfig>();
            foreach (XmlNode pluginNode in pluginNodes)
            {
                var service = pluginNode.Attributes["service"].Value;
                Plugins.Add(service, new PluginConfig(service,
                                             pluginNode.Attributes["cfgFile"].Value));
            }
        }

Usage Example

Esempio n. 1
0
 static TracConfig()
 {
     Settings = new TracConfiguration(Path.Combine(ServiceConfig.ServicesDllLocation, "Trac.dll.config"));
     Settings.Load();
 }
TracConfiguration