Example #1
0
        public static IReadOnlyDictionary <string, ManagerDefinition> GetManagers([NotNull] XmlDocument configuration)
        {
            Assert.ArgumentNotNull(configuration, nameof(configuration));

            return(configuration
                   .SelectElements("/configuration/sitecore/*/providers")
                   .Select(p => (XmlElement)p.ParentNode)
                   .Select(m => ManagerDefinition.Parse(m))
                   .ToDictionary(m => m.Name, x => x));
        }
Example #2
0
        public static ManagerDefinition GetManager([NotNull] XmlDocument configuration, [NotNull] string name)
        {
            Assert.ArgumentNotNull(configuration, nameof(configuration));
            Assert.ArgumentNotNull(name, nameof(name));

            var manager = configuration.SelectSingleNode("/configuration/sitecore/" + name) as XmlElement;

            if (manager != null)
            {
                return(ManagerDefinition.Parse(manager));
            }

            return(null);
        }