PC Review


Reply
Thread Tools Rate Thread

Accessing Parameter Value with Attribute

 
 
Larry R
Guest
Posts: n/a
 
      7th May 2007
Is there any way to use a custom attribute class to use a parameter of
the tagged method?

For instance,

[LogThis ( user) ]
public TagThis ( string user )
{
....
}

Larry R

 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      7th May 2007
Larry,

No, there is not. Attributes don't have a sense of what they are
attached to. That logic will have to be outside of the attribute.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Larry R" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there any way to use a custom attribute class to use a parameter of
> the tagged method?
>
> For instance,
>
> [LogThis ( user) ]
> public TagThis ( string user )
> {
> ...
> }
>
> Larry R
>



 
Reply With Quote
 
Marc Gravell
Guest
Posts: n/a
 
      7th May 2007
It sounds like you might want "AOP". C# does not support this "out of
the box", but there are multiple implementations available. I don't
want to recommend any as I haven't used any of them enough to give a
sensible answer.

Marc

 
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
accessing COM from C# with an IStream** parameter Ralf Microsoft C# .NET 7 28th Jan 2008 05:59 AM
checking for / accessing custom attribute fails with 0x8000500c Jabba Microsoft Windows 2000 Active Directory 5 1st Sep 2005 10:29 PM
Accessing Output Parameter Value Christopher Weaver Microsoft C# .NET 8 15th Aug 2005 11:46 PM
Accessing the /user parameter in vb =?Utf-8?B?U3RldmVuIEFuZ2VsbA==?= Microsoft Access Security 0 11th Jan 2005 02:25 PM
Custom Parameter Attribute for Set Accessors =?Utf-8?B?QmVuIEJsYWly?= Microsoft C# .NET 2 30th Jan 2004 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:07 PM.