public OverloadableDelegateInvoker() { Type type = typeof(MemoHandler); System.Delegate d = System.Delegate.CreateDelegate(type, typeof(AddMethod), "Add"); d = System.Delegate.Combine(d, System.Delegate.CreateDelegate(type, typeof(SubMethod), "Sub")); d = System.Delegate.Combine(d, System.Delegate.CreateDelegate(type, typeof(MulMethod), "Mul")); _handler = d as MemoHandler; }
public OverloadableDelegateInvoker() { Type type = typeof(MemoHandler); Delegate d = Delegate.CreateDelegate(type, new C1(), "A"); d = Delegate.Combine(d, Delegate.CreateDelegate(type, new C2(), "S")); d = Delegate.Combine(d, Delegate.CreateDelegate(type, new C3(), "M")); handler = (MemoHandler)d; }
public OverloadableDelegateInvoker() { //Type type = typeof(MemoHandler); //Delegate d = Delegate.CreateDelegate(type, new C1(), "A"); //d = Delegate.Combine(d, Delegate.CreateDelegate(type, new C2(), "S")); //d = Delegate.Combine(d, Delegate.CreateDelegate(type, new C3(), "M")); //handler = (MemoHandler)d; handler += new C1().A; handler += new C2().S; handler += new C3().M; }