Possible Duplicate:
How to determine the attached type from within a custom attribute?
I have this custom class attribute:
[AttributeUsage(AttributeTargets.Class)]
public class ConfigurableClass : Attribute
{
public Type Control { get; private set; }
public bool IsSingleton { get; private set; }
public string Name { get; private set; }
public ConfigurableClass(bool isSingleton) : this(null, isSingleton)
{
}
public ConfigurableClass(Type control, bool isSingleton)
{
Control = control;
this.IsSingleton = isSingleton;
this.Name = ""; //set name to typename of the attached class here?
}
public ConfigurableClass(Type control, bool isSingleton, string name) : this(control, isSingleton)
{
this.Name = name;
}
}
Notice the line with the comment in it. Is it possible to get the type of the class that this class-attribute is attached to, or is it not?