On Sun, Dec 22, 2002, Leo Sutic wrote:
> The question is now: If you add the same method twice, will it be called twice?
[snip]
> Excalibur's implementation (and C#) says no. The MultiDelegate has a
> set-like behavior, so that adding a delegate once is the same as adding it
> twice. The code above is therefore equal to:
I did some research and C# does allow duplicates. Here's a snippet from
the docs:
The invocation list of a delegate is an ordered set of delegates in
which each element of the list invokes exactly one of the methods
invoked by the delegate. An invocation list can contain duplicate
methods. During an invocation, a delegate invokes methods in the
order in which they appear in the invocation list. A delegate
attempts to invoke every method in its invocation list; duplicates
are invoked once for each time they appear in the invocation
list. Delegates are immutable; once created, the invocation list of
a delegate does not change.
It's easier to implement if you don't require set-like semantics. I'll
get a example multicasting delegate implemented in the next week or so
for people to look at.
-Chris
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>