Custom Attribute

  • Thread starter Thread starter Subbu
  • Start date Start date
S

Subbu

Is is possible to write custom attributes for exception
handling a function.

Example:

[ExceptionAttribute Enable=true]
void Function(int intParameter)
{
<< some code >>
}

If Yes, can you tell me the steps for doing it.

regards
subbu
 
-----Original Message-----
Not sure what you're intending to use the attribute for.

-Eric


.
Actually i am trying to have the exception handling for a
method by using Attributes(custom attribues)
 
Seems like you want Conditional Compilation. The attribute would require
reflection and it would be compiled into the metadata so it wouldn't be
dynamic. Using a conditional compiler constant won't require reflection to
determine the value of the attribute.

#const Level1

#if Level1
#else
#endif

HTH;
Eric Cadwell
http://www.origincontrols.com
 
Back
Top