dynamic与泛型
1 SerializationProvider<Action>.SetCurrent(new BinarySerializationFactory<Action>());
2 bytes = SerializationProvider<Action>.Create().Serialize(() => { Console.WriteLine("Action Test!"); });
3 var t4 = SerializationProvider<Action>.Create().Deserialize(bytes);
4 t4();
5
6 SerializationProvider<dynamic>.SetCurrent(new BinarySerializationFactory<dynamic>());
7 bytes = SerializationProvider<dynamic>.Create().Serialize( new Test1());
8 var t5 = SerializationProvider<dynamic>.Create().Deserialize(bytes);
9 t5.raise();
2 bytes = SerializationProvider<Action>.Create().Serialize(() => { Console.WriteLine("Action Test!"); });
3 var t4 = SerializationProvider<Action>.Create().Deserialize(bytes);
4 t4();
5
6 SerializationProvider<dynamic>.SetCurrent(new BinarySerializationFactory<dynamic>());
7 bytes = SerializationProvider<dynamic>.Create().Serialize( new Test1());
8 var t5 = SerializationProvider<dynamic>.Create().Deserialize(bytes);
9 t5.raise();