示例#1
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>
        /// <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;
        }
示例#2
0
 /// <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;
        }
示例#4
0
 /// <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);
示例#7
0
 /// <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;
 }
示例#8
0
        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));
        }
示例#9
0
 /// <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;
 }