私はこのAnnotationクラスを作成しました
この例は、常に例外をスローしますが、まだ私の質問が何であるかを説明しようとしているので、まだ使用しています。 私の注釈は何らかの理由で呼び出されることはありません。C#カスタムアノテーションの使用
public class AuthenticationRequired : System.Attribute
{
public AuthenticationRequired()
{
// My break point never gets hit why?
throw new Exception("Throw this to see if annotation works or not");
}
}
[AuthenticationRequired]
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// My break point get here
}
のようなものを言っているカスタムアノテーションをアクセスして読み取る方法があります。http://msdn.microsoft.com/en-us/library /z919e8tw.aspx#Y109 –