2 using System.Collections;
3 using System.Collections.Generic;
11 LinkedList<System.Action> delegates =
new LinkedList<System.Action>();
13 Dictionary<System.Action, LinkedListNode<System.Action>> lookup =
new Dictionary<System.Action, LinkedListNode<System.Action>>();
15 public void Add(System.Action rhs)
17 if (lookup.ContainsKey(rhs))
return;
19 lookup[rhs] = delegates.AddLast(rhs);
22 public void Remove(System.Action rhs)
24 LinkedListNode<System.Action> node;
25 if (lookup.TryGetValue(rhs, out node))
28 delegates.Remove(node);
34 var node = delegates.First;
47 LinkedList<System.Action<A>> delegates =
new LinkedList<System.Action<A>>();
49 Dictionary<System.Action<A>, LinkedListNode<System.Action<A>>> lookup =
new Dictionary<System.Action<A>, LinkedListNode<System.Action<A>>>();
51 public void Add(System.Action<A> rhs)
53 if (lookup.ContainsKey(rhs))
return;
55 lookup[rhs] = delegates.AddLast(rhs);
58 public void Remove(System.Action<A> rhs)
60 LinkedListNode<System.Action<A>> node;
61 if (lookup.TryGetValue(rhs, out node))
64 delegates.Remove(node);
70 var node = delegates.First;
83 LinkedList<System.Action<A, B>> delegates =
new LinkedList<System.Action<A, B>>();
85 Dictionary<System.Action<A, B>, LinkedListNode<System.Action<A, B>>> lookup =
new Dictionary<System.Action<A, B>, LinkedListNode<System.Action<A, B>>>();
87 public void Add(System.Action<A, B> rhs)
89 if (lookup.ContainsKey(rhs))
return;
91 lookup[rhs] = delegates.AddLast(rhs);
94 public void Remove(System.Action<A, B> rhs)
96 LinkedListNode<System.Action<A, B>> node;
97 if (lookup.TryGetValue(rhs, out node))
100 delegates.Remove(node);
104 public void Call(A a, B b)
106 var node = delegates.First;
119 LinkedList<System.Action<A, B, C>> delegates =
new LinkedList<System.Action<A, B, C>>();
121 Dictionary<System.Action<A, B, C>, LinkedListNode<System.Action<A, B, C>>> lookup =
new Dictionary<System.Action<A, B, C>, LinkedListNode<System.Action<A, B, C>>>();
123 public void Add(System.Action<A, B, C> rhs)
125 if (lookup.ContainsKey(rhs))
return;
127 lookup[rhs] = delegates.AddLast(rhs);
130 public void Remove(System.Action<A, B, C> rhs)
132 LinkedListNode<System.Action<A, B, C>> node;
133 if (lookup.TryGetValue(rhs, out node))
136 delegates.Remove(node);
140 public void Call(A a, B b, C c)
142 var node = delegates.First;