Lab 8 BuildUp method

Topics: CAB & Smart Client Software Factory
Jun 9, 2006 at 7:07 AM
originally posted by: gofaster

The method provided in the lab didn't compile. I've altered it slightly by creating a local Control variable and changing the call to CheckAuthorization to include it. This seems to work fine now.

public override object BuildUp(IBuilderContext context, Type t, object existing, string id)
{
if (existing == null)
{
return base.BuildUp(context, t, existing, id);
}

Type targetType = existing.GetType();
Control control = existing as Control;

foreach (PropertyInfo propertyInfo in targetType.GetProperties())
{
CheckAuthorization(context, control, id, propertyInfo);
}

return base.BuildUp(context, t, existing, id);
}