internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, object value)
        {
            InternalWriteItemNull();
            InternalPrimitiveTypeE typeInformation = typeNameInfo._primitiveTypeEnum;

            // Writes Members with primitive values
            if (memberNameInfo._transmitTypeOnMember)
            {
                if (_memberPrimitiveTyped == null)
                {
                    _memberPrimitiveTyped = new MemberPrimitiveTyped();
                }
                _memberPrimitiveTyped.Set(typeInformation, value);
                _memberPrimitiveTyped.Write(this);
            }
            else
            {
                if (_memberPrimitiveUnTyped == null)
                {
                    _memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
                }
                _memberPrimitiveUnTyped.Set(typeInformation, value);
                _memberPrimitiveUnTyped.Write(this);
            }
        }
        internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, object value)
        {
            this.InternalWriteItemNull();
            InternalPrimitiveTypeE internalPrimitiveTypeE = typeNameInfo.NIprimitiveTypeEnum;

            if (memberNameInfo.NItransmitTypeOnMember)
            {
                if (this.memberPrimitiveTyped == null)
                {
                    this.memberPrimitiveTyped = new MemberPrimitiveTyped();
                }
                this.memberPrimitiveTyped.Set(internalPrimitiveTypeE, value);
                int num = memberNameInfo.NIisArrayItem ? 1 : 0;
                this.memberPrimitiveTyped.Dump();
                this.memberPrimitiveTyped.Write(this);
            }
            else
            {
                if (this.memberPrimitiveUnTyped == null)
                {
                    this.memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
                }
                this.memberPrimitiveUnTyped.Set(internalPrimitiveTypeE, value);
                int num = memberNameInfo.NIisArrayItem ? 1 : 0;
                this.memberPrimitiveUnTyped.Dump();
                this.memberPrimitiveUnTyped.Write(this);
            }
        }
        private void ReadMemberPrimitiveTyped()
        {
            SerTrace.Log(this, "ReadObjectPrimitive");

            if (memberPrimitiveTyped == null)
            {
                memberPrimitiveTyped = new MemberPrimitiveTyped();
            }

            memberPrimitiveTyped.Read(this);
            memberPrimitiveTyped.Dump();

            prs.PRobjectTypeEnum = InternalObjectTypeE.Object;             //Get rid of
            ObjectProgress objectOp = (ObjectProgress)stack.Peek();

            prs.Init();
            prs.PRvarValue   = memberPrimitiveTyped.value;
            prs.PRkeyDt      = Converter.ToComType(memberPrimitiveTyped.primitiveTypeEnum);
            prs.PRdtType     = Converter.ToType(memberPrimitiveTyped.primitiveTypeEnum);
            prs.PRdtTypeCode = memberPrimitiveTyped.primitiveTypeEnum;

            if (objectOp == null)
            {
                // Top level boxed primitive
                SerTrace.Log(this, "ReadObjectPrimitive, Non-Nested");
                prs.PRparseTypeEnum = InternalParseTypeE.Object;
                prs.PRname          = "System.Variant";
            }
            else
            {
                // Nested in an Object
                SerTrace.Log(this, "ReadObjectPrimitive, Nested");

                prs.PRparseTypeEnum   = InternalParseTypeE.Member;
                prs.PRmemberValueEnum = InternalMemberValueE.InlineValue;

                switch (objectOp.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    prs.PRname           = objectOp.name;
                    prs.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    break;

                case InternalObjectTypeE.Array:
                    prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_ObjectTypeEnum"), ((Enum)objectOp.objectTypeEnum).ToString()));
                }
            }

            objectReader.Parse(prs);
        }
        internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, Object value)
        {
#if _DEBUG
            SerTrace.Log("BinaryWriter", "Write Member memberName ", memberNameInfo.NIname, ", value ", value);
            memberNameInfo.Dump("WriteMember memberNameInfo");
            typeNameInfo.Dump("WriteMember typeNameInfo");
#endif
            InternalWriteItemNull();
            InternalPrimitiveTypeE typeInformation = typeNameInfo.NIprimitiveTypeEnum;

            // Writes Members with primitive values

            if (memberNameInfo.NItransmitTypeOnMember)
            {
                if (memberPrimitiveTyped == null)
                {
                    memberPrimitiveTyped = new MemberPrimitiveTyped();
                }
                memberPrimitiveTyped.Set((InternalPrimitiveTypeE)typeInformation, value);

                if (memberNameInfo.NIisArrayItem)
                {
                    BCLDebug.Trace("BINARY", "-----item-----");
                }
                else
                {
                    BCLDebug.Trace("BINARY", "-----", memberNameInfo.NIname, "-----");
                }
                memberPrimitiveTyped.Dump();

                memberPrimitiveTyped.Write(this);
            }
            else
            {
                if (memberPrimitiveUnTyped == null)
                {
                    memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
                }
                memberPrimitiveUnTyped.Set(typeInformation, value);

                if (memberNameInfo.NIisArrayItem)
                {
                    BCLDebug.Trace("BINARY", "-----item-----");
                }
                else
                {
                    BCLDebug.Trace("BINARY", "-----", memberNameInfo.NIname, "-----");
                }
                memberPrimitiveUnTyped.Dump();

                memberPrimitiveUnTyped.Write(this);
            }
        }
