Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
GeneralRe: Attributes in C# Pin
Pete O'Hanlon27-Apr-11 1:01
mvePete O'Hanlon27-Apr-11 1:01 
GeneralRe: Attributes in C# Pin
Keith Barrow27-Apr-11 1:24
professionalKeith Barrow27-Apr-11 1:24 
GeneralRe: Attributes in C# Pin
Not Active27-Apr-11 2:29
mentorNot Active27-Apr-11 2:29 
GeneralRe: Attributes in C# Pin
Keith Barrow27-Apr-11 2:32
professionalKeith Barrow27-Apr-11 2:32 
GeneralRe: Attributes in C# Pin
Pete O'Hanlon27-Apr-11 2:36
mvePete O'Hanlon27-Apr-11 2:36 
GeneralRe: Attributes in C# Pin
Not Active27-Apr-11 2:40
mentorNot Active27-Apr-11 2:40 
GeneralRe: Attributes in C# Pin
Wayne Gaylard27-Apr-11 0:55
professionalWayne Gaylard27-Apr-11 0:55 
AnswerRe: Attributes in C# Pin
ambarishtv28-Apr-11 5:45
ambarishtv28-Apr-11 5:45 
Attribute

Developers can add metadata to their code through attributes. There are two types of attributes, custom and pseudo custom attributes, and to the developer these have the same syntax. Attributes in code are messages to the compiler to generate metadata. In CIL, metadata such as inheritance modifiers, scope modifiers, and almost anything that isn't either opcodes or streams, are also referred to as attributes.<br />
A custom attribute is a regular class that inherits from the Attribute class. <br />
Custom attributes are used by the .NET Framework extensively. Windows Communication Framework uses attributes to define service contracts, ASP.NET uses these to expose methods as web services, LINQ to SQL uses them to define the mapping of classes to the underlying relational schema, Visual Studio uses them to group together properties of an object, the class developer indicates the category for the object's class by applying the [Category] custom attribute. Custom attributes are interpreted by application code and not the CLR.When the compiler sees a custom attribute it will generate custom metadata that is not recognised by the CLR. The developer has to provide code to read the metadata and act on it.

Thumbs Up | :thumbsup:
-ambarish-

QuestionTime-Out for Loop in C#? Pin
JP_Rocks26-Apr-11 23:33
JP_Rocks26-Apr-11 23:33 
AnswerRe: Time-Out for Loop in C#? Pin
V.26-Apr-11 23:41
professionalV.26-Apr-11 23:41 
AnswerRe: Time-Out for Loop in C#? Pin
Wayne Gaylard26-Apr-11 23:48
professionalWayne Gaylard26-Apr-11 23:48 
AnswerRe: Time-Out for Loop in C#? Pin
Pete O'Hanlon27-Apr-11 0:02
mvePete O'Hanlon27-Apr-11 0:02 
QuestionXML Search Pin
DJ24526-Apr-11 20:40
DJ24526-Apr-11 20:40 
AnswerRe: XML Search Pin
Pete O'Hanlon26-Apr-11 22:04
mvePete O'Hanlon26-Apr-11 22:04 
GeneralRe: XML Search Pin
DJ24526-Apr-11 22:34
DJ24526-Apr-11 22:34 
GeneralRe: XML Search Pin
Pete O'Hanlon26-Apr-11 23:12
mvePete O'Hanlon26-Apr-11 23:12 
GeneralRe: XML Search Pin
PIEBALDconsult27-Apr-11 3:06
mvePIEBALDconsult27-Apr-11 3:06 
QuestionAdding missing header information in tiff files Pin
meeram39526-Apr-11 20:12
meeram39526-Apr-11 20:12 
AnswerRe: Adding missing header information in tiff files Pin
Pete O'Hanlon26-Apr-11 22:01
mvePete O'Hanlon26-Apr-11 22:01 
AnswerRe: Adding missing header information in tiff files Pin
Ravi Sant9-May-11 23:33
Ravi Sant9-May-11 23:33 
QuestionServices-like platform? Pin
NaNg1524126-Apr-11 11:23
NaNg1524126-Apr-11 11:23 
AnswerRe: Services-like platform? Pin
Justin Helsley26-Apr-11 12:50
Justin Helsley26-Apr-11 12:50 
GeneralRe: Services-like platform? Pin
NaNg1524126-Apr-11 21:34
NaNg1524126-Apr-11 21:34 
GeneralRe: Services-like platform? Pin
Justin Helsley27-Apr-11 21:29
Justin Helsley27-Apr-11 21:29 
QuestionFrequency-shifting Auditory Feedback Pin
mehdiattar26-Apr-11 9:51
mehdiattar26-Apr-11 9:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.