Re: Can't figure out this issue with Generics
- From: "sklett" <s@xxxxx>
- Date: Mon, 7 Jan 2008 09:06:12 -0800
Hi Marc,
Great help, thanks so much. The warnings held the key! I've also modifed
the design per your suggestions and it seems to be working nicely now and I
learned something, always a good thing.
Take care,
Steve
"Marc Gravell" <marc.gravell@xxxxxxxxx> wrote in message
news:3131c6cd-7deb-4e4c-becd-37546a460c30@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
the types it says it can't covert are the SAME!
I'm stumped, anyone see the problem?
Different T... errors are one thing, but also look at the *warnings*:
Warning 1 Type parameter 'T' has the same name as the type parameter
from outer type 'EventShimWithArgs<T>' d:\dump\wf
\ConsoleApplication2\ConsoleApplication2\Program.cs 60 21
ConsoleApplication2
Warning 2 Type parameter 'T' has the same name as the type parameter
from outer type 'EventShimWithArgs<T>' d:\dump\wf
\ConsoleApplication2\ConsoleApplication2\Program.cs 67 8
ConsoleApplication2
So:
Rar<T> and Create<T> should perhaps not be generic methods, but just
members of the generic class?
i.e. Rar(object sender, EventArgs<T> eventArgs) etc
If you *need* them as generic methods inside the generic class, then
pick a different name for the arg, i.e.
i.e. Rar<TSomethingElse>(...)
(pick a meaningful name...)
Marc
.
- References:
- Can't figure out this issue with Generics
- From: Steve K.
- Re: Can't figure out this issue with Generics
- From: Marc Gravell
- Can't figure out this issue with Generics
- Prev by Date: Re: threading & mutex: question about example
- Next by Date: Re: Remote call to COM impersonating another user
- Previous by thread: Re: Can't figure out this issue with Generics
- Next by thread: processes and mutexes
- Index(es):
Relevant Pages
|