本文整理汇总了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>())
{
}
示例2: ServerCommandHandler
public ServerCommandHandler(IDependencyResolver resolver) :
this(resolver.Resolve<IMessageBus>(),
resolver.Resolve<IServerIdManager>(),
resolver.Resolve<JsonSerializer>())
{
}
示例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);
}
示例4: DefaultContractsGenerator
public DefaultContractsGenerator(IDependencyResolver resolver)
: this(resolver.Resolve<IJsonSerializer>(),
resolver.Resolve<IPayloadDescriptorProvider>(),
resolver.Resolve<IMethodDescriptorProvider>(),
resolver.Resolve<IHubDescriptorProvider>())
{
}
示例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;
}
示例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;
}
示例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>())
{
}
示例8: LongPollingTransport
public LongPollingTransport(HostContext context, IDependencyResolver resolver)
: this(context,
resolver.Resolve<IJsonSerializer>(),
resolver.Resolve<ITransportHeartBeat>(),
resolver.Resolve<IPerformanceCounterWriter>())
{
}
示例9: ForeverTransport
public ForeverTransport(HostContext context, IDependencyResolver resolver)
: this(context,
resolver.Resolve<IJsonSerializer>(),
resolver.Resolve<ITransportHeartBeat>(),
resolver.Resolve<IPerformanceCounterManager>())
{
}
示例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)
{
}
示例11: WebSocketTransport
public WebSocketTransport(HostContext context,
IDependencyResolver resolver)
: this(context,
resolver.Resolve<JsonSerializer>(),
resolver.Resolve<ITransportHeartbeat>(),
resolver.Resolve<IPerformanceCounterManager>(),
resolver.Resolve<ITraceManager>())
{
}
示例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>())
{
}
示例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>())
{
}
示例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)
{
}
示例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));
}