public void TestSerialization() { using (var stream = new ComparisonStream(FilePath)) { using (var writer = new AmfWriter(stream)) { writer.Run(this, Name, Format); } stream.AssertSameLength(); } }
private void Write(string path, SerializationFormat format, string name) { EnsureDeleted(path); using (var stream = File.Create(path)) { using (var writer = new AmfWriter(stream)) { writer.Run(this, name, format); stream.Flush(); stream.Close(); } } }
public bool CanBeSaved(SerializationFormat format) { try { using (var stream = new MemoryStream()) { using (var writer = new AmfWriter(stream)) { writer.Run(this, "Test", format); stream.Flush(); stream.Close(); } } } catch (Exception) { return(false); } return(true); }
public bool CanBeSaved(SerializationFormat format) { try { using (var stream = new MemoryStream()) { using (var writer = new AmfWriter(stream)) { writer.Run(this, "Test", format); stream.Flush(); stream.Close(); } } } catch (Exception) { return false; } return true; }