/// <summary> /// Initializes a new instance of the BinarySerializationContext class with a parent, parentType, and parentContext. /// </summary> /// <param name="value">The value of the object being serialized.</param> /// <param name="parentValue">The parent of this object in the object graph.</param> /// <param name="parentType">The type of the parent object.</param> /// <param name="parentContext">The parent object serialization context.</param> /// <param name="memberInfo">Member info for this field.</param> internal BinarySerializationContext(object value, object parentValue, Type parentType, BinarySerializationContext parentContext, MemberInfo memberInfo) { Value = value; ParentValue = parentValue; ParentType = parentType; ParentContext = parentContext; MemberInfo = memberInfo; // Deprecated Parent = parentValue; }
/// <summary> /// This is called by the framework to indicate a new operation. /// </summary> /// <param name="context"></param> protected override void Reset(BinarySerializationContext context) { _checksum = 0; }
/// <summary> /// Initializes a new instance of the BinarySerializationContext class with a parent, parentType, and parentContext. /// </summary> /// <param name="value">The value of the object being serialized.</param> /// <param name="parentValue">The parent of this object in the object graph.</param> /// <param name="parentType">The type of the parent object.</param> /// <param name="parentContext">The parent object serialization context.</param> internal BinarySerializationContext(object value, object parentValue, Type parentType, BinarySerializationContext parentContext) { Value = value; ParentValue = parentValue; ParentType = parentType; ParentContext = parentContext; // Deprecated Parent = parentValue; }
/// <summary> /// This is called by the framework to indicate a new operation. /// </summary> /// <param name="context"></param> protected override object GetInitialState(BinarySerializationContext context) { return(default(byte)); }
internal virtual object GetInitialStateInternal(BinarySerializationContext context) { return(GetInitialState(context)); }
/// <summary> /// This is called by the framework to indicate a new operation. /// </summary> /// <param name="context"></param> protected abstract object GetInitialState(BinarySerializationContext context);
/// <summary> /// Initializes a new instance of the MemberSerializingEventArgs class with the member name. /// </summary> /// <param name="memberName">The name of the member.</param> /// <param name="context">The current serialization context.</param> /// <param name="offset">The current offset in the stream relative to the start of the overall operation.</param> public MemberSerializingEventArgs(string memberName, BinarySerializationContext context, long offset) { MemberName = memberName; Context = context; Offset = offset; }
public void OnMemberSerializing(ValueNode sender, string name, BinarySerializationContext context, long offset, long localOffset) { var handle = MemberSerializing; handle?.Invoke(sender, new MemberSerializingEventArgs(name, context, offset, localOffset)); }
/// <summary> /// Initializes a new instance of the BinarySerializationContext class with a parent, parentType, and parentContext. /// </summary> /// <param name="parent">The parent of this object in the object graph.</param> /// <param name="parentType">The type of the parent object.</param> /// <param name="parentContext">The parent object serialization context.</param> internal BinarySerializationContext(object parent, Type parentType, BinarySerializationContext parentContext) { Parent = parent; ParentType = parentType; ParentContext = parentContext; }
public void OnMemberDeserialized(ValueNode sender, string name, object value, BinarySerializationContext context, long offset) { var handle = MemberDeserialized; handle?.Invoke(sender, new MemberSerializedEventArgs(name, value, context, offset)); }
internal virtual void ResetInternal(BinarySerializationContext context) { Reset(context); }
/// <summary> /// This is called by the framework to indicate a new operation. /// </summary> /// <param name="context"></param> protected abstract void Reset(BinarySerializationContext context);
/// <summary> /// Initializes a new instance of the MemberSerializedEventArgs class with the member name and value. /// </summary> /// <param name="memberName">The name of the member.</param> /// <param name="value">The value of the member.</param> /// <param name="context">The current serialization context.</param> public MemberSerializedEventArgs(string memberName, object value, BinarySerializationContext context) { MemberName = memberName; Value = value; Context = context; }