Missing 'method' property in delegate

  • Thread starter Thread starter christoff
  • Start date Start date
C

christoff

Hi Guys

I`m traying to obtain a method names from Event>GetInvocationList()
but , i know that i should use Delegate.MethodName and i do not see
it. Any ideas ?

Thanks in advance
 
Hi Guys

I`m traying to obtain a method names from  Event>GetInvocationList()
but , i know that i should use Delegate.MethodName and i do not see
it. Any ideas ?

Thanks in advance

Hi

static event EventHandler A;

foreach(Delegate d in A.GetInvocationList()){
if (d.Method.Name == "method1"){
Console.WriteLine("Found it");
}

}
 
someDelegate.GetInvocationList().Select(d => d.Method.Name) works for me;
You are working with the set, not scalar - maybe it helps.

Regards

--http://www.pajacyk.pl

Thanks for response but when i use :

foreach (Delegate X in OnScanerRead.GetInvocationList())
{
X.GetInvocationList().Select(d => d.Method.Name);
}

Is that correct ?

Pozdrawiam ;)
 
Hi

        static event EventHandler A;

           foreach(Delegate d in A.GetInvocationList()){
                if (d.Method.Name == "method1"){
                     Console.WriteLine("Found it");
               }

            }


Thanks for Your response , i`ve found it already but :

foreach (Delegate X in OnScanerRead.GetInvocationList())
{
X.Method >>> I dont see property 'Method ' - that
is the point
}

Missing namespace ?

Regards
 
Thanks for Your response , i`ve found it already but :

 foreach (Delegate X in OnScanerRead.GetInvocationList())
                {
                    X.Method >>> I dont see property 'Method ' - that
is the point
                }

Missing namespace ?

Regards

Where are you running this?

Is this a PPC device?
 
Device with Windows Mobile 5.0 CE

Well, then you are in a complete different ball game.
The CF has a lot of features removed, and what you want might be one
of those. Look into MSDN if the Member is supported in the CF
 
Well, then you are in a complete different ball game.
The CF has a lot of features removed, and what you want might be one
of those. Look into MSDN if the Member is supported in the CF

Maybe you`re right , sorry i should tell at the inception this topic
that it is CF
Thank You
Regards
 
[...]
Device with Windows Mobile 5.0 CE
Well, then you are in a complete different ball game.
The CF has a lot of features removed, and what you want might be one
of those. Look into MSDN if the Member is supported in the CF

MSDN says that Delegate.Method property is supported on the Compact  
Framework, but only as of v3.5.  I don't actually know what .NET version  
is on Windows Mobile 5.0 CE, but I'd guess it precedes v3.5, based just on  
what I've read in this thread.  :)

Wikipedia supports this guess.  According to the Windows Mobile article,  
Mobile 5.0 uses .NET CF 1.0 SP3.

Pete

Is any way to upgrade version CF on Win 5.0 CE ?
 
I'm sure I don't know.  :)

I'm pretty sure there's a CF-specific newsgroup somewhere.  If so, there  
should be people there who have some real first-hand experience with the  
Compact Framework and who can provide much better answers than what we're 
capable of here.  Don't mistake our lucky guesses with real expertise.  :)

Pete

Ok. Thank You very much indeed !!

Sincerely
 
Back
Top