public void Save() { Core.SerializerXML _stream = null; try { _stream = new Core.SerializerXML(s_File, "1.0.0.0"); _stream.OpenOutputStream(s_FilePath); _stream.WriteElementStart("Application"); WriteToSerializer(_stream); _stream.WriteElementEnd("Application"); _stream.CloseOutputStream(); _stream = null; } catch (Exception e) { GUI.DlgError.HandleException(e); } finally { if (_stream != null) { _stream.CloseOutputStream(); } } }
public void Load() { string DocType = string.Empty; Core.SerializerXML _stream = null; try { _stream = new Core.SerializerXML(s_File, "1.0.0.0"); _stream.OpenInputStream(s_FilePath); if (_stream.GetDetectedSerializerName() != s_File) { throw new FormatException(""); } string NodeGroup; do { NodeGroup = _stream.GetNodeName(); if (_stream.GetNodeType() != Core.SerializerBase.NodeType.NodeEnd) { if (NodeGroup == "Application") { ReadFromSerializer(_stream); } } } while (_stream.ReadNext()); _stream.CloseInputStream(); _stream = null; } catch (Exception e) { GUI.DlgError.HandleException(e); } finally { if (_stream != null) { _stream.CloseInputStream(); } } }