| Start |
|---|
Creating a custom attribute |
| Reading an attribute Method Or iterate through them
Boolean argument |
Using an attribute |
| DebuggerDisplay Attribute Adding the Expressions that are wrapped in Adding Even though general expressions are allowed in the A way to make One might want |
| Caller info attributes Caller info attributes can be used to pass down information about the invoker to the invoked method. The declaration looks like this: And the invocation looks like this: Notice that only the first parameter is passed explicitly to the The The And the 'callerFilePath' parameter will receive the full path of the file |
| Reading an attribute from interface There is no simple way to obtain attributes from an interface, since classes does not inherit attributes from an interface. Whenever implementing an interface or overriding members in a derived class, you need to re-declare the attributes.
So in the example below output would be One way to retrieve interface attributes is to search for them through all the interfaces implemented by a class. |
| Obsolete Attribute System.Obsolete is an attribute that is used to mark a type or a member that has a better version, and thus should not be used. In case the class above is used, the compiler will give the warning "This class is obsolete. Use SomeOtherClass instead." |
Read Article
https://develop.horje.com/learn/1434/reference