System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo.GetMemberInfo C# (CSharp) Method

GetMemberInfo() private method

private GetMemberInfo ( string name ) : MemberInfo
name string
return System.Reflection.MemberInfo
        internal MemberInfo GetMemberInfo(string name)
        {
            if (_cache == null)
            {
                return null;
            }

            if (_isSi)
            {
                throw new SerializationException(SR.Format(SR.Serialization_MemberInfo, _objectType + " " + name));
            }

            if (_cache._memberInfos == null)
            {
                throw new SerializationException(SR.Format(SR.Serialization_NoMemberInfo, _objectType + " " + name));
            }

            int position = Position(name);
            return position != -1 ? _cache._memberInfos[position] : null;
        }

Usage Example

示例#1
0
        internal void Fixup(ParseRecord record, ParseRecord parent)
        {
            object obj = record._newObj;

            switch (_valueFixupEnum)
            {
            case ValueFixupEnum.Array:
                _arrayObj.SetValue(obj, _indexMap);
                break;

            case ValueFixupEnum.Header:
                throw new PlatformNotSupportedException();

            case ValueFixupEnum.Member:
                if (_objectInfo._isSi)
                {
                    _objectInfo._objectManager.RecordDelayedFixup(parent._objectId, _memberName, record._objectId);
                }
                else
                {
                    MemberInfo memberInfo = _objectInfo.GetMemberInfo(_memberName);
                    if (memberInfo != null)
                    {
                        _objectInfo._objectManager.RecordFixup(parent._objectId, memberInfo, record._objectId);
                    }
                }
                break;
            }
        }
All Usage Examples Of System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo::GetMemberInfo