Beispiel #1
0
        internal void WriteObjectString(int objectId, String value)
        {
            InternalWriteItemNull();

            if (objectWriter.IsCrossAppDomain())
            {
                if (binaryCrossAppDomainString == null)
                {
                    binaryCrossAppDomainString = new BinaryCrossAppDomainString();
                }
                binaryCrossAppDomainString.Set(objectId, objectWriter.CrossAppDomainArrayAdd(value));
                binaryCrossAppDomainString.Dump();
                binaryCrossAppDomainString.Write(this);
            }
            else
            {
                if (binaryObjectString == null)
                {
                    binaryObjectString = new BinaryObjectString();
                }
                binaryObjectString.Set(objectId, value);
                binaryObjectString.Dump();
                binaryObjectString.Write(this);
            }
        }
 internal void WriteObjectString(int objectId, string value)
 {
     this.InternalWriteItemNull();
     if (this.binaryObjectString == null)
     {
         this.binaryObjectString = new BinaryObjectString();
     }
     this.binaryObjectString.Set(objectId, value);
     this.binaryObjectString.Write(this);
 }
        internal void WriteObjectString(int objectId, String value)
        {
            InternalWriteItemNull();

            if (binaryObjectString == null)
            {
                binaryObjectString = new BinaryObjectString();
            }
            binaryObjectString.Set(objectId, value);
#if _DEBUG
            binaryObjectString.Dump();
#endif
            binaryObjectString.Write(this);
        }
