this is my Serialize and Deserialize code
public byte[] DTSerialize(object dt)
{
MemoryStream stream = new MemoryStream();
System.Runtime.Serialization.IFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
formatter.Serialize(stream, dt);
return stream.GetBuffer();
}
public object DTDeserialize(byte[] buffer)
{
MemoryStream stream = new MemoryStream(buffer);
System.Runtime.Serialization.IFormatter formatter = new BinaryFormatter();
return formatter.Deserialize(stream) as object;
}
and this call method code
List<Series> ser = new List<Series>();
foreach (Series item in chartControl1.Series)
{
ser.Add(item);
}
byte[] btt = DTSerialize(ser);
but when i call code this exception throwing
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: Type 'DevExpress.XtraCharts.Series' in Assembly 'DevExpress.XtraCharts.v14.1, Version=14.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' is not marked as serializable.