Exemplo n.º 1
0
        public Bootstrapper(
            IAppIocContainerProvider[] appIocContainerProviders,
            //IAppServiceDiscoveryFromCodeMarkup appServiceDiscoveryFromCodeMarkup,
            //IAppServiceRegistrationInfoExtractor appServiceRegistrationInfoExtractor,
            //IAppServiceDiscoveryFromRuntimeCollection appServiceDiscoveryFromRuntimeCollection,
            IServiceRegistry serviceRegistry,
            AppServiceIocContainerProxy.Holder appIocContainerHolder,
            IServiceProxyBuilder serviceProxyBuilder,
            IFabric[] registeredFabrics,
            ICurrentFabric currentFabricHolder,
            IServicePublisher[] servicePublishers,
            IServiceRegistryUpdaterViaDiscovery serviceRegistryUpdaterViaDiscovery)
        {
            _appIocContainerProviders = appIocContainerProviders;
            //_appServiceDiscoveryFromCodeMarkup = appServiceDiscoveryFromCodeMarkup;
            //_appServiceRegistrationInfoExtractor = appServiceRegistrationInfoExtractor;
            //_appServiceDiscoveryFromRuntimeCollection = appServiceDiscoveryFromRuntimeCollection;
            _serviceRegistry       = serviceRegistry;
            _appIocContainerHolder = appIocContainerHolder;
            _serviceProxyBuilder   = serviceProxyBuilder;

            if (registeredFabrics.Length > 1)
            {
                throw new InvalidOperationException("Multi-fabric is not supported.");
            }

            if (registeredFabrics.Length == 1)
            {
                _fabric = registeredFabrics[0];
                ((ICurrentFabricSetter)currentFabricHolder).SetInstance(_fabric);
            }

            _servicePublishers = servicePublishers;
            _serviceRegistryUpdaterViaDiscovery = serviceRegistryUpdaterViaDiscovery;
        }
Exemplo n.º 2
0
        public static void Initialize(this IFabric fabric, Context context)
        {
            if (_initialized)
            {
                return;
            }
            lock (InitializeLock)
            {
                if (_initialized)
                {
                    return;
                }

                var instance = fabric as Fabric;

                if (instance == null)
                {
                    return;
                }

                instance.Initialize(context);

                _initialized = true;
            }
        }
 /// <summary>
 ///   Initializes a new instance of the <see cref = "AutoMockingContainer{TTargetClass}" /> class.
 /// </summary>
 public AutoMockingContainer()
 {
     _fabric         = FrameworkConfig.BuildFabric();
     _mockingEngine  = FrameworkConfig.MockingEngine;
     _serviceLocator = this;
     _container      = new AutoMockedContainer(this);
 }
Exemplo n.º 4
0
 private void _anglesNumber_ValueChanged(object sender, EventArgs e)
 {
     if (_figure is NanglesFigure)
     {
         fabrica = new NanglesIFabric((int)_anglesNumber.Value);
         _figure = fabrica.CreateFigure(_pen);
     }
 }
Exemplo n.º 5
0
 private void Form1_Load(object sender, EventArgs e)
 {
     canvas = new Canvas(pictureBox1.Width, pictureBox1.Height);
     // _figure = new MyBrush();
     _figure     = new RectangleFigure(_pen);
     fabrica     = new RectangleIFabric();
     figuresList = new List <IFigure>();
 }
Exemplo n.º 6
0
        public MainApplication(IEventHandler eventHandler, IUserSessionHandler userSessionHandler, IFabric <ITravelEvent> eventFabric,
                               IFabric <Travel> travelFabric, ILocationHandler locationHandler, INetworkDataHandler networkDataHandler, IFormatsHandler formatsHandler)

        {
            EventHandler       = eventHandler;
            UserSessionHandler = userSessionHandler;
            EventFabric        = eventFabric;
            TravelFabric       = travelFabric;
            LocationHandler    = locationHandler;
            FormatsHandler     = formatsHandler;
            NetworkDataHandler = networkDataHandler;
        }
Exemplo n.º 7
0
 public void SetInstance(IFabric fabric) => Fabric = fabric;
Exemplo n.º 8
0
 private void IsoscelesTriangle_Click(object sender, EventArgs e)
 {
     fabrica = new IsoscelesIFabric();
     _figure = new IsoscelesTriangle(_pen);
     radioButtonPaintMode.Checked = true;
 }
Exemplo n.º 9
0
 private void NanglesFigure_Click(object sender, EventArgs e)
 {
     // _figure = new NanglesFigure((int)_anglesNumber.Value);
     fabrica = new NanglesIFabric((int)_anglesNumber.Value);
     _figure = fabrica.CreateFigure(_pen);
 }
Exemplo n.º 10
0
 private void Ellipse_Click(object sender, EventArgs e)
 {
     fabrica = new EllipseIFabric();
     _figure = new EllipseFigure(_pen);
     radioButtonPaintMode.Checked = true;
 }
Exemplo n.º 11
0
 private void FigureND_Click(object sender, EventArgs e)
 {
     fabrica = new FigureNDIFabric();
     _figure = fabrica.CreateFigure(_pen);
     radioButtonPaintMode.Checked = true;
 }
Exemplo n.º 12
0
 private void Rectangle_2d_Click(object sender, EventArgs e)
 {
     fabrica = new RectangleIFabric();
     _figure = new RectangleFigure(_pen);
     radioButtonPaintMode.Checked = true;
 }
Exemplo n.º 13
0
 public void ChangeFabric(IFabric fabric)
 {
     Fabric = fabric;
     RenewFigure();
 }
 public JsonSerialization(IFabric <ITravelEvent> eventFabric)
 {
     this.eventFabric = eventFabric;
 }