Re: Question about attributes...
From: Eran Kampf (eran_at_ekampf.com)
Date: 11/01/04
- Next message: Justin Rogers: "Re: String, Array, DataGrid Question?"
- Previous message: pontifikas: "Getting the version of certain programms via code."
- In reply to: Girish: "Question about attributes..."
- Next in thread: Daniel O'Connell [C# MVP]: "Re: Question about attributes..."
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 1 Nov 2004 14:17:47 +0200
You can't....
Attributes allow you to place extra descriptive information into metadata
that can be extracted using runtime reflection services.
Attributes do not actually execute (to perform tasks like parameter checking
etc...)
I guess what you're trying to do is what XC# features.... check it out at
http://www.resolvecorp.com/default.aspx
Eran Kampf
http://www.ekampf.com
"Girish" <girish@in-reality.com> wrote in message
news:OQKXyZAwEHA.2568@TK2MSFTNGP11.phx.gbl...
> If I have something like that
>
> class TestNegativeValue:Attribute
> {
> // ...
> }
> ...
> [TestNegativeValue]
> public void ExceptionNegativeValue(int i)
> {
> //...
> }
>
> how can I test i(throw exception if i<0) directly
> from the attribute body ?
>
> Thanks.
> Girish
- Next message: Justin Rogers: "Re: String, Array, DataGrid Question?"
- Previous message: pontifikas: "Getting the version of certain programms via code."
- In reply to: Girish: "Question about attributes..."
- Next in thread: Daniel O'Connell [C# MVP]: "Re: Question about attributes..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|