using System.Collections.Generic; using System.Linq; using System.Xml; namespace BetterPatchFileCreator.Code { public class DeployConfigCollection : List { public void LoadFromXmlNode(XmlNode node) { foreach (XmlNode n in node.ChildNodes) { DeployConfig config = new DeployConfig(); config.LoadFromXmlNode(n); this.Add(config); } } public XmlNode ToXmlNode(XmlDocument doc) { XmlNode root = doc.CreateElement("DeployConfigs"); foreach (var config in this) { root.AppendChild(config.ToXmlNode(doc)); } return root; } public DeployConfig this[string index]{ get { return this.FirstOrDefault(config => config.Name == index); }} } }