zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Unity/Assets/Model/Core/Object/IDeserializeSystem.cs

32 lines
610 B
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
namespace ET
{
public interface IDeserializeSystem
{
Type Type();
void Run(object o);
}
/// <summary>
/// 反序列化后执行的System
/// 要小心使用这个System因为对象假如要保存到数据库到dbserver也会进行反序列化那么也会执行该System
/// </summary>
/// <typeparam name="T"></typeparam>
[ObjectSystem]
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);
}
}