Beispiel #1
0
 internal ObjectHolder(object obj, long objID, System.Runtime.Serialization.SerializationInfo info, ISerializationSurrogate surrogate, long idOfContainingObj, FieldInfo field, int[] arrayIndex)
 {
     this.m_object = obj;
     this.m_id = objID;
     this.m_flags = 0;
     this.m_missingElementsRemaining = 0;
     this.m_missingDecendents = 0;
     this.m_dependentObjects = null;
     this.m_next = null;
     this.m_serInfo = info;
     this.m_surrogate = surrogate;
     this.m_markForFixupWhenAvailable = false;
     if (obj is TypeLoadExceptionHolder)
     {
         this.m_typeLoad = (TypeLoadExceptionHolder) obj;
     }
     if ((idOfContainingObj != 0L) && (((field != null) && field.FieldType.IsValueType) || (arrayIndex != null)))
     {
         if (idOfContainingObj == objID)
         {
             throw new SerializationException(Environment.GetResourceString("Serialization_ParentChildIdentical"));
         }
         this.m_valueFixup = new ValueTypeFixupInfo(idOfContainingObj, field, arrayIndex);
     }
     this.SetFlags();
 }
Beispiel #2
0
 internal ObjectHolder(object obj, long objID, System.Runtime.Serialization.SerializationInfo info, ISerializationSurrogate surrogate, long idOfContainingObj, FieldInfo field, int[] arrayIndex)
 {
     this.m_object = obj;
     this.m_id     = objID;
     this.m_flags  = 0;
     this.m_missingElementsRemaining = 0;
     this.m_missingDecendents        = 0;
     this.m_dependentObjects         = null;
     this.m_next      = null;
     this.m_serInfo   = info;
     this.m_surrogate = surrogate;
     this.m_markForFixupWhenAvailable = false;
     if (obj is TypeLoadExceptionHolder)
     {
         this.m_typeLoad = (TypeLoadExceptionHolder)obj;
     }
     if ((idOfContainingObj != 0L) && (((field != null) && field.FieldType.IsValueType) || (arrayIndex != null)))
     {
         if (idOfContainingObj == objID)
         {
             throw new SerializationException(Environment.GetResourceString("Serialization_ParentChildIdentical"));
         }
         this.m_valueFixup = new ValueTypeFixupInfo(idOfContainingObj, field, arrayIndex);
     }
     this.SetFlags();
 }
Beispiel #3
0
 internal void SetObjectValue(object obj, ObjectManager manager)
 {
     this.m_object = obj;
     if (obj == manager.TopObject)
     {
         this.m_reachable = true;
     }
     if (obj is TypeLoadExceptionHolder)
     {
         this.m_typeLoad = (TypeLoadExceptionHolder)obj;
     }
     if (this.m_markForFixupWhenAvailable)
     {
         manager.CompleteObject(this, true);
     }
 }
        [System.Security.SecurityCritical]  // auto-generated
        internal void SetObjectValue(Object obj, ObjectManager manager) {
            m_object = obj; 
            if (obj == manager.TopObject)
                m_reachable = true; 
            if (obj is TypeLoadExceptionHolder) 
                m_typeLoad = (TypeLoadExceptionHolder)obj;
 
            if (m_markForFixupWhenAvailable) {
                manager.CompleteObject(this, true);
            }
        } 
        internal ObjectHolder(Object obj, long objID, SerializationInfo info, 
                              ISerializationSurrogate surrogate, long idOfContainingObj, FieldInfo field, int[] arrayIndex) {
            Contract.Assert(objID>=0,"objID>=0");

            m_object=obj; //May be null; 
            m_id=objID;
 
            m_flags=0; 
            m_missingElementsRemaining=0;
            m_missingDecendents = 0; 
            m_dependentObjects=null;
            m_next=null;

            m_serInfo = info; 
            m_surrogate = surrogate;
            m_markForFixupWhenAvailable = false; 
 
            if (obj is TypeLoadExceptionHolder)
            { 
                m_typeLoad = (TypeLoadExceptionHolder)obj;
            }

 
            if (idOfContainingObj!=0 && ((field!=null && field.FieldType.IsValueType) || arrayIndex!=null)) {
                if (idOfContainingObj == objID) { 
                    throw new SerializationException(Environment.GetResourceString("Serialization_ParentChildIdentical")); 
                }
 
                m_valueFixup = new ValueTypeFixupInfo(idOfContainingObj, field, arrayIndex);
            }

            SetFlags(); 
        }
Beispiel #6
0
        internal ObjectHolder(
            object obj, long objID, SerializationInfo info, ISerializationSurrogate surrogate,
            long idOfContainingObj, FieldInfo field, int[] arrayIndex)
        {
            Debug.Assert(objID >= 0, "objID>=0");

            _object = obj; //May be null;
            _id = objID;

            _flags = 0;
            _missingElementsRemaining = 0;
            _missingDecendents = 0;
            _dependentObjects = null;
            _next = null;

            _serInfo = info;
            _surrogate = surrogate;
            _markForFixupWhenAvailable = false;

            if (obj is TypeLoadExceptionHolder)
            {
                _typeLoad = (TypeLoadExceptionHolder)obj;
            }

            if (idOfContainingObj != 0 && ((field != null && field.FieldType.GetTypeInfo().IsValueType) || arrayIndex != null))
            {
                if (idOfContainingObj == objID)
                {
                    throw new SerializationException(SR.Serialization_ParentChildIdentical);
                }

                _valueFixup = new ValueTypeFixupInfo(idOfContainingObj, field, arrayIndex);
            }

            SetFlags();
        }