private static Action <S> CreateCallback <T>( Func <S, T> func, FooClass <T> fooChild) where T : class { return(delegate(S source) { }); }
public static void Main(string[] args) { MyClass obj = new MyClass(); int nCalls = 0; FooClass <MyClass> fooChild = FooClass <MyClass> .Create("Value", delegate { nCalls++; }); FooClass <MyClass> .Create(obj, "Child", x => x.Child, fooChild); }
public static FooClass <S> Create <T>(S source, string name, Func <S, T> func, FooClass <T> fooChild) where T : class { return(new FooClass <S>(source, name, CreateCallback(func, fooChild))); }