Beispiel #4
0
        private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            if (_objectString == null)
            {
                _objectString = new BinaryObjectString();
            }

            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                _objectString.Read(this);
            }
            else
            {
                if (_crossAppDomainString == null)
                {
                    _crossAppDomainString = new BinaryCrossAppDomainString();
                }
                _crossAppDomainString.Read(this);
                _objectString._value = _objectReader.CrossAppDomainArray(_crossAppDomainString._value) as string;
                if (_objectString._value == null)
                {
                    throw new SerializationException(SR.Format(SR.Serialization_CrossAppDomainError, "String", _crossAppDomainString._value));
                }

                _objectString._objectId = _crossAppDomainString._objectId;
            }

            PRs.Init();
            PRs._parseTypeEnum = InternalParseTypeE.Object;
            PRs._objectId = _objectReader.GetId(_objectString._objectId);

            if (PRs._objectId == _topId)
            {
                PRs._objectPositionEnum = InternalObjectPositionE.Top;
            }

            PRs._objectTypeEnum = InternalObjectTypeE.Object;

            ObjectProgress objectOp = (ObjectProgress)_stack.Peek();

            PRs._value = _objectString._value;
            PRs._keyDt = "System.String";
            PRs._dtType = Converter.s_typeofString;
            PRs._dtTypeCode = InternalPrimitiveTypeE.Invalid;
            PRs._varValue = _objectString._value; //Need to set it because ObjectReader is picking up value from variant, not pr.PRvalue

            if (objectOp == null)
            {
                // Top level String
                PRs._parseTypeEnum = InternalParseTypeE.Object;
                PRs._name = "System.String";
            }
            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 ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            SerTrace.Log( this, "ReadObjectString");

            if (objectString == null)
                objectString = new BinaryObjectString();

            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                objectString.Read(this);
                objectString.Dump();
            }
            else
            {
                if (crossAppDomainString == null)
                    crossAppDomainString = new BinaryCrossAppDomainString();
                crossAppDomainString.Read(this);
                crossAppDomainString.Dump();
                objectString.value = objectReader.CrossAppDomainArray(crossAppDomainString.value) as String;
                if (objectString.value == null)
                    throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError","String", crossAppDomainString.value));

                objectString.objectId = crossAppDomainString.objectId;
            }

            prs.Init();
            prs.PRparseTypeEnum = InternalParseTypeE.Object;
            prs.PRobjectId = objectReader.GetId(objectString.objectId);

            if (prs.PRobjectId == topId)
                prs.PRobjectPositionEnum = InternalObjectPositionE.Top;

            prs.PRobjectTypeEnum = InternalObjectTypeE.Object;

            ObjectProgress objectOp = (ObjectProgress)stack.Peek();

            prs.PRvalue = objectString.value;
            prs.PRkeyDt = "System.String";
            prs.PRdtType = Converter.typeofString;
            prs.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;
            prs.PRvarValue = objectString.value; //Need to set it because ObjectReader is picking up value from variant, not pr.PRvalue

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

                SerTrace.Log( this, "ReadObjectString, 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 WriteObjectString(int objectId, String value)
        { 
            InternalWriteItemNull();

            if (binaryObjectString == null)
                binaryObjectString = new BinaryObjectString(); 
            binaryObjectString.Set(objectId, value);
#if _DEBUG 
            binaryObjectString.Dump(); 
#endif
            binaryObjectString.Write(this); 
        }
 internal void WriteObjectString(int objectId, string value)
 {
     this.InternalWriteItemNull();
     if (this.binaryObjectString == null)
     {
         this.binaryObjectString = new BinaryObjectString();
     }
     this.binaryObjectString.Set(objectId, value);
     this.binaryObjectString.Write(this);
 }
Beispiel #8
0
        private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            if (_objectString == null)
            {
                _objectString = new BinaryObjectString();
            }

            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                _objectString.Read(this);
            }
            else
            {
                if (_crossAppDomainString == null)
                {
                    _crossAppDomainString = new BinaryCrossAppDomainString();
                }
                _crossAppDomainString.Read(this);
                _objectString._value = _objectReader.CrossAppDomainArray(_crossAppDomainString._value) as string;
                if (_objectString._value == null)
                {
                    throw new SerializationException(SR.Format(SR.Serialization_CrossAppDomainError, "String", _crossAppDomainString._value));
                }

                _objectString._objectId = _crossAppDomainString._objectId;
            }

            PRs.Init();
            PRs._parseTypeEnum = InternalParseTypeE.Object;
            PRs._objectId      = _objectReader.GetId(_objectString._objectId);

            if (PRs._objectId == _topId)
            {
                PRs._objectPositionEnum = InternalObjectPositionE.Top;
            }

            PRs._objectTypeEnum = InternalObjectTypeE.Object;

            ObjectProgress objectOp = (ObjectProgress)_stack.Peek();

            PRs._value      = _objectString._value;
            PRs._keyDt      = "System.String";
            PRs._dtType     = Converter.s_typeofString;
            PRs._dtTypeCode = InternalPrimitiveTypeE.Invalid;
            PRs._varValue   = _objectString._value; //Need to set it because ObjectReader is picking up value from variant, not pr.PRvalue

            if (objectOp == null)
            {
                // Top level String
                PRs._parseTypeEnum = InternalParseTypeE.Object;
                PRs._name          = "System.String";
            }
            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);
        }
		internal void WriteObjectString(int objectId, String value)
		{
            InternalWriteItemNull();

            if (objectWriter.IsCrossAppDomain())
            {
                if (binaryCrossAppDomainString == null)
                    binaryCrossAppDomainString = new BinaryCrossAppDomainString();			
                binaryCrossAppDomainString.Set(objectId, objectWriter.CrossAppDomainArrayAdd(value));
                binaryCrossAppDomainString.Dump();
                binaryCrossAppDomainString.Write(this);

            }
            else
            {
                if (binaryObjectString == null)
                    binaryObjectString = new BinaryObjectString();			
                binaryObjectString.Set(objectId, value);
                binaryObjectString.Dump();
                binaryObjectString.Write(this);
            }
		}
        private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            if (this.objectString == null)
            {
                this.objectString = new BinaryObjectString();
            }
            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                this.objectString.Read(this);
                this.objectString.Dump();
            }
            else
            {
                if (this.crossAppDomainString == null)
                {
                    this.crossAppDomainString = new BinaryCrossAppDomainString();
                }
                this.crossAppDomainString.Read(this);
                this.crossAppDomainString.Dump();
                this.objectString.value = this.objectReader.CrossAppDomainArray(this.crossAppDomainString.value) as string;
                if (this.objectString.value == null)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", new object[] { "String", this.crossAppDomainString.value }));
                }
                this.objectString.objectId = this.crossAppDomainString.objectId;
            }
            this.prs.Init();
            this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
            this.prs.PRobjectId = this.objectReader.GetId((long) this.objectString.objectId);
            if (this.prs.PRobjectId == this.topId)
            {
                this.prs.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }
            this.prs.PRobjectTypeEnum = InternalObjectTypeE.Object;
            ObjectProgress progress = (ObjectProgress) this.stack.Peek();
            this.prs.PRvalue = this.objectString.value;
            this.prs.PRkeyDt = "System.String";
            this.prs.PRdtType = Converter.typeofString;
            this.prs.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;
            this.prs.PRvarValue = this.objectString.value;
            if (progress == null)
            {
                this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
                this.prs.PRname = "System.String";
            }
            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_0253;

                    case InternalObjectTypeE.Array:
                        this.prs.PRmemberTypeEnum = InternalMemberTypeE.Item;
                        goto Label_0253;
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", new object[] { progress.objectTypeEnum.ToString() }));
            }
        Label_0253:
            this.objectReader.Parse(this.prs);
        }
