コード例 #1
0
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy <TraceManager>(() => new TraceManager());

            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();

            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy <IServerCommandHandler>(() => new ServerCommandHandler(this));

            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var newMessageBus = new Lazy <IMessageBus>(() => new MessageBus(this));

            Register(typeof(IMessageBus), () => newMessageBus.Value);

            var serializer = new Lazy <JsonNetSerializer>();

            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdPrefixGenerator = new EmptyConnectionIdPrefixGenerator();

            Register(typeof(IConnectionIdPrefixGenerator), () => connectionIdPrefixGenerator);

            var transportManager = new Lazy <TransportManager>(() => new TransportManager(this));

            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();

            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy <TransportHeartBeat>(() => new TransportHeartBeat(this));

            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy <ConnectionManager>(() => new ConnectionManager(this));

            Register(typeof(IConnectionManager), () => connectionManager.Value);

            var ackHandler = new Lazy <AckHandler>();

            Register(typeof(IAckHandler), () => ackHandler.Value);

            var perfCounterWriter = new Lazy <PerformanceCounterManager>(() => new PerformanceCounterManager());

            Register(typeof(IPerformanceCounterManager), () => perfCounterWriter.Value);
        }
コード例 #2
0
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());
            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();
            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var newMessageBus = new Lazy<IMessageBus>(() => new MessageBus(this));
            Register(typeof(IMessageBus), () => newMessageBus.Value);

            var serializer = new Lazy<JsonNetSerializer>();
            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdPrefixGenerator = new EmptyConnectionIdPrefixGenerator();
            Register(typeof(IConnectionIdPrefixGenerator), () => connectionIdPrefixGenerator);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);

            var ackHandler = new Lazy<AckHandler>();
            Register(typeof(IAckHandler), () => ackHandler.Value);

            var perfCounterWriter = new Lazy<PerformanceCounterManager>(() => new PerformanceCounterManager());
            Register(typeof(IPerformanceCounterManager), () => perfCounterWriter.Value);
        }