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();
posted @ 2012-09-04 17:31  我想去长安  阅读(378)  评论(0编辑  收藏  举报