/// <summary> /// 序列化对象 /// 序列化顺序 /// 1、类型名 /// 2、对象的各个属性 /// </summary> /// <param name="serializationStream">流</param> /// <param name="graph">对象</param> public void Serialize(Stream serializationStream, object graph) { ILibSerializable libSerializable = (ILibSerializable)graph; LibSerializationInfo sInfo = new LibSerializationInfo(serializationStream, graph); libSerializable.WriteObjectData(sInfo); }
public void WriteObject(object value) { WriteType(value); ILibSerializable serializer = (ILibSerializable)value; serializer.WriteObjectData(this); }