私はこのカスタム属性を持っています:
[AttributeUsage(AttributeTargets.Method)]
public class MyAttribute : Attribute
{
public MyAttribute()
{
// I want to get the Test type in here.
// it could be any kind of type that one of its members uses this attribute.
}
}
どこかで MyAtrribute を使用しています。
public class Test
{
[MyAttribute]
public void MyMethod()
{
//method body
}
public string Name{get;set;}
public string LastName{get;set;}
}
私の質問は、MyAttribute のコンストラクターからテスト クラスの他のメンバーを取得できますか?
助けてくれてありがとう!