Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PartDataManagementSetup"/> class.
        /// </summary>
        public PartDataManagementSetup()
        {
            _Logger.EnteringMethodPart(nameof(PartDataManagementSetup));
            //Compose external parts
            IServiceLocator _serviceLocator = ServiceLocator.Current;

            //string _configurationFileName = _serviceLocator.GetInstance<string>(CompositionSettings.ConfigurationFileNameContract);
            m_ViewModel     = _serviceLocator.GetInstance <ProducerViewModel>();
            EncodingFactory = _serviceLocator.GetInstance <IEncodingFactory>();
            _Logger.Composed(nameof(EncodingFactory), EncodingFactory.GetType().FullName);
            MessageHandlerFactory = _serviceLocator.GetInstance <IMessageHandlerFactory>();
            _Logger.Composed(nameof(MessageHandlerFactory), MessageHandlerFactory.GetType().FullName);
            //compose internal parts
            ConfigurationFactory = new PartConfigurationFactory(ConfigurationFilePath);
            PartBindingFactory pbf = new PartBindingFactory();

            _DTOProvider   = pbf;
            BindingFactory = pbf;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggerManagementSetup"/> class.
        /// </summary>
        public LoggerManagementSetup()
        {
            _logger.EnteringMethodPart();
            // get external parts to compose
            IServiceLocator _serviceLocator = ServiceLocator.Current;
            string          _ConsumerConfigurationFileName = _serviceLocator.GetInstance <string>(ConsumerCompositionSettings.ConfigurationFileNameContract);

            _ViewModel = _serviceLocator.GetInstance <ConsumerViewModel>(ConsumerCompositionSettings.ViewModelContract);
            _logger.Composed(nameof(_ViewModel), _ViewModel.GetType().FullName);
            EncodingFactory = _serviceLocator.GetInstance <IEncodingFactory>();
            _logger.Composed(nameof(EncodingFactory), EncodingFactory.GetType().FullName);
            MessageHandlerFactory = _serviceLocator.GetInstance <IMessageHandlerFactory>();
            _logger.Composed(nameof(MessageHandlerFactory), MessageHandlerFactory.GetType().FullName);
            // setup local functionality
            ConfigurationFactory = new ConsumerConfigurationFactory(_ConsumerConfigurationFileName);
            _logger.Composed(nameof(ConfigurationFactory), ConfigurationFactory.GetType().FullName);
            BindingFactory = new PartIBindingFactory(_ViewModel);
            _logger.Composed(nameof(BindingFactory), BindingFactory.GetType().FullName);
        }