private bool ResolveObjectReference(ObjectHolder holder)
{
int num = 0;
try
{
object objectValue;
do
{
objectValue = holder.ObjectValue;
holder.SetObjectValue(((IObjectReference)holder.ObjectValue).GetRealObject(this.m_context), this);
if (holder.ObjectValue == null)
{
holder.SetObjectValue(objectValue, this);
return(false);
}
if (num++ == 100)
{
throw new SerializationException(Environment.GetResourceString("Serialization_TooManyReferences"));
}
}while ((holder.ObjectValue is IObjectReference) && (objectValue != holder.ObjectValue));
}
catch (NullReferenceException)
{
return(false);
}
holder.IsIncompleteObjectReference = false;
this.DoNewlyRegisteredObjectFixups(holder);
return(true);
}