c# - Reflection to find what type/method called a constructor? -
i not sure if possible, if have default constructor , invoking (method, constructor, property, etc) possible determine type called while in constructor?
i interested in use regards applying attribute property.
update : question answered : when custom attribute's constructor run?
example :
[attributeusage(attributetargets.property)] public class someattribute : attribute { public type invokingtype { get; private set; } public someattribute() { //invokingtype = property applied } } public class someclass { [someattribute] public string someproperty { get; set; } }
Comments
Post a Comment