Set() private method

private Set ( InternalPrimitiveTypeE typeInformation ) : void
typeInformation InternalPrimitiveTypeE
return void
コード例 #1
0
        private void ReadMemberPrimitiveUnTyped()
        {
            ObjectProgress objectOp = (ObjectProgress)_stack.Peek();

            if (memberPrimitiveUnTyped == null)
            {
                memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
            }
            memberPrimitiveUnTyped.Set((InternalPrimitiveTypeE)_expectedTypeInformation);
            memberPrimitiveUnTyped.Read(this);

            PRs.Init();
            PRs._varValue = memberPrimitiveUnTyped._value;

            PRs._dtTypeCode      = (InternalPrimitiveTypeE)_expectedTypeInformation;
            PRs._dtType          = Converter.ToType(PRs._dtTypeCode);
            PRs._parseTypeEnum   = InternalParseTypeE.Member;
            PRs._memberValueEnum = InternalMemberValueE.InlineValue;

            if (objectOp._objectTypeEnum == InternalObjectTypeE.Object)
            {
                PRs._memberTypeEnum = InternalMemberTypeE.Field;
                PRs._name           = objectOp._name;
            }
            else
            {
                PRs._memberTypeEnum = InternalMemberTypeE.Item;
            }

            _objectReader.Parse(PRs);
        }
コード例 #2
0
        private void ReadMemberPrimitiveUnTyped()
        {
            SerTrace.Log(this, "ReadMemberPrimitiveUnTyped ");
            ObjectProgress objectOp = (ObjectProgress)stack.Peek();

            if (memberPrimitiveUnTyped == null)
            {
                memberPrimitiveUnTyped = new MemberPrimitiveUnTyped();
            }
            memberPrimitiveUnTyped.Set((InternalPrimitiveTypeE)expectedTypeInformation);
            memberPrimitiveUnTyped.Read(this);
            memberPrimitiveUnTyped.Dump();

            prs.Init();
            prs.PRvarValue = memberPrimitiveUnTyped.value;

            prs.PRdtTypeCode      = (InternalPrimitiveTypeE)expectedTypeInformation;
            prs.PRdtType          = Converter.ToType(prs.PRdtTypeCode);
            prs.PRparseTypeEnum   = InternalParseTypeE.Member;
            prs.PRmemberValueEnum = InternalMemberValueE.InlineValue;

            if (objectOp.objectTypeEnum == InternalObjectTypeE.Object)
            {
                prs.PRmemberTypeEnum = InternalMemberTypeE.Field;
                prs.PRname           = objectOp.name;
            }
            else
            {
                prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
            }

            objectReader.Parse(prs);
        }
コード例 #3
0
        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);
            }
        }