Example #1
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>
 /// <param name="localOffset">The current object-local offset in the stream.</param>
 public MemberSerializingEventArgs(string memberName, BinaryDataSerializationContext context, FieldLength offset, FieldLength localOffset)
 {
     MemberName  = memberName;
     Context     = context;
     Offset      = offset;
     LocalOffset = localOffset;
 }
Example #2
0
        public void OnMemberDeserializing(ValueNode sender, string name, BinaryDataSerializationContext context,
                                          FieldLength offset, FieldLength localOffset)
        {
            var handle = MemberDeserializing;

            handle?.Invoke(sender, new MemberSerializingEventArgs(name, context, offset, localOffset));
        }
        /// <summary>
        ///     Initializes a new instance of the BinaryDataSerializationContext 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 BinaryDataSerializationContext(object value, object parentValue, Type parentType,
                                                BinaryDataSerializationContext parentContext, MemberInfo memberInfo)
        {
            Value         = value;
            ParentValue   = parentValue;
            ParentType    = parentType;
            ParentContext = parentContext;
            MemberInfo    = memberInfo;

            // Deprecated
            Parent = parentValue;
        }
Example #4
0
 /// <summary>
 ///     This is called by the framework to indicate a new operation.
 /// </summary>
 /// <param name="context"></param>
 protected override object GetInitialState(BinaryDataSerializationContext context)
 {
     return(default(byte));
 }
 /// <summary>
 ///     This is called by the framework to indicate a new operation.
 /// </summary>
 /// <param name="context"></param>
 protected abstract object GetInitialState(BinaryDataSerializationContext context);
 internal virtual object GetInitialStateInternal(BinaryDataSerializationContext context)
 {
     return(GetInitialState(context));
 }