12345678910111213141516171819202122232425262728293031 |
-
- using System;
- namespace KYFramework
- {
- public interface IDeserializeSystem
- {
- Type Type();
- void Run(object o);
- }
- /// <summary>
- /// 反序列化后执行的System
- /// 要小心使用这个System,因为对象假如要保存到数据库,到dbserver也会进行反序列化,那么也会执行该System
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public abstract class DeserializeSystem<T> : IDeserializeSystem
- {
- public void Run(object o)
- {
- this.Deserialize((T)o);
- }
- public Type Type()
- {
- return typeof(T);
- }
- public abstract void Deserialize(T self);
- }
- }
|