Now I have created a method to copy one dictionary to another :
This is an extension method..
publicstatic T DeepClone<T>(this T a)
{
using (MemoryStream stream = new MemoryStream())
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, a);
stream.Position = 0;
return (T)formatter.Deserialize(stream);
}
}
Now I have to copy (DeepClone()) one dictionary that contains an object. Here is the class :
internalclass items
{
publicdouble up=0;
publicdouble down=0;
publicint dailyBars=0;
}
I get a message that items is not marked as serializable...
What do I have to do to serialize this object (items)...
I just put [Serializable()] in front of the class but didn't work..
Thank you

Comment