Re: Generics with List and Delegates?

Tech-Archive recommends: Speed Up your PC by fixing your registry



"Cedric Rogers" <cedricrogers@xxxxxxxxxxxxxxxx> a écrit dans le message de
news: 916E138B-3E55-491B-8437-B9F8E8D316A1@xxxxxxxxxxxxxxxx

|I wasn't sure if I could do this. I believe I am stretching the capability
of
| what generics can do for me but here goes.
|
| I have a generic delegate defined as
| public delegate bool RuleDelegate<T>(T item);
|
| In my class my goal is to use a generic list collection to contain my
| generic delegates. This will allow me to pass this List to another
library
| and call this list of functions. This could provide a new way to build
rule
| base engines in .NET if this is possible thus being independant of
| implementation. Is this possible with .NET 2.0?

As far as I have been able to ascertain, it is not possible to have a list
of generic delegates, they would have to be bound to one particular type.

However, I would be grateful to find that I am wrong, because it is
something that I had hoped to do.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer


.



Relevant Pages

  • Re: Generics and Type casting.
    ... structure the compiler would also have to write in run-time type ... generics added the capability to have collections ... what's allowed in the collection for certain purposes. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: "Vector" Equivalent
    ... this capability would be of use. ... I reread your other post and ... But specialising the type of an inherited property ... from an existing base class isn't something that generics can do for you ...
    (borland.public.delphi.non-technical)
  • Re: "Vector" Equivalent
    ... In article, Brian Moelk says... ... this capability would be of use. ... The object list is a poor example because it is something that generics ... Jolyon Smith ...
    (borland.public.delphi.non-technical)