コード例 #1
0
        public static void ClosedDelegateForProperty()
        {
            var d = DelegateHelpers.CreateClosedDelegateFactory <Func <int> >(() => "".Length).Invoke("abcd");

            Equal(4, d());
        }
コード例 #2
0
        public static void ClosedDelegate()
        {
            var d = DelegateHelpers.CreateClosedDelegateFactory <Func <char, int, int> >((ch, startIndex) => "".IndexOf(ch, startIndex)).Invoke("abc");

            Equal(1, d('b', 0));
        }