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

GetMemberInfo() private method

private GetMemberInfo ( string &outMemberNames, Type &outMemberTypes, object &outMemberData ) : void
outMemberNames string
outMemberTypes System.Type
outMemberData object
return void
        internal void GetMemberInfo(out string[] outMemberNames, out Type[] outMemberTypes, out object[] outMemberData)
        {
            outMemberNames = _cache._memberNames;
            outMemberTypes = _cache._memberTypes;
            outMemberData = _memberData;

            if (_isSi && !_isNamed)
            {
                throw new SerializationException(SR.Serialization_ISerializableMemberInfo);
            }
        }

Usage Example

示例#1
0
        private void Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
        {
            object obj = objectInfo.obj;

            if (obj == null)
            {
                throw new ArgumentNullException("objectInfo.obj", Environment.GetResourceString("ArgumentNull_Obj"));
            }
            Type type1 = objectInfo.objectType;
            long num   = objectInfo.objectId;
            Type type2 = Converter.typeofString;

            if (type1 == type2)
            {
                memberNameInfo.NIobjectId = num;
                this.serWriter.WriteObjectString((int)num, obj.ToString());
            }
            else if (objectInfo.isArray)
            {
                this.WriteArray(objectInfo, memberNameInfo, (WriteObjectInfo)null);
            }
            else
            {
                string[] outMemberNames;
                Type[]   outMemberTypes;
                object[] outMemberData;
                objectInfo.GetMemberInfo(out outMemberNames, out outMemberTypes, out outMemberData);
                if (objectInfo.isSi || this.CheckTypeFormat(this.formatterEnums.FEtypeFormat, FormatterTypeStyle.TypesAlways))
                {
                    memberNameInfo.NItransmitTypeOnObject = true;
                    memberNameInfo.NIisParentTypeOnObject = true;
                    typeNameInfo.NItransmitTypeOnObject   = true;
                    typeNameInfo.NIisParentTypeOnObject   = true;
                }
                WriteObjectInfo[] memberObjectInfos = new WriteObjectInfo[outMemberNames.Length];
                for (int index = 0; index < outMemberTypes.Length; ++index)
                {
                    Type type3 = outMemberTypes[index] == null ? (outMemberData[index] == null ? Converter.typeofObject : this.GetType(outMemberData[index])) : outMemberTypes[index];
                    if (this.ToCode(type3) == InternalPrimitiveTypeE.Invalid && type3 != Converter.typeofString)
                    {
                        if (outMemberData[index] != null)
                        {
                            memberObjectInfos[index]         = WriteObjectInfo.Serialize(outMemberData[index], this.m_surrogates, this.m_context, this.serObjectInfoInit, this.m_formatterConverter, this, this.m_binder);
                            memberObjectInfos[index].assemId = this.GetAssemblyId(memberObjectInfos[index]);
                        }
                        else
                        {
                            memberObjectInfos[index]         = WriteObjectInfo.Serialize(outMemberTypes[index], this.m_surrogates, this.m_context, this.serObjectInfoInit, this.m_formatterConverter, this.m_binder);
                            memberObjectInfos[index].assemId = this.GetAssemblyId(memberObjectInfos[index]);
                        }
                    }
                }
                this.Write(objectInfo, memberNameInfo, typeNameInfo, outMemberNames, outMemberTypes, outMemberData, memberObjectInfos);
            }
        }
All Usage Examples Of System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo::GetMemberInfo