Beispiel #11
0
        private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            if (this.objectString == null)
            {
                this.objectString = new BinaryObjectString();
            }
            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                this.objectString.Read(this);
                this.objectString.Dump();
            }
            else
            {
                if (this.crossAppDomainString == null)
                {
                    this.crossAppDomainString = new BinaryCrossAppDomainString();
                }
                this.crossAppDomainString.Read(this);
                this.crossAppDomainString.Dump();
                this.objectString.value = this.objectReader.CrossAppDomainArray(this.crossAppDomainString.value) as string;
                if (this.objectString.value == null)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_CrossAppDomainError", (object)"String", (object)this.crossAppDomainString.value));
                }
                this.objectString.objectId = this.crossAppDomainString.objectId;
            }
            this.prs.Init();
            this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
            this.prs.PRobjectId      = this.objectReader.GetId((long)this.objectString.objectId);
            if (this.prs.PRobjectId == this.topId)
            {
                this.prs.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }
            this.prs.PRobjectTypeEnum = InternalObjectTypeE.Object;
            ObjectProgress objectProgress = (ObjectProgress)this.stack.Peek();

            this.prs.PRvalue      = this.objectString.value;
            this.prs.PRkeyDt      = "System.String";
            this.prs.PRdtType     = Converter.typeofString;
            this.prs.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;
            this.prs.PRvarValue   = (object)this.objectString.value;
            if (objectProgress == null)
            {
                this.prs.PRparseTypeEnum = InternalParseTypeE.Object;
                this.prs.PRname          = "System.String";
            }
            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);
        }
        private void ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
        {
            SerTrace.Log(this, "ReadObjectString");

            if (objectString == null)
            {
                objectString = new BinaryObjectString();
            }

            if (binaryHeaderEnum == BinaryHeaderEnum.ObjectString)
            {
                objectString.Read(this);
                objectString.Dump();
            }
            else
            {
                if (crossAppDomainString == null)
                {
                    crossAppDomainString = new BinaryCrossAppDomainString();
                }
                crossAppDomainString.Read(this);
                crossAppDomainString.Dump();
                objectString.value = objectReader.CrossAppDomainArray(crossAppDomainString.value) as String;
                if (objectString.value == null)
                {
                    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_CrossAppDomainError"), "String", crossAppDomainString.value));
                }

                objectString.objectId = crossAppDomainString.objectId;
            }

            prs.Init();
            prs.PRparseTypeEnum = InternalParseTypeE.Object;
            prs.PRobjectId      = objectReader.GetId(objectString.objectId);

            if (prs.PRobjectId == topId)
            {
                prs.PRobjectPositionEnum = InternalObjectPositionE.Top;
            }

            prs.PRobjectTypeEnum = InternalObjectTypeE.Object;

            ObjectProgress objectOp = (ObjectProgress)stack.Peek();

            prs.PRvalue      = objectString.value;
            prs.PRkeyDt      = "System.String";
            prs.PRdtType     = Converter.typeofString;
            prs.PRdtTypeCode = InternalPrimitiveTypeE.Invalid;
            prs.PRvarValue   = objectString.value;           //Need to set it because ObjectReader is picking up value from variant, not pr.PRvalue

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

                SerTrace.Log(this, "ReadObjectString, 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);
        }