private object GetPropertyValue(IDesignerSerializationManager manager, PropertyDescriptor property, object value, out bool validValue)
{
object obj2 = null;
validValue = true;
try
{
if (!property.ShouldSerializeValue(value))
{
AmbientValueAttribute attribute = (AmbientValueAttribute) property.Attributes[typeof(AmbientValueAttribute)];
if (attribute != null)
{
return attribute.Value;
}
DefaultValueAttribute attribute2 = (DefaultValueAttribute) property.Attributes[typeof(DefaultValueAttribute)];
if (attribute2 != null)
{
return attribute2.Value;
}
validValue = false;
}
obj2 = property.GetValue(value);
}
catch (Exception exception)
{
validValue = false;
manager.ReportError(System.Design.SR.GetString("SerializerPropertyGenFailed", new object[] { property.Name, exception.Message }));
}
return obj2;
}