I really don't follow what you're trying to do. I can't tell what context you're reading the Method property of the delegate - is the code that's going to invoke the delegate reading it? (If so, surely it knows what is being passed in because it will be the code that gets to decide what is passed in.) Is it the code being called? (If so, surely it knows what it has been passed - it can just go and look at it!)
Or is there some other piece of code? The thing is, the only time that any parameter *values* are involved is when the delegate is actually invoked, and the only two parties to that particular operation are the caller and the callee. Both of them know what the parameter is so there's no problem. But if you're looking at a delegate outside of the context of any particular call through the delegate, then there are no parameter values involved - no methods are being invoked so there's no need for any parameters. All that you can discover is what *types* of parameters are allowed to be passed. This is what the Method property's GetParameters method returns. Type information is static - a given delegate type always accepts the same parameter types, and that never changes. Parameters are dynamic - the actual parameters being passed are specific to a particular invocation of the delegate. The delegate's Method property returns you type information (i.e. static information). How could it return anything else? -- Ian Griffiths DevelopMentor ----- Original Message ----- From: "Brady Gaster" <[EMAIL PROTECTED]> > In my application, i have a delegate that looks like this: > > public delegate void ProcessAutoDelegate(AutoType at) > > The parameter is an enumeration of type AutoType, within my application. > This enumeration contains 5 possible values. > > What i'm trying to do here is to enable any calling application with > the functionality of applying the delegate's functionality only to > Automobiles (another class, Automobile) of whatever type was > passed in as the parameter to the delegate. The thing is, i can't > use the GetParameters() method of the Method property of > the delegate, as no value is accessible for the parameter. > > I guess what i need to know is, how do you look at the value > of a parameter dynamically? I've tried various methods of type > conversion, but none work. It seems i always get back the type > "System.Reflection.ParameterInfo." (which, i guess, is to be > expected - now how to get the value..?) > > Within the list archives, there was a link to a thread that was supposedly > on this topic, but clicking on the thread led me to an error page > (apparently it was a bad link). You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.
