Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Custom Attribute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Subbu - 27 Apr 2005 06:25 GMT
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
Eric Cadwell - 27 Apr 2005 16:26 GMT
Not sure what you're intending to use the attribute for.

-Eric
anonymous@discussions.microsoft.com - 28 Apr 2005 03:49 GMT
>-----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)
Eric Cadwell - 03 May 2005 16:26 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.