예제 #1
0
 private static Action <S> CreateCallback <T>(
     Func <S, T> func, FooClass <T> fooChild)
     where T : class
 {
     return(delegate(S source)
     {
     });
 }
예제 #2
0
        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);
        }
예제 #3
0
 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)));
 }