Example #5
0
        private void ReadMemberPrimitiveTyped()
        {
            if (_memberPrimitiveTyped == null)
            {
                _memberPrimitiveTyped = new MemberPrimitiveTyped();
            }
            _memberPrimitiveTyped.Read(this);

            PRs._objectTypeEnum = InternalObjectTypeE.Object; //Get rid of
            ObjectProgress objectOp = (ObjectProgress)_stack.Peek();

            PRs.Init();
            PRs._varValue   = _memberPrimitiveTyped._value;
            PRs._keyDt      = Converter.ToComType(_memberPrimitiveTyped._primitiveTypeEnum);
            PRs._dtType     = Converter.ToType(_memberPrimitiveTyped._primitiveTypeEnum);
            PRs._dtTypeCode = _memberPrimitiveTyped._primitiveTypeEnum;

            if (objectOp == null)
            {
                // Top level boxed primitive
                PRs._parseTypeEnum = InternalParseTypeE.Object;
                PRs._name          = "System.Variant";
            }
            else
            {
                // Nested in an Object

                PRs._parseTypeEnum   = InternalParseTypeE.Member;
                PRs._memberValueEnum = InternalMemberValueE.InlineValue;

                switch (objectOp._objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    PRs._name           = objectOp._name;
                    PRs._memberTypeEnum = InternalMemberTypeE.Field;
                    break;

                case InternalObjectTypeE.Array:
                    PRs._memberTypeEnum = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(SR.Format(SR.Serialization_ObjectTypeEnum, objectOp._objectTypeEnum.ToString()));
                }
            }

            _objectReader.Parse(PRs);
        }
Example #6
0
        private void ReadMemberPrimitiveTyped()
        {
            if (this.memberPrimitiveTyped == null)
            {
                this.memberPrimitiveTyped = new MemberPrimitiveTyped();
            }
            this.memberPrimitiveTyped.Read(this);
            this.memberPrimitiveTyped.Dump();
            this.prs.PRobjectTypeEnum = InternalObjectTypeE.Object;
            ObjectProgress objectProgress = (ObjectProgress)this.stack.Peek();

            this.prs.Init();
            this.prs.PRvarValue   = this.memberPrimitiveTyped.value;
            this.prs.PRkeyDt      = Converter.ToComType(this.memberPrimitiveTyped.primitiveTypeEnum);
            this.prs.PRdtType     = Converter.ToType(this.memberPrimitiveTyped.primitiveTypeEnum);
            this.prs.PRdtTypeCode = this.memberPrimitiveTyped.primitiveTypeEnum;
            if (objectProgress == null)
            {
                this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
                this.prs.PRname          = "System.Variant";
            }
            else
            {
                this.prs.PRparseTypeEnum   = InternalParseTypeE.Member;
                this.prs.PRmemberValueEnum = InternalMemberValueE.InlineValue;
                switch (objectProgress.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    this.prs.PRname           = objectProgress.name;
                    this.prs.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    break;

                case InternalObjectTypeE.Array:
                    this.prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    break;

                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", (object)objectProgress.objectTypeEnum.ToString()));
                }
            }
            this.objectReader.Parse(this.prs);
        }
