System.Runtime.Serialization.ObjectManager.DoNewlyRegisteredObjectFixups C# (CSharp) Method

DoNewlyRegisteredObjectFixups() private method

This is called immediately after we register a new object. Walk that objects dependency list (if it has one) and decrement the counters on each object for the number of unsatisfiable references. If the count reaches 0, go ahead and process the object.
private DoNewlyRegisteredObjectFixups ( ObjectHolder holder ) : void
holder ObjectHolder dependencies The list of dependent objects
return void
        private void DoNewlyRegisteredObjectFixups(ObjectHolder holder)
        {
            if (holder.CanObjectValueChange)
            {
                return;
            }

            //If we don't have any dependencies, we're done.
            LongList dependencies = holder.DependentObjects;
            if (dependencies == null)
            {
                return;
            }

            //Walk all of the dependencies and decrement the counter on each of uncompleted objects.
            //If one of the counters reaches 0, all of it's fields have been completed and we should
            //go take care of its fixups.
            dependencies.StartEnumeration();
            while (dependencies.MoveNext())
            {
                ObjectHolder temp = FindObjectHolder(dependencies.Current);
                Debug.Assert(temp.DirectlyDependentObjects > 0, "temp.m_missingElementsRemaining>0");
                temp.DecrementFixupsRemaining(this);
                if (((temp.DirectlyDependentObjects)) == 0)
                {
                    // If this is null, we have the case where a fixup was registered for a child, the object 
                    // required by the fixup was provided, and the object to be fixed hasn't yet been seen.  
                    if (temp.ObjectValue != null)
                    {
                        CompleteObject(temp, true);
                    }
                    else
                    {
                        temp.MarkForCompletionWhenAvailable();
                    }
                }
            }
        }