本文整理汇总了C#中IDependencyResolver类的典型用法代码示例。如果您正苦于以下问题:C# IDependencyResolver类的具体用法?C# IDependencyResolver怎么用?C# IDependencyResolver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDependencyResolver类属于命名空间,在下文中一共展示了IDependencyResolver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RabbitMQMessageBus
public RabbitMQMessageBus(IDependencyResolver resolver, string rabbitMqExchangeName, IModel rabbitMqChannel) : base(resolver)
{
_rabbitmqchannel = rabbitMqChannel;
_rabbitmqExchangeName = rabbitMqExchangeName;
EnsureConnection();
}
示例2: Dispatcher
public Dispatcher(IDependencyResolver dependencyResolver,
IJobCoordinator jobCoordinator, IErrorHandlingPolicy errorHandlingPolicy,
IMethodBinder methodBinder,
IEventStream eventStream,
IRecoverableAction recoverableAction,
IStatusChanger statusChanger,
IContinuationLiveness continuationLiveness,
IExceptionFilterDispatcher exceptionFilterDispatcher,
IJobRootValidator jobRootValidator)
{
if (jobCoordinator == null) throw new ArgumentNullException("jobCoordinator");
if (dependencyResolver == null) throw new ArgumentNullException("dependencyResolver");
if (errorHandlingPolicy == null) throw new ArgumentNullException("errorHandlingPolicy");
if (methodBinder == null) throw new ArgumentNullException("methodBinder");
if (eventStream == null) throw new ArgumentNullException("eventStream");
if (recoverableAction == null) throw new ArgumentNullException("recoverableAction");
if (statusChanger == null) throw new ArgumentNullException("statusChanger");
if (continuationLiveness == null) throw new ArgumentNullException("continuationLiveness");
if (exceptionFilterDispatcher == null) throw new ArgumentNullException("exceptionFilterDispatcher");
if (jobRootValidator == null) throw new ArgumentNullException("jobRootValidator");
_jobCoordinator = jobCoordinator;
_dependencyResolver = dependencyResolver;
_errorHandlingPolicy = errorHandlingPolicy;
_methodBinder = methodBinder;
_eventStream = eventStream;
_recoverableAction = recoverableAction;
_statusChanger = statusChanger;
_continuationLiveness = continuationLiveness;
_exceptionFilterDispatcher = exceptionFilterDispatcher;
_jobRootValidator = jobRootValidator;
}
示例3: HubDispatcherRouteHandler
public HubDispatcherRouteHandler(string url, IDependencyResolver resolver)
{
_url = VirtualPathUtility.ToAbsolute(url);
overrideUrlWithPublished();
_resolver = resolver;
}
示例4: UseMessageBus
protected void UseMessageBus(MessageBusType type, IDependencyResolver resolver, int streams = 1)
{
IMessageBus bus = null;
switch (type)
{
case MessageBusType.Default:
break;
case MessageBusType.Fake:
case MessageBusType.FakeMultiStream:
bus = new FakeScaleoutBus(resolver, streams);
break;
case MessageBusType.SqlServer:
break;
case MessageBusType.ServiceBus:
break;
case MessageBusType.Redis:
break;
default:
break;
}
if (bus != null)
{
resolver.Register(typeof(IMessageBus), () => bus);
}
}
示例5: ForeverTransport
public ForeverTransport(HostContext context, IDependencyResolver resolver)
: this(context,
resolver.Resolve<IJsonSerializer>(),
resolver.Resolve<ITransportHeartBeat>(),
resolver.Resolve<IPerformanceCounterManager>())
{
}
示例6: MessageBus
/// <summary>
///
/// </summary>
/// <param name="resolver"></param>
public MessageBus(IDependencyResolver resolver)
: this(resolver.Resolve<IStringMinifier>(),
resolver.Resolve<ITraceManager>(),
resolver.Resolve<IPerformanceCounterManager>(),
resolver.Resolve<IConfigurationManager>())
{
}
示例7: PersistentConnectionHandler
public PersistentConnectionHandler(AppFunc app, string path, Type connectionType, IDependencyResolver resolver)
{
_app = app;
_path = path;
_connectionType = connectionType;
_resolver = resolver;
}
示例8: AddDependencyResolver
/// <summary>
/// Registers a dependency resolver with a given actor system.
/// </summary>
/// <param name="system">The actor system in which to register the given dependency resolver.</param>
/// <param name="dependencyResolver">The dependency resolver being registered to the actor system.</param>
/// <exception cref="ArgumentNullException">
/// Either the <paramref name="system"/> or the <paramref name="dependencyResolver"/> was null.
/// </exception>
public static void AddDependencyResolver(this ActorSystem system, IDependencyResolver dependencyResolver)
{
if (system == null) throw new ArgumentNullException("system");
if (dependencyResolver == null) throw new ArgumentNullException("dependencyResolver");
system.RegisterExtension(DIExtension.DIExtensionProvider);
DIExtension.DIExtensionProvider.Get(system).Initialize(dependencyResolver);
}
示例9: UnityBasedDependencyResolver
public UnityBasedDependencyResolver(
IDependencyResolver baseResolver,
IUnityContainer unityContainer)
{
_baseResolver = baseResolver;
_unityContainer = unityContainer;
}
示例10: ServerCommandHandler
public ServerCommandHandler(IDependencyResolver resolver) :
this(resolver.Resolve<IMessageBus>(),
resolver.Resolve<IServerIdManager>(),
resolver.Resolve<JsonSerializer>())
{
}
示例11: ApplicationOAuthProvider
public ApplicationOAuthProvider(string publicClientId, IDependencyResolver dependencyResolver)
{
Requires.NotNull(dependencyResolver, "dependencyResolver");
_dependencyResolver = dependencyResolver;
_publicClientId = publicClientId;
}
示例12: ConfiguradorDeDependencias
public ConfiguradorDeDependencias(IDependencyResolver container)
{
this.container = container;
repositorioFactory = new RepositorioFactory(GerenciadorSinais.CaminhoDoArquivoDoRepositorio);
caracteristicasFactory = new CaracteristicasFactory();
algoritmoFactory = new AlgoritmoClassificacaoSinalFactory(caracteristicasFactory);
}
示例13: LongPollingTransport
public LongPollingTransport(HostContext context, IDependencyResolver resolver)
: this(context,
resolver.Resolve<IJsonSerializer>(),
resolver.Resolve<ITransportHeartBeat>(),
resolver.Resolve<IPerformanceCounterWriter>())
{
}
示例14: DefaultViewPageActivator
public DefaultViewPageActivator(IDependencyResolver resolver)
{
if (resolver == null)
_resolverThunk = () => DependencyResolver.Current;
else
_resolverThunk = () => resolver;
}
示例15: RedisMessageBus
internal RedisMessageBus(IDependencyResolver resolver, RedisScaleoutConfiguration configuration, IRedisConnection connection, bool connectAutomatically)
: base(resolver, configuration)
{
if (configuration == null)
{
throw new ArgumentNullException("configuration");
}
_connection = connection;
_connectionString = configuration.ConnectionString;
_db = configuration.Database;
_key = configuration.EventKey;
var traceManager = resolver.Resolve<ITraceManager>();
_trace = traceManager["SignalR." + typeof(RedisMessageBus).Name];
ReconnectDelay = TimeSpan.FromSeconds(2);
if (connectAutomatically)
{
ThreadPool.QueueUserWorkItem(_ =>
{
var ignore = ConnectWithRetry();
});
}
}