Example #7
0
        private void ReadMemberPrimitiveTyped()
        {
            if (_memberPrimitiveTyped == null)
            {
                _memberPrimitiveTyped = new MemberPrimitiveTyped();
            }
            _memberPrimitiveTyped.Read(this);

            PRs._objectTypeEnum = InternalObjectTypeE.Object; //Get rid of 
            ObjectProgress objectOp = (ObjectProgress)_stack.Peek();

            PRs.Init();
            PRs._varValue = _memberPrimitiveTyped._value;
            PRs._keyDt = Converter.ToComType(_memberPrimitiveTyped._primitiveTypeEnum);
            PRs._dtType = Converter.ToType(_memberPrimitiveTyped._primitiveTypeEnum);
            PRs._dtTypeCode = _memberPrimitiveTyped._primitiveTypeEnum;

            if (objectOp == null)
            {
                // Top level boxed primitive
                PRs._parseTypeEnum = InternalParseTypeE.Object;
                PRs._name = "System.Variant";
            }
            else
            {
                // Nested in an Object

                PRs._parseTypeEnum = InternalParseTypeE.Member;
                PRs._memberValueEnum = InternalMemberValueE.InlineValue;

                switch (objectOp._objectTypeEnum)
                {
                    case InternalObjectTypeE.Object:
                        PRs._name = objectOp._name;
                        PRs._memberTypeEnum = InternalMemberTypeE.Field;
                        break;
                    case InternalObjectTypeE.Array:
                        PRs._memberTypeEnum = InternalMemberTypeE.Item;
                        break;
                    default:
                        throw new SerializationException(SR.Format(SR.Serialization_ObjectTypeEnum, objectOp._objectTypeEnum.ToString()));
                }
            }

            _objectReader.Parse(PRs);
        }
        [System.Security.SecurityCritical]  // auto-generated
        private void ReadMemberPrimitiveTyped()
        {
            SerTrace.Log( this, "ReadObjectPrimitive");

            if (memberPrimitiveTyped == null)
                memberPrimitiveTyped = new MemberPrimitiveTyped();

            memberPrimitiveTyped.Read(this);
            memberPrimitiveTyped.Dump();

            prs.PRobjectTypeEnum = InternalObjectTypeE.Object; //Get rid of 
            ObjectProgress objectOp = (ObjectProgress)stack.Peek();

            prs.Init();
            prs.PRvarValue = memberPrimitiveTyped.value;
            prs.PRkeyDt = Converter.ToComType(memberPrimitiveTyped.primitiveTypeEnum);
            prs.PRdtType = Converter.ToType(memberPrimitiveTyped.primitiveTypeEnum);
            prs.PRdtTypeCode = memberPrimitiveTyped.primitiveTypeEnum;

            if (objectOp == null)
            {
                // Top level boxed primitive
                SerTrace.Log( this, "ReadObjectPrimitive, Non-Nested");         
                prs.PRparseTypeEnum = InternalParseTypeE.Object;
                prs.PRname = "System.Variant";
            }
            else
            {
                // Nested in an Object
                SerTrace.Log( this, "ReadObjectPrimitive, Nested");

                prs.PRparseTypeEnum = InternalParseTypeE.Member;
                prs.PRmemberValueEnum = InternalMemberValueE.InlineValue;

                switch (objectOp.objectTypeEnum)
                {
                case InternalObjectTypeE.Object:
                    prs.PRname = objectOp.name;
                    prs.PRmemberTypeEnum = InternalMemberTypeE.Field;
                    break;
                case InternalObjectTypeE.Array:
                    prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
                    break;
                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum",((Enum)objectOp.objectTypeEnum).ToString()));                                              
                }
            }

            objectReader.Parse(prs);
        }
        internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, Object value)
        { 
#if _DEBUG
            SerTrace.Log("BinaryWriter", "Write Member memberName ",memberNameInfo.NIname,", value ",value);
            memberNameInfo.Dump("WriteMember memberNameInfo");
            typeNameInfo.Dump("WriteMember typeNameInfo"); 
#endif
            InternalWriteItemNull(); 
            InternalPrimitiveTypeE typeInformation = typeNameInfo.NIprimitiveTypeEnum; 

            // Writes Members with primitive values 

            if (memberNameInfo.NItransmitTypeOnMember)
            {
                if (memberPrimitiveTyped == null) 
                    memberPrimitiveTyped = new MemberPrimitiveTyped();
                memberPrimitiveTyped.Set((InternalPrimitiveTypeE)typeInformation, value); 
 
                if (memberNameInfo.NIisArrayItem)
                { 
                    BCLDebug.Trace("BINARY",  "-----item-----");
                }
                else
                { 
                    BCLDebug.Trace("BINARY","-----",memberNameInfo.NIname,"-----");
                } 
                memberPrimitiveTyped.Dump(); 

                memberPrimitiveTyped.Write(this); 
            }
            else
            {
                if (memberPrimitiveUnTyped == null) 
                    memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
                memberPrimitiveUnTyped.Set(typeInformation, value); 
 
                if (memberNameInfo.NIisArrayItem)
                { 
                    BCLDebug.Trace("BINARY", "-----item-----");
                }
                else
                { 
                    BCLDebug.Trace("BINARY", "-----",memberNameInfo.NIname,"-----");
                } 
                memberPrimitiveUnTyped.Dump(); 

                memberPrimitiveUnTyped.Write(this); 

            }
        }
 internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, object value)
 {
     this.InternalWriteItemNull();
     InternalPrimitiveTypeE nIprimitiveTypeEnum = typeNameInfo.NIprimitiveTypeEnum;
     if (memberNameInfo.NItransmitTypeOnMember)
     {
         if (this.memberPrimitiveTyped == null)
         {
             this.memberPrimitiveTyped = new MemberPrimitiveTyped();
         }
         this.memberPrimitiveTyped.Set(nIprimitiveTypeEnum, value);
         bool nIisArrayItem = memberNameInfo.NIisArrayItem;
         this.memberPrimitiveTyped.Dump();
         this.memberPrimitiveTyped.Write(this);
     }
     else
     {
         if (this.memberPrimitiveUnTyped == null)
         {
             this.memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
         }
         this.memberPrimitiveUnTyped.Set(nIprimitiveTypeEnum, value);
         bool flag2 = memberNameInfo.NIisArrayItem;
         this.memberPrimitiveUnTyped.Dump();
         this.memberPrimitiveUnTyped.Write(this);
     }
 }
        private void ReadMemberPrimitiveTyped()
        {
            if (this.memberPrimitiveTyped == null)
            {
                this.memberPrimitiveTyped = new MemberPrimitiveTyped();
            }
            this.memberPrimitiveTyped.Read(this);
            this.memberPrimitiveTyped.Dump();
            this.prs.PRobjectTypeEnum = InternalObjectTypeE.Object;
            ObjectProgress progress = (ObjectProgress) this.stack.Peek();
            this.prs.Init();
            this.prs.PRvarValue = this.memberPrimitiveTyped.value;
            this.prs.PRkeyDt = Converter.ToComType(this.memberPrimitiveTyped.primitiveTypeEnum);
            this.prs.PRdtType = Converter.ToType(this.memberPrimitiveTyped.primitiveTypeEnum);
            this.prs.PRdtTypeCode = this.memberPrimitiveTyped.primitiveTypeEnum;
            if (progress == null)
            {
                this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
                this.prs.PRname = "System.Variant";
            }
            else
            {
                this.prs.PRparseTypeEnum = InternalParseTypeE.Member;
                this.prs.PRmemberValueEnum = InternalMemberValueE.InlineValue;
                switch (progress.objectTypeEnum)
                {
                    case InternalObjectTypeE.Object:
                        this.prs.PRname = progress.name;
                        this.prs.PRmemberTypeEnum = InternalMemberTypeE.Field;
                        goto Label_0161;

                    case InternalObjectTypeE.Array:
                        this.prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
                        goto Label_0161;
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", new object[] { progress.objectTypeEnum.ToString() }));
            }
        Label_0161:
            this.objectReader.Parse(this.prs);
        }
        internal void WriteMember(NameInfo memberNameInfo, NameInfo typeNameInfo, object value)
        {
            InternalWriteItemNull();
            InternalPrimitiveTypeE typeInformation = typeNameInfo._primitiveTypeEnum;

            // Writes Members with primitive values
            if (memberNameInfo._transmitTypeOnMember)
            {
                if (_memberPrimitiveTyped == null)
                {
                    _memberPrimitiveTyped = new MemberPrimitiveTyped();
                }
                _memberPrimitiveTyped.Set(typeInformation, value);
                _memberPrimitiveTyped.Write(this);
            }
            else
            {
                if (_memberPrimitiveUnTyped == null)
                {
                    _memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
                }
                _memberPrimitiveUnTyped.Set(typeInformation, value);
                _memberPrimitiveUnTyped.Write(this);
            }
        }