public override void WriteConfig(Configuration cfg, XmlWriter writer, ConfigurationSaveMode mode) { if (Name != null) { writer.WriteStartElement("sectionGroup"); writer.WriteAttributeString("name", Name); if (TypeName != null && TypeName != "" && TypeName != "System.Configuration.ConfigurationSectionGroup") { writer.WriteAttributeString("type", TypeName); } } else { writer.WriteStartElement("configSections"); } foreach (ConfigInfoCollection col in new object[] { Sections, Groups }) { foreach (string key in col) { ConfigInfo cinfo = col [key]; if (cinfo.HasConfigContent(cfg)) { cinfo.WriteConfig(cfg, writer, mode); } } } writer.WriteEndElement(); }
public override bool HasConfigContent(Configuration cfg) { if (StreamName == cfg.FileName) { return(true); } foreach (ConfigInfoCollection col in new object[] { Sections, Groups }) { foreach (string key in col) { ConfigInfo cinfo = col [key]; if (cinfo.HasConfigContent(cfg)) { return(true); } } } return(false); }