System.Runtime.Serialization.ValueTypeFixupInfo.ValueTypeFixupInfo C# (CSharp) Method

ValueTypeFixupInfo() public method

public ValueTypeFixupInfo ( long containerID, FieldInfo member, int parentIndex ) : System.Reflection
containerID long
member System.Reflection.FieldInfo
parentIndex int
return System.Reflection
        public ValueTypeFixupInfo(long containerID, FieldInfo member, int[] parentIndex)
        {
            // If both member and arrayIndex are null, we don't have enough information to create
            // a tunnel to do the fixup.
            if (member == null && parentIndex == null)
            {
                throw new ArgumentException(SR.Argument_MustSupplyParent);
            }

            if (containerID == 0 && member == null)
            {
                _containerID = containerID;
                _parentField = member;
                _parentIndex = parentIndex;
            }

            // If the member isn't null, we know that they supplied a MemberInfo as the parent.  This means
            // that the arrayIndex must be null because we can't have a FieldInfo into an array. 
            if (member != null)
            {
                if (parentIndex != null)
                {
                    throw new ArgumentException(SR.Argument_MemberAndArray);
                }

                if (member.FieldType.IsValueType && containerID == 0)
                {
                    throw new ArgumentException(SR.Argument_MustSupplyContainer);
                }
            }

            _containerID = containerID;
            _parentField = member;
            _parentIndex = parentIndex;
        }
ValueTypeFixupInfo