Esempio n. 1
0
 private FmFactoryEngine(IIoC ioc)
 {
     _ioc = ioc;
     _log = ioc.Resolve<ILogFile>();
     _sink = ioc.Resolve<IIoSink>();
     _agent = ioc.Resolve<IFunnelsAgent>();
 }
Esempio n. 2
0
 private IoThreads(IIoC ioc)
 {
     _log = ioc.Resolve<ILogFile>();
     _funnels = ioc.Resolve<IFunnelsManagerEx>();
     _config = ioc.Resolve<IFmConfigRa>();
     _pool = create_threads(_config.Config.Client.SinkThreadsCount);
 }
Esempio n. 3
0
        /// <summary>
        ///     Creates an instance of type T. Any interface dependencies will be replaced with mocks.
        /// </summary>
        /// <typeparam name="T">The type to create.</typeparam>
        /// <returns>An instance of T.</returns>
        public virtual T Create <T>()
        {
            ResolveType = typeof(T);
            var result = ioc.Resolve <T>();

            ResolveType = null;
            return(result);
        }
Esempio n. 4
0
 private RemoteDispatcher(string myself, IIoC ioc)
 {
     _myself = myself;
     _counters = new Counters();
     _log = ioc.Resolve<ILogFile>();
     _json = ioc.Resolve<IJsonEngine>();
     _rrepo = ioc.Resolve<IRemoteRepo>();
     _messenger = ioc.Resolve<IMessengerEngine>();
 }
Esempio n. 5
0
        private FunnelsShop(StoreInfo info, IIoC ioc)
        {
            _info = info;
            _sink = ioc.Resolve<IIoSink>();
            _que = ioc.Resolve<IIoQueue>();

            _io = ioc.Resolve<IIoConnector>();
            _writer = IoWriter.New(ioc, info);
            _reader = IoReader.New(ioc, info);
        }
Esempio n. 6
0
        private SignalsAgent(IIoC ioc)
        {
            _log = ioc.Resolve<ILogFile>();
            _configRa = ioc.Resolve<ISignalsConfigRa>();
            _signals = ioc.Resolve<ISignalsManagerEx>();

            _agentUri = make_agent_uri(_configRa.Values);

            var target = wcf.SignalsAgent.New(this);
            _host = WcfHost<comm.ISignalsAgent>.NewAsync(_log, target);
        }
Esempio n. 7
0
 private void BuildThisByAskingTheContainerForIt(Type type)
 {
     try
     {
         ioc.Resolve(type);
     }
     catch
     {
         // ignored
     }
 }
Esempio n. 8
0
        private HelloPulseBeat(IIoC ioc, Config myConfig)
        {
            _myConfig = myConfig;

            _signals = ioc.Resolve<ISignalsManagerEx>();

            var configRa = ioc.Resolve<ISignalsConfigRa>();
            var config = configRa.Values;

            _log = ThrottledLog.NewSync(config.ThrottledLogTtl, ioc.Resolve<ILogFile>());

            _period = config.Client.HelloMsgPeriod;
            _timer = new Timer(pulse);
        }
Esempio n. 9
0
        private FunnelsAgent(IIoC ioc)
        {
            _log = ioc.Resolve<ILogFile>();
            _config = ioc.Resolve<IFmConfigRa>();

            var agentId = Guid.NewGuid();

            int port = find_free_port();
            var uri = _config.MakeAgentUri(agentId, port);

            _info = new AgentInfo {AgentId = agentId, Uri = uri};

            var funnels = ioc.Resolve<IFunnelsManagerEx>();

            var target = wcf.FunnelsAgent.New(funnels);
            _host = WcfHost<comm.IFunnelsAgent>.NewAsync(_log, target);
        }
Esempio n. 10
0
        private MessengerEngine(IIoC ioc)
        {
            _msg2failureHandler = new Dictionary<Type, Action<comm.IoMsg>> {
                {typeof(comm.PublishMsg), msg => update_failure_counters((comm.PublishMsg) msg)},
                {typeof(comm.FilterInfo), msg => update_failure_counters((comm.FilterInfo) msg)},
                {typeof(comm.TopicFilterMsg), msg => update_failure_counters((comm.TopicFilterMsg) msg)},
                {typeof(comm.HeartbeatMsg), msg => update_failure_counters((comm.HeartbeatMsg) msg)}
            };

            _counters = new Counters();
            _configRa = ioc.Resolve<ISignalsConfigRa>();

            var config = _configRa.Values;
            _cachedConfig = config;
            _log = ThrottledLog.NewSync(config.ThrottledLogTtl, ioc.Resolve<ILogFile>());

            _hubUri = _configRa.MakeHubUri();
            _connector = ioc.Resolve<IAgentConnector>();
            _agents = AgentsRepo.NewSync();
        }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static async Task Main()
        {
            SetupInversionOfControl();

            DatabaseExporterWindowsService service = _ioc.Resolve <DatabaseExporterWindowsService>();

            if (Environment.UserInteractive)
            {
                await service.StartServiceAsync(Enumerable.Empty <string>().ToArray());

                Console.WriteLine("Press any key to exit...");

                Console.ReadKey();
            }
            else
            {
                ServiceBase.Run(service);
            }
        }
        static void Main(string[] args)
        {
            SetupInversionOfControl();
            var encryptor = _ioc.Resolve <RsaCertificateEncryptor>();

            var arg = args.FirstOrDefault();

            if (arg == null)
            {
                return;
            }

            var encrypted = encryptor.Encrypt(arg);

            Clipboard.SetText(encrypted);

            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);

            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine(encrypted);

            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Code copied to clipboard !!!");
            Console.ResetColor();

            Console.WriteLine(string.Empty);
            Console.WriteLine(string.Empty);
        }
Esempio n. 13
0
 private AgentConnector(IIoC ioc)
 {
     _counters = new Counters();
     _log = ioc.Resolve<ILogFile>();
 }
Esempio n. 14
0
 private void RegisterThisMockWithAutoMoq(Type type, Mock mock)
 {
     _ioc.Resolve <AutoMoqer>().SetMock(type, mock);
 }
Esempio n. 15
0
 private AgentsEngine(IIoC ioc)
 {
     _log = ioc.Resolve<ILogFile>();
     _repo = ioc.Resolve<IHubRepo>();
     _messenger = ioc.Resolve<IMessengerEngine>();
 }
Esempio n. 16
0
 protected ConductorViewModel(IIoC ioc) : this(ioc, ioc.Resolve <IWindowManager>())
 {
 }
Esempio n. 17
0
 private JsonEngine(IIoC ioc)
 {
     _log = ioc.Resolve<ILogFile>();
 }
 public PartInvoiceController(IIoC ioc)
 {
     __CustomerRepositoryDB     = ioc.Resolve <ICustomerRepositoryDB>();
     __PartInvoiceRepositoryDB  = ioc.Resolve <IPartInvoiceRepositoryDB>();
     __IPartAvailabilityService = ioc.Resolve <Services.PartAvailabilityService.IPartAvailabilityService>();
 }
Esempio n. 19
0
 private IoWriter(IIoC ioc, StoreInfo info)
 {
     _log = ioc.Resolve<ILogFile>();
     _io = ioc.Resolve<IIoConnector>();
     _info = info;
 }
Esempio n. 20
0
 protected ScreenViewModel(IIoC ioc) : this(ioc, ioc.Resolve <IWindowManager>())
 {
 }
Esempio n. 21
0
 private FunnelsResolver(IIoC ioc)
 {
     _log = ioc.Resolve<ILogFile>();
 }
Esempio n. 22
0
 protected ConductorViewModel(IIoC ioc, IWindowManager windowManager) : this(ioc, windowManager, ioc.Resolve <IMessageBus>(), ioc.Resolve <ILogger>())
 {
 }
Esempio n. 23
0
 private LocalDispatcher(IIoC ioc)
 {
     _counters = new Counters();
     _log = ioc.Resolve<ILogFile>();
     _lrepo = ioc.Resolve<ILocalRepo>();
 }
Esempio n. 24
0
File: IoSink.cs Progetto: Kidify/L4p
 private IoSink(IIoC ioc)
 {
     _log = ioc.Resolve<ILogFile>();
     _que = ioc.Resolve<IIoQueue>();
     _counters = new Counters();
 }