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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -