当前位置: 首页>>代码示例>>C#>>正文


C# IDependencyResolver.Resolve方法代码示例

本文整理汇总了C#中IDependencyResolver.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# IDependencyResolver.Resolve方法的具体用法?C# IDependencyResolver.Resolve怎么用?C# IDependencyResolver.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDependencyResolver的用法示例。


在下文中一共展示了IDependencyResolver.Resolve方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WebSocketTransport

 public WebSocketTransport(HostContext context,
                           IDependencyResolver resolver)
     : this(context, 
            resolver.Resolve<IJsonSerializer>(),
            resolver.Resolve<ITransportHeartBeat>())
 {
 }
开发者ID:nairit,项目名称:SignalR,代码行数:7,代码来源:WebSocketTransport.cs

示例2: ServerCommandHandler

        public ServerCommandHandler(IDependencyResolver resolver) :
            this(resolver.Resolve<IMessageBus>(),
                 resolver.Resolve<IServerIdManager>(),
                 resolver.Resolve<JsonSerializer>())
        {

        }
开发者ID:RyanChristensen,项目名称:SignalR,代码行数:7,代码来源:ServerCommandHandler.cs

示例3: RegisterDefaultServices

        public static void RegisterDefaultServices(IDependencyResolver resolver) {
            var fileStorage = new Lazy<IFileStorage>(() => resolver.Resolve<InMemoryFileStorage>());
            resolver.Register(typeof(IFileStorage), () => fileStorage.Value);

            var exceptionlessLog = new Lazy<IExceptionlessLog>(() => resolver.Resolve<NullExceptionlessLog>());
            resolver.Register(typeof(IExceptionlessLog), () => exceptionlessLog.Value);

            var jsonSerializer = new Lazy<IJsonSerializer>(() => resolver.Resolve<DefaultJsonSerializer>());
            resolver.Register(typeof(IJsonSerializer), () => jsonSerializer.Value);

            var eventQueue = new Lazy<IEventQueue>(() => resolver.Resolve<DefaultEventQueue>());
            resolver.Register(typeof(IEventQueue), () => eventQueue.Value);

            var submissionClient = new Lazy<ISubmissionClient>(() => resolver.Resolve<DefaultSubmissionClient>());
            resolver.Register(typeof(ISubmissionClient), () => submissionClient.Value);

            var environmentInfoCollector = new Lazy<IEnvironmentInfoCollector>(() => resolver.Resolve<DefaultEnvironmentInfoCollector>());
            resolver.Register(typeof(IEnvironmentInfoCollector), () => environmentInfoCollector.Value);

            var lastClientIdManager = new Lazy<ILastReferenceIdManager>(() => resolver.Resolve<DefaultLastReferenceIdManager>());
            resolver.Register(typeof(ILastReferenceIdManager), () => lastClientIdManager.Value);

            var duplicateChecker = new Lazy<IDuplicateChecker>(() => resolver.Resolve<DefaultDuplicateChecker>());
            resolver.Register(typeof(IDuplicateChecker), () => duplicateChecker.Value);

            var persistedClientData = new Lazy<PersistedDictionary>(() => new PersistedDictionary("client-data.json", resolver.Resolve<IFileStorage>(), resolver.Resolve<IJsonSerializer>()));
            resolver.Register(typeof(PersistedDictionary), () => persistedClientData.Value);
        }
开发者ID:BookSwapSteve,项目名称:Exceptionless,代码行数:28,代码来源:DependencyResolver.cs

示例4: DefaultContractsGenerator

 public DefaultContractsGenerator(IDependencyResolver resolver)
     : this(resolver.Resolve<IJsonSerializer>(),
            resolver.Resolve<IPayloadDescriptorProvider>(),
            resolver.Resolve<IMethodDescriptorProvider>(),
            resolver.Resolve<IHubDescriptorProvider>())
 {
 }
开发者ID:NTaylorMullen,项目名称:SignalR.Compression,代码行数:7,代码来源:DefaultContractsGenerator.cs

示例5: Initialize

        public virtual void Initialize(IDependencyResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (_initialized)
            {
                return;
            }

            MessageBus = resolver.Resolve<IMessageBus>();
            JsonSerializer = resolver.Resolve<JsonSerializer>();
            TraceManager = resolver.Resolve<ITraceManager>();
            Counters = resolver.Resolve<IPerformanceCounterManager>();
            AckHandler = resolver.Resolve<IAckHandler>();
            ProtectedData = resolver.Resolve<IProtectedData>();
            UserIdProvider = resolver.Resolve<IUserIdProvider>();

            _configurationManager = resolver.Resolve<IConfigurationManager>();
            _transportManager = resolver.Resolve<ITransportManager>();
            _serverMessageHandler = resolver.Resolve<IServerCommandHandler>();

            _initialized = true;
        }
开发者ID:nirmana,项目名称:SignalR,代码行数:26,代码来源:PersistentConnection.cs

示例6: Initialize

        public virtual void Initialize(IDependencyResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver");
            }

            if (_initialized)
            {
                return;
            }

            MessageBus = resolver.Resolve<IMessageBus>();
            JsonSerializer = resolver.Resolve<JsonSerializer>();
            TraceManager = resolver.Resolve<ITraceManager>();
            Counters = resolver.Resolve<IPerformanceCounterManager>();
            AckHandler = resolver.Resolve<IAckHandler>();
            ProtectedData = resolver.Resolve<IProtectedData>();
            UserIdProvider = resolver.Resolve<IUserIdProvider>();

            _configurationManager = resolver.Resolve<IConfigurationManager>();
            _transportManager = resolver.Resolve<ITransportManager>();

            // Ensure that this server is listening for any ACKs sent over the bus.
            resolver.Resolve<AckSubscriber>();

            _initialized = true;
        }
开发者ID:ZixiangBoy,项目名称:SignalR-1,代码行数:28,代码来源:PersistentConnection.cs

示例7: MessageBus

 /// <summary>
 /// 
 /// </summary>
 /// <param name="resolver"></param>
 public MessageBus(IDependencyResolver resolver)
     : this(resolver.Resolve<IStringMinifier>(),
            resolver.Resolve<ITraceManager>(),
            resolver.Resolve<IPerformanceCounterManager>(),
            resolver.Resolve<IConfigurationManager>())
 {
 }
开发者ID:rustd,项目名称:SignalR,代码行数:11,代码来源:MessageBus.cs

示例8: LongPollingTransport

 public LongPollingTransport(HostContext context, IDependencyResolver resolver)
     : this(context,
            resolver.Resolve<IJsonSerializer>(),
            resolver.Resolve<ITransportHeartBeat>(),
            resolver.Resolve<IPerformanceCounterWriter>())
 {
 }
开发者ID:khushal999p,项目名称:SignalR,代码行数:7,代码来源:LongPollingTransport.cs

示例9: ForeverTransport

 public ForeverTransport(HostContext context, IDependencyResolver resolver)
     : this(context,
            resolver.Resolve<IJsonSerializer>(),
            resolver.Resolve<ITransportHeartBeat>(),
            resolver.Resolve<IPerformanceCounterManager>())
 {
 }
开发者ID:nonintanon,项目名称:SignalR,代码行数:7,代码来源:ForeverTransport.cs

示例10: MessageBus

 /// <summary>
 /// 
 /// </summary>
 /// <param name="resolver"></param>
 public MessageBus(IDependencyResolver resolver)
     : this(resolver.Resolve<IStringMinifier>(),
            resolver.Resolve<ITraceManager>(),
            resolver.Resolve<IPerformanceCounterManager>(),
            resolver.Resolve<IConfigurationManager>(),
            DefaultMaxTopicsWithNoSubscriptions)
 {
 }
开发者ID:stirno,项目名称:SignalR,代码行数:12,代码来源:MessageBus.cs

示例11: WebSocketTransport

 public WebSocketTransport(HostContext context,
                           IDependencyResolver resolver)
     : this(context,
            resolver.Resolve<JsonSerializer>(),
            resolver.Resolve<ITransportHeartbeat>(),
            resolver.Resolve<IPerformanceCounterManager>(),
            resolver.Resolve<ITraceManager>())
 {
 }
开发者ID:nirmana,项目名称:SignalR,代码行数:9,代码来源:WebSocketTransport.cs

示例12: ForeverTransport

 protected ForeverTransport(HostContext context, IDependencyResolver resolver)
     : this(context,
            resolver.Resolve<JsonSerializer>(),
            resolver.Resolve<ITransportHeartbeat>(),
            resolver.Resolve<IPerformanceCounterManager>(),
            resolver.Resolve<ITraceManager>(),
            resolver.Resolve<IMemoryPool>())
 {
 }
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:9,代码来源:ForeverTransport.cs

示例13: LongPollingTransport

        public LongPollingTransport(HostContext context, IDependencyResolver resolver)
            : this(context,
                   resolver.Resolve<JsonSerializer>(),
                   resolver.Resolve<ITransportHeartbeat>(),
                   resolver.Resolve<IPerformanceCounterManager>(),
                   resolver.Resolve<ITraceManager>(),
                   resolver.Resolve<IConfigurationManager>())
        {

        }
开发者ID:GaneshBachhao,项目名称:SignalR,代码行数:10,代码来源:LongPollingTransport.cs

示例14: WebSocketTransport

 public WebSocketTransport(HostContext context,
                           IDependencyResolver resolver)
     : this(context,
            resolver.Resolve<JsonSerializer>(),
            resolver.Resolve<ITransportHeartbeat>(),
            resolver.Resolve<IPerformanceCounterManager>(),
            resolver.Resolve<ITraceManager>(),
            resolver.Resolve<IConfigurationManager>().MaxIncomingWebSocketMessageSize)
 {
 }
开发者ID:ZixiangBoy,项目名称:SignalR-1,代码行数:10,代码来源:WebSocketTransport.cs

示例15: ScaleoutMessageBus

        protected ScaleoutMessageBus(IDependencyResolver resolver, ScaleoutConfiguration configuration)
            : base(resolver)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            var traceManager = resolver.Resolve<ITraceManager>();
            _trace = traceManager["SignalR." + typeof(ScaleoutMessageBus).Name];
            _perfCounters = resolver.Resolve<IPerformanceCounterManager>();
            _streamManager = new Lazy<ScaleoutStreamManager>(() => new ScaleoutStreamManager(Send, OnReceivedCore, StreamCount, _trace, _perfCounters, configuration));
        }
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:13,代码来源:ScaleoutMessageBus.cs


注:本文中的IDependencyResolver.Resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。