Пример #1
0
        public virtual void DoFixups()
        {
            ObjectHolder current;
            int          num = -1;

            while (num != 0)
            {
                num = 0;
                ObjectHolderListEnumerator fixupEnumerator = this.SpecialFixupObjects.GetFixupEnumerator();
                while (fixupEnumerator.MoveNext())
                {
                    current = fixupEnumerator.Current;
                    if (current.ObjectValue == null)
                    {
                        throw new SerializationException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_ObjectNotSupplied"), new object[] { current.m_id }));
                    }
                    if (current.TotalDependentObjects == 0)
                    {
                        if (current.RequiresSerInfoFixup)
                        {
                            this.FixupSpecialObject(current);
                            num++;
                        }
                        else if (!current.IsIncompleteObjectReference)
                        {
                            this.CompleteObject(current, true);
                        }
                        if (current.IsIncompleteObjectReference && this.ResolveObjectReference(current))
                        {
                            num++;
                        }
                    }
                }
            }
            if (this.m_fixupCount == 0L)
            {
                if (this.TopObject is TypeLoadExceptionHolder)
                {
                    throw new SerializationException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_TypeLoadFailure"), new object[] { ((TypeLoadExceptionHolder)this.TopObject).TypeName }));
                }
            }
            else
            {
                for (int i = 0; i < this.m_objects.Length; i++)
                {
                    for (current = this.m_objects[i]; current != null; current = current.m_next)
                    {
                        if (current.TotalDependentObjects > 0)
                        {
                            this.CompleteObject(current, true);
                        }
                    }
                    if (this.m_fixupCount == 0L)
                    {
                        return;
                    }
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_IncorrectNumberOfFixups"));
            }
        }
Пример #2
0
        public virtual void DoFixups()
        {
            int num = -1;

            while (num != 0)
            {
                num = 0;
                ObjectHolderListEnumerator fixupEnumerator = this.SpecialFixupObjects.GetFixupEnumerator();
                while (fixupEnumerator.MoveNext())
                {
                    ObjectHolder current = fixupEnumerator.Current;
                    if (current.ObjectValue == null)
                    {
                        throw new SerializationException(Environment.GetResourceString("Serialization_ObjectNotSupplied", (object)current.m_id));
                    }
                    if (current.TotalDependentObjects == 0)
                    {
                        if (current.RequiresSerInfoFixup)
                        {
                            this.FixupSpecialObject(current);
                            ++num;
                        }
                        else if (!current.IsIncompleteObjectReference)
                        {
                            this.CompleteObject(current, true);
                        }
                        if (current.IsIncompleteObjectReference && this.ResolveObjectReference(current))
                        {
                            ++num;
                        }
                    }
                }
            }
            if (this.m_fixupCount == 0L)
            {
                if (this.TopObject is TypeLoadExceptionHolder)
                {
                    throw new SerializationException(Environment.GetResourceString("Serialization_TypeLoadFailure", (object)((TypeLoadExceptionHolder)this.TopObject).TypeName));
                }
            }
            else
            {
                for (int index = 0; index < this.m_objects.Length; ++index)
                {
                    for (ObjectHolder holder = this.m_objects[index]; holder != null; holder = holder.m_next)
                    {
                        if (holder.TotalDependentObjects > 0)
                        {
                            this.CompleteObject(holder, true);
                        }
                    }
                    if (this.m_fixupCount == 0L)
                    {
                        return;
                    }
                }
                throw new SerializationException(Environment.GetResourceString("Serialization_IncorrectNumberOfFixups"));
            }
        }