Looking at System.Windows.Threading.Dispatcher (as decompiled by Reflector) I came across;
[field: SecurityCritical]
public event DispatcherUnhandledExceptionFilterEventHandler UnhandledExceptionFilter;
I don’t recognize the ‘field’ part of the attribute declaration, what is it?
Edit:
This is how it appears in the reference source:
public event DispatcherUnhandledExceptionFilterEventHandler UnhandledExceptionFilter
{
[SecurityCritical]
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
add
{
_unhandledExceptionFilter += value;
}
[SecurityCritical]
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
remove
{
_unhandledExceptionFilter -= value;
}
}
field:is called an attribute target. It lets you specify the target (assembly, return, etc.) for the attribute.See http://msdn.microsoft.com/en-us/library/b3787ac0.aspx for more details.