Exemplo n.º 1
0
 public void TestSerialization()
 {
     using (var stream = new ComparisonStream(FilePath))
     {
         using (var writer = new AmfWriter(stream))
         {
             writer.Run(this, Name, Format);
         }
         stream.AssertSameLength();
     }
 }
Exemplo n.º 2
0
 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();
         }
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public void TestSerialization()
 {
     using (var stream = new ComparisonStream(FilePath))
     {
         using (var writer = new AmfWriter(stream))
         {
             writer.Run(this, Name, Format);
         }
         stream.AssertSameLength();
     }
 }
Exemplo n.º 5
0
 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();
         }
     }
 }
Exemplo n.º 6
0
 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;
 }