public Deserialize ( byte content ) : |
||
content | byte | The binary representation. |
return |
/// <summary> /// Converts a set of bytes to a new instance. /// </summary> /// <param name="content">The binary representation.</param> /// <returns>The new instance.</returns> public override Value Deserialize(byte[] content) { var sp = new SurfacePlotValue(); using (var ds = Deserializer.Create(content)) { sp.Deserialize(ds); sp.IsMesh = ds.GetBoolean(); sp.ColorPalette = (ColorPalettes)ds.GetInt(); sp.data.Deserialize(ds); var count = ds.GetInt(); for (int j = 0; j < count; j++) { var x = ds.GetDouble(); var y = ds.GetDouble(); var z = ds.GetDouble(); data.Add(new Vertex { X = x, Y = y, Z = z }); } } return(sp); }
/// <summary> /// Converts a set of bytes to a new instance. /// </summary> /// <param name="content">The binary representation.</param> /// <returns>The new instance.</returns> public override Value Deserialize(byte[] content) { var sp = new SurfacePlotValue(); using (var ds = Deserializer.Create(content)) { sp.Deserialize(ds); sp.IsMesh = ds.GetBoolean(); sp.ColorPalette = (ColorPalettes)ds.GetInt(); sp.data.Deserialize(ds); var count = ds.GetInt(); for (int j = 0; j < count; j++) { var x = ds.GetDouble(); var y = ds.GetDouble(); var z = ds.GetDouble(); data.Add(new Vertex { X = x, Y = y, Z = z }); } } return sp; }