I have a problem:
protected Test(SerializationInfo info, StreamingContext context)
{
sx = info.GetUInt16("sizex");
sy = info.GetUInt16("sizey");
sz = info.GetUInt16("sizez");
ushort[] tab = new ushort[sx * sy * sz];
tab = info.GetValue("data", System.UInt16[sx * sy * sz]);
Console.WriteLine("Deserializing constructor");
}
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
Console.WriteLine("Serializing...");
info.AddValue("sizex", sx);
info.AddValue("sizey", sy);
info.AddValue("sizez", sz);
info.AddValue("data", tab);
}
I get a compile-time error: 'ushort' is a 'type', which is not valid in the given context. What should I change ?