private void Serialize() { using (var stream = new MemoryStream()) { _serializer.Serialize(stream); IoC.Get <IToolboxStateBackupProvider>().CreateBackupFromStream(stream); } }
public override void StoreSettings() { var document = new XmlDocument(); using (var stream = new MemoryStream()) { _serializer.Serialize(stream); stream.Seek(0L, SeekOrigin.Begin); document.Load(stream); } if (document.FirstChild.NodeType == XmlNodeType.XmlDeclaration) { document.RemoveChild(document.FirstChild); } SetSettingsModel(document, true); }