PC Review


Reply
Thread Tools Rate Thread

Custom Attribute

 
 
Subbu
Guest
Posts: n/a
 
      27th Apr 2005
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
 
Reply With Quote
 
 
 
 
Eric Cadwell
Guest
Posts: n/a
 
      27th Apr 2005
Not sure what you're intending to use the attribute for.

-Eric


 
Reply With Quote
 
Guest
Posts: n/a
 
      28th Apr 2005

>-----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)
 
Reply With Quote
 
Eric Cadwell
Guest
Posts: n/a
 
      3rd May 2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom attribute ? Pete Kane Microsoft C# .NET 6 21st May 2009 06:12 AM
Custom attribute ? Pete Kane Microsoft C# .NET 0 19th May 2009 12:41 PM
Using a custom attribute hardieca@hotmail.com Microsoft VB .NET 0 16th Jul 2007 03:21 PM
Custom [Attribute()]s =?Utf-8?B?TWlrZQ==?= Microsoft Dot NET Framework 0 29th Feb 2004 12:06 AM
Custom attribute applying another attribute Andrew Roberts Microsoft Dot NET Framework 1 4th Sep 2003 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:47 AM.