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


C# IDependencyResolver类代码示例

本文整理汇总了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();
        }
开发者ID:Myslik,项目名称:SignalR.RabbitMQ,代码行数:7,代码来源:RabbitMQMessageBus.cs

示例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;
        }
开发者ID:inprotech-dev,项目名称:dependable,代码行数:32,代码来源:Dispatcher.cs

示例3: HubDispatcherRouteHandler

        public HubDispatcherRouteHandler(string url, IDependencyResolver resolver)
        {
            _url = VirtualPathUtility.ToAbsolute(url);

            overrideUrlWithPublished();
            _resolver = resolver;
        }
开发者ID:robink-teleopti,项目名称:SignalR,代码行数:7,代码来源:HubDispatcherRouteHandler.cs

示例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);
            }
        }
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:27,代码来源:HostedTest.cs

示例5: ForeverTransport

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

示例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>())
 {
 }
开发者ID:rustd,项目名称:SignalR,代码行数:11,代码来源:MessageBus.cs

示例7: PersistentConnectionHandler

 public PersistentConnectionHandler(AppFunc app, string path, Type connectionType, IDependencyResolver resolver)
 {
     _app = app;
     _path = path;
     _connectionType = connectionType;
     _resolver = resolver;
 }
开发者ID:rustd,项目名称:SignalR,代码行数:7,代码来源:PersistentConnectionHandler.cs

示例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);
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:15,代码来源:Extensions.cs

示例9: UnityBasedDependencyResolver

 public UnityBasedDependencyResolver(
     IDependencyResolver baseResolver,
     IUnityContainer unityContainer)
 {
     _baseResolver = baseResolver;
     _unityContainer = unityContainer;
 }
开发者ID:alreva,项目名称:CQRS_Example,代码行数:7,代码来源:UnityBasedDependencyResolver.cs

示例10: ServerCommandHandler

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

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

示例11: ApplicationOAuthProvider

        public ApplicationOAuthProvider(string publicClientId, IDependencyResolver dependencyResolver)
        {
            Requires.NotNull(dependencyResolver, "dependencyResolver");
            _dependencyResolver = dependencyResolver;

            _publicClientId = publicClientId;
        }
开发者ID:alekseysukharev,项目名称:bank,代码行数:7,代码来源:ApplicationOAuthProvider.cs

示例12: ConfiguradorDeDependencias

 public ConfiguradorDeDependencias(IDependencyResolver container)
 {
     this.container = container;
     repositorioFactory = new RepositorioFactory(GerenciadorSinais.CaminhoDoArquivoDoRepositorio);
     caracteristicasFactory = new CaracteristicasFactory();
     algoritmoFactory = new AlgoritmoClassificacaoSinalFactory(caracteristicasFactory);
 }
开发者ID:ejulio,项目名称:signa,代码行数:7,代码来源:ConfiguradorDeDependencias.cs

示例13: LongPollingTransport

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

示例14: DefaultViewPageActivator

 public DefaultViewPageActivator(IDependencyResolver resolver)
 {
     if (resolver == null)
         _resolverThunk = () => DependencyResolver.Current;
     else
         _resolverThunk = () => resolver;
 }
开发者ID:victorsantoss,项目名称:RazorGenerator,代码行数:7,代码来源:DefaultViewPageActivator.cs

示例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();
                });
            }
        }
开发者ID:ZixiangBoy,项目名称:SignalR-1,代码行数:28,代码来源:RedisMessageBus.cs


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