Why is SortedDictionary not serialized?
public static SortedDictionary<int, Tower> DICT_TOWER = new SortedDictionary<int, Tower>();
SerializationException: Type System.Collections.Generic.RBTree is not marked as Serializable. System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable (System.Type type, ISurrogateSelector selector, StreamingContext context) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.Serial. Formatters.Binary / BinaryCommon.cs: 119) System
So it is serialized without errors:
public static Dictionary<int, Tower> DICT_TOWER = new Dictionary<int, Tower>();
The dictionary is inside the data
BinaryFormatter bformatter = new BinaryFormatter(); bformatter.Binder = new ClassBinder();//Здесь мы обучаем сериализатор работать с нашим классом MemoryStream streamReader = new MemoryStream(); bformatter.Serialize(streamReader, data);//Cериализуем
[field:NonSerializedAttribute()] public event EventHandler BrazierCuttoffChanged;
- Alexey Shimanskydata
and what you shove ...... but the problem is not inSortedDictionary
- Alexey Shimansky