예제 #1
0
        public static IAccessor <T> Apply <T, K>(this IAccessor <T> accessor, Expression <Func <IReturnableMember <T>, K> > returner, Expression <Action <IApplicableMember <K> > > actor)
        {
            if (accessor == null)
            {
                throw new NullReferenceException();
            }
            if (returner == null)
            {
                throw new ArgumentNullException("returner");
            }
            if (actor == null)
            {
                throw new ArgumentNullException("actor");
            }

            return(new AccessorImpl <T>(ApplyCore <T, K>(accessor.Expression, ReflectionBuilder.ReturnableMember <T, K>(returner), ReflectionBuilder.ApplicableMember <K>(actor))));
        }
예제 #2
0
        //public static IAccessor<T> Return<T, K>(this IAccessor<T> accessor, Expression<Action<IReturnableMember<T>>> returner, Expression<Func<IValue<T>, K>> parameter)
        //{
        //	if (accessor == null)
        //		throw new NullReferenceException();
        //	if (returner == null)
        //		throw new ArgumentNullException("returner");
        //	if (parameter == null)
        //		throw new ArgumentNullException("parameter");

        //	return new AccessorImpl<T>(ReturnCore<T, K>(accessor.Expression, ReflectionBuilder.ReturnableMember<T, K>(returner), ReflectionBuilder.GetParameter<T, K>(parameter)));
        //}

        public static IAccessor <T> Return <T, K>(this IAccessor <T> accessor, Expression <Func <IReturnableMember <T>, K> > returner, Expression <Func <IValue <T>, K> > parameter)
        {
            if (accessor == null)
            {
                throw new NullReferenceException();
            }
            if (returner == null)
            {
                throw new ArgumentNullException("returner");
            }
            if (parameter == null)
            {
                throw new ArgumentNullException("parameter");
            }

            return(new AccessorImpl <T>(ReturnCore <T, K>(accessor.Expression, ReflectionBuilder.ReturnableMember <T, K>(returner), ReflectionBuilder.GetParameter <T, K>(parameter))));
        }
예제 #3
0
 public static ICopier <T, R> Copy <T, R, K>(this ICopier <T, R> copier, Expression <Func <IReturnableMember <T>, K> > source, Expression <Func <IAssignableMember <R>, K> > target)
 {
     return(new CopierImpl <T, R>(CopyCore <T, R, K>(copier.Expression, ReflectionBuilder.ReturnableMember <T, K>(source), ReflectionBuilder.AssignableMember <R, K>(target))));
 }
예제 #4
0
 public static IConverter <T, N> Convert <T, R, N>(this IConverter <T, R> converter, Expression <Func <IReturnableMember <R>, N> > returnMember)
 {
     return(new ConverterImpl <T, N>(SelectCore(converter.Expression, ReflectionBuilder.ReturnableMember <R, N>(returnMember))));
 }
예제 #5
0
 public static IConverter <T, R> Convert <T, R>(this IAccessor <T> accessor, Expression <Func <IReturnableMember <T>, R> > returnMember)
 {
     return(new ConverterImpl <T, R>(SelectCore(accessor.Expression, ReflectionBuilder.ReturnableMember <T, R>(returnMember))));
 }