public override void WriteData(APGen gen, XmlWriter writer) { string xml; APGenSection section = gen.GetSectionInstance(this, false); if (section != null) { xml = section.SerializeSection(Name); string externalDataXml = section.ExternalDataXml; string filePath = gen.FileName; if (!String.IsNullOrEmpty(filePath) && !String.IsNullOrEmpty(externalDataXml)) { using (StreamWriter sw = new StreamWriter(filePath)) { sw.Write(externalDataXml); } } } else { xml = gen.GetSectionXml(this); } if (xml != null) { writer.WriteRaw(xml); } }
public override void ReadData(APGen gen, XmlTextReader reader) { if (gen.GetSectionXml(this) != null) { ThrowException(APResource.GetString(APResource.APGen_RedefinedSection, Name), reader); } gen.SetSectionXml(this, reader.ReadOuterXml()); }
public override bool HasDataContent(APGen gen) { return(gen.GetSectionInstance(this, false) != null || gen.GetSectionXml(this) != null); }
public override void WriteData(APGen gen, XmlWriter writer) { string xml; APGenSection section = gen.GetSectionInstance(this, false); if (section != null) { xml = section.SerializeSection(Name); string externalDataXml = section.ExternalDataXml; string filePath = gen.FileName; if (!String.IsNullOrEmpty(filePath) && !String.IsNullOrEmpty(externalDataXml)) { using (StreamWriter sw = new StreamWriter(filePath)) { sw.Write(externalDataXml); } } } else { xml = gen.GetSectionXml(this); } if (xml != null) { writer.WriteRaw(xml); } }
public override void ReadData(APGen gen, XmlTextReader reader) { if (gen.GetSectionXml(this) != null) ThrowException(APResource.GetString(APResource.APGen_RedefinedSection, Name), reader); gen.SetSectionXml(this, reader.ReadOuterXml()); }
public override bool HasDataContent(APGen gen) { return gen.GetSectionInstance(this, false) != null || gen.GetSectionXml(this) != null; }