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)); }
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); }