protected override void CommitChanges(XmlDocument xmlDocument) { using (MemoryStream w = new MemoryStream()) { xmlDocument.Save(w); using (XMLEncryptor enc = new XMLEncryptor(Password)) { enc.WriteEncryptedXML(w, Path); } } }
public override XmlDocument LoadXmlDocument() { using (XMLEncryptor enc = new XMLEncryptor(Password)) { XmlDocument xmlDocument = new XmlDocument(); Stream r = enc.ReadEncryptedXML(Path); if (r != null) { xmlDocument.Load(r); r.Dispose(); } else { using (TextReader reader = new StreamReader(Path)) { xmlDocument.Load(reader); } } return xmlDocument; } }