SmartPart Attribute Inherited?

Topics: CAB & Smart Client Software Factory
Aug 13, 2006 at 10:44 AM
originally posted by: willfarnaby

If I decorate a base UserControl with SmartPart , is any class that derives from the base class recognized as a "SmartPart" by the CAB? Thanks.
Aug 16, 2006 at 4:59 AM
originally posted by: JKraft4PIT

How are/would you derive from the class?
Aug 16, 2006 at 7:27 AM
originally posted by: willfarnaby

SmartPart
public class CabUserControl : UserControl { }

public class MyView : CabUserControl { }

Is MyView recognized by the CAB framework as a "Smart Part", thanks.
Aug 16, 2006 at 7:49 AM
originally posted by: JKraft4PIT

I am not sure, I haven't found anyhting in the help files. I will try to look into this this afternnon.
Aug 18, 2006 at 7:34 AM
originally posted by: willfarnaby

I just had the time to actually mark the base class "CabUserControl" as a SmartPart. The derived class "MyView" IS indeed - without being attributed itself - recognized in the CAB framework runtime as a "SmartPart".
Aug 18, 2006 at 7:40 AM
originally posted by: JKraft4PIT

I will make a note of that.
I did assume that it was true but I hadn't tested it yet.

Thank you for the clarity

How did you test if it did?
Aug 18, 2006 at 2:20 PM
originally posted by: limepickle

Yep - the SmartPartAttribute is defined as follows:

AttributeUsage(AttributeTargets.Class)
public sealed class SmartPartAttribute : Attribute
{
}

and by default, attributes are Inherited.