protected override void Map(ICompositeBuilder <IPropertyInterface, IPropertyState> builder) { builder.MapMethod(typeof(IPropertyInterface).GetProperty("Text").GetGetMethod(), GetType().GetMethod("GetTextImpl")); builder.MapMethod(typeof(IPropertyInterface).GetProperty("Text").GetSetMethod(), GetType().GetMethod("SetTextImpl")); builder.MapMethod(typeof(IPropertyInterface).GetProperty("SetOnly").GetSetMethod(), GetType().GetMethod("SetOnlyImpl")); builder.MapMethod(typeof(IPropertyInterface).GetProperty("GetOnly").GetGetMethod(), GetType().GetMethod("GetOnlyImpl")); }
protected override void Map(ICompositeBuilder <ISimpleInterface, INoState> builder) { builder.MapMethod(typeof(ISimpleInterface).GetMethod("Foo"), GetType().GetMethod("FooImpl")); if (!_incomplete) { builder.MapMethod(typeof(ISimpleInterface).GetMethod("Bar"), GetType().GetMethod("BarImpl")); builder.MapMethod(typeof(ISimpleInterface).GetMethod("Baz"), GetType().GetMethod("BazImpl")); } }
protected override void Map(ICompositeBuilder <IMappingExtensionsSample, INoState> builder) { builder.MapMethods() .For(x => x.Action0).Use(Action0Impl) .For <string>(x => x.Action1).Use(Action1Impl) .For <int, string>(x => x.Action2).Use(Action2Impl) .For <int>(x => x.Method0).Use(ctx => 2) .For <int, string>(x => x.Method1).Use(Method1Impl) .For <int, double, string>(x => x.Method2).Use(Method2Impl); }
protected override void Map(ICompositeBuilder <IPropertyExtensionsSample, IPropertyExtensionsState> builder) { builder.MapProperties() .For(x => x.Text).UseStateProperty(s => s.TextState) .ForGetter(x => x.GetOnly).UseStateProperty(s => s.Value) .ForSetter <int>((x, v) => x.SetOnly = v).UseStateProperty(s => s.Value) .ForGetter(x => x.OtherText).Use(GetOtherTextImpl) .ForSetter <string>((x, v) => x.OtherText = v).Use(SetOtherTextImpl) .ForGetter(x => x.AnotherText).Use(ctx => ctx.State.AnotherTextState) .ForSetter <string>((x, v) => x.AnotherText = v).Use((ctx, value) => ctx.State.AnotherTextState = value); }
public static IMethodMapper <TInterface, IContext <TInterface, TState> > MapMethods <TInterface, TState>( this ICompositeBuilder <TInterface, TState> builder) { return(new MethodMapper <TInterface, IContext <TInterface, TState> >(builder)); }
public static IPropertyMapper <TInterface, TState> MapProperties <TInterface, TState>( this ICompositeBuilder <TInterface, TState> builder) { return(new PropertyMapper <TInterface, TState>(builder)); }
protected abstract void Map(ICompositeBuilder <TInterface, TState> builder);
protected override void Map(ICompositeBuilder <IStatefulInterface, IState> builder) { builder.MapMethod(typeof(IStatefulInterface).GetMethod("SetText"), GetType().GetMethod("SetTextImpl")); builder.MapMethod(typeof(IStatefulInterface).GetMethod("GetText"), GetType().GetMethod("GetTextImpl")); }
public MethodMapper(ICompositeBuilder compositeBuilder) { _compositeBuilder = compositeBuilder; }
public PropertyMapper(ICompositeBuilder <TInterface, TState> builder) { _builder = builder; }