Ejemplo n.º 1
0
 public void Build(IComponentProvider builder)
 {
     builder
     .RegisterSingleton <IMainView, MainWindow>()
     .RegisterTransient <ITransientFormView, TransientWindow>()
     .RegisterSingleton <ISingletonFormView, SingletonWindow>()
     .RegisterTransient <IMainWindowEventBinder, MainWindowEventBinder>();
 }
Ejemplo n.º 2
0
        public void Build(IComponentProvider builder)
        {
            builder.RegisterSingleton <IEventAggregatorWrapper, EventAggregatorWrapper>();


            var controller = builder.Resolve <IAppController>();
            var aggregator = builder.Resolve <IEventAggregatorWrapper>();

            controller.GetType()
            .GetProperty(nameof(controller.Aggregator))
            .SetValue(controller, aggregator);
        }
Ejemplo n.º 3
0
        public static (IAppController, IEventAggregatorWrapper) BindMocksForMvp(this IComponentProvider builder)
        {
            if (!builder.IsRegistered <IEventAggregatorWrapper>())
            {
                builder.RegisterSingleton <IEventAggregatorWrapper, EventAggregatorWrapper>();
            }

            var controller = builder.Resolve <IAppController>();
            var aggregator = builder.Resolve <IEventAggregatorWrapper>();

            controller.GetType().GetProperty(nameof(controller.Aggregator))
            .SetValue(controller, aggregator);

            return(controller, aggregator);
        }
Ejemplo n.º 4
0
 public void Build(IComponentProvider builder)
 {
     builder
     .RegisterSingleton <IAppSettings, AppSettings>()
     .RegisterTransient <IConvolutionFactory, ConvolutionFactory>()
     .RegisterTransient <IMorphologyFactory, MorphologyFactory>()
     .RegisterTransient <IStructuringElementFactory, StructuringElementFactory>()
     .RegisterTransient <IDistributionFactory, DistributionFactory>()
     .RegisterTransient <IRgbFilterFactory, RgbFilterFactory>()
     .RegisterTransient <IScalingFactory, ScalingFactory>()
     .RegisterTransient <IColorMatrixFactory, ColorMatrixFactory>()
     .RegisterTransient <IRecommendationFactory, RecommendationFactory>()
     .RegisterTransient <IChannelFactory, ChannelFactory>()
     .RegisterTransient <IRotationFactory, RotationFactory>()
     .RegisterTransient <ITransformationFactory, TransformationFactory>()
     .RegisterSingleton <IAwaitablePipeline, AwaitablePipeline>()
     .RegisterSingleton <IStaTaskService, StaTaskService>()
     .RegisterSingleton <ICacheService <Bitmap>, CacheService <Bitmap> >()
     .RegisterTransient <IConvolutionService, ConvolutionService>()
     .RegisterTransient <IMorphologyService, MorphologyService>()
     .RegisterTransient <IBitmapService, BitmapService>()
     .RegisterTransient <IRandomVariableService, RandomVariableService>()
     .RegisterTransient <IBitmapLuminanceService, BitmapLuminanceService>()
     .RegisterTransient <IFileDialogService, FileDialogService>()
     .RegisterTransient <INonBlockDialogService, NonBlockDialogService>()
     .RegisterTransient <IColorMatrixService, ColorMatrixService>()
     .RegisterTransient <IAsyncOperationLocker, AsyncOperationLocker>()
     .RegisterTransient <IConvolutionProvider, ConvolutionProvider>()
     .RegisterTransient <IMorphologyProvider, MorphologyProvider>()
     .RegisterTransient <IBitmapLuminanceProvider, BitmapLuminanceProvider>()
     .RegisterTransient <IRgbProvider, RgbProvider>()
     .RegisterTransient <IScalingProvider, ScalingProvider>()
     .RegisterTransient <IRotationProvider, RotationProvider>()
     .RegisterTransient <ITransformationProvider, TransformationProvider>()
     .RegisterTransient <IChartSeriesBuilder, ChartSeriesBuilder>()
     .RegisterTransient <IQualityMeasureService, QualityMeasureService>()
     .RegisterTransient <IHistogramService, HistogramService>()
     .RegisterTransient <IBitmapLuminanceVisitableFactory, BitmapLuminanceVisitableFactory>()
     .RegisterTransient <IBitmapLuminanceVisitor, BitmapLuminanceVisitor>()
     .RegisterTransient <IConvolutionVisitor, ConvolutionVisitor>()
     .RegisterTransient <ICovolutionVisitableFactory, ConvolutionVisitableFactory>()
     .RegisterTransient <IHistogramVisitor, HistogramVisitor>()
     .RegisterTransient <IHistogramVisitableFactory, HistogramVisitableFactory>();
 }
Ejemplo n.º 5
0
        public void Build(IComponentProvider builder)
        {
            new MicrokernelStartup().Build(builder);

            builder
            .RegisterSingleton <IAppSettings, AppSettings>()
            .RegisterTransient <IConvolutionFactory, ConvolutionFactory>()
            .RegisterTransient <IMorphologyFactory, MorphologyFactory>()
            .RegisterTransient <IStructuringElementFactory, StructuringElementFactory>()
            .RegisterTransient <IDistributionFactory, DistributionFactory>()
            .RegisterTransient <IRgbFilterFactory, RgbFilterFactory>()
            .RegisterTransient <IScalingFactory, ScalingFactory>()
            .RegisterTransient <IColorMatrixFactory, ColorMatrixFactory>()
            .RegisterTransient <IRecommendationFactory, RecommendationFactory>()
            .RegisterTransient <IChannelFactory, ChannelFactory>()
            .RegisterTransient <IRotationFactory, RotationFactory>()
            .RegisterTransient <ITransformationFactory, TransformationFactory>();

            var colorMatrix    = Substitute.ForPartsOf <ColorMatrixFactoryWrapper>(builder.Resolve <IColorMatrixFactory>());
            var convolution    = Substitute.ForPartsOf <ConvoltuionFactoryWrapper>(builder.Resolve <IConvolutionFactory>());
            var distribution   = Substitute.ForPartsOf <DistributionFactoryWrapper>(builder.Resolve <IDistributionFactory>());
            var morphology     = Substitute.ForPartsOf <MorphologyFactoryWrapper>(builder.Resolve <IMorphologyFactory>());
            var rgb            = Substitute.ForPartsOf <RgbFactoryWrapper>(builder.Resolve <IRgbFilterFactory>());
            var rotation       = Substitute.ForPartsOf <RotationFactoryWrapper>(builder.Resolve <IRotationFactory>());
            var scaling        = Substitute.ForPartsOf <ScalingFactoryWrapper>(builder.Resolve <IScalingFactory>());
            var transformation = Substitute.ForPartsOf <TransformationFactoryWrapper>(builder.Resolve <ITransformationFactory>());

            builder
            .RegisterTransientInstance <IColorMatrixFactoryWrapper>(colorMatrix)
            .RegisterTransientInstance <IConvolutionFactoryWrapper>(convolution)
            .RegisterTransientInstance <IDistributionFactoryWrapper>(distribution)
            .RegisterTransientInstance <IMorphologyFactoryWrapper>(morphology)
            .RegisterTransientInstance <IRgbFactoryWrapper>(rgb)
            .RegisterTransientInstance <IRotationFactoryWrapper>(rotation)
            .RegisterTransientInstance <IScalingFactoryWrapper>(scaling)
            .RegisterTransientInstance <ITransformationFactoryWrapper>(transformation);
        }
Ejemplo n.º 6
0
 public void Build(IComponentProvider builder)
 {
     builder
     .RegisterSingleton <IMainView, MainForm>();
 }