• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDependencyResolver类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



IDependencyResolver类属于命名空间,在下文中一共展示了IDependencyResolver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Server

 /// <summary>
 /// Initializes new instance of <see cref="Server"/>.
 /// </summary>
 /// <param name="url">The url to host the server on.</param>
 /// <param name="resolver">The dependency resolver for the server.</param>
 public Server(string url, IDependencyResolver resolver)
     : base(resolver)
 {
     _url = url.Replace("*", @".*?");
     _listener = new HttpListener();
     _listener.Prefixes.Add(url);
 }
开发者ID:nightbob3,项目名称:SignalR,代码行数:12,代码来源:Server.cs


示例17: ComparisonService

 public ComparisonService(IRectangleIntersectionService rectangleIntersectionService, IAdjacencyService adjacencyService, IDependencyResolver resolver, IShapeFactory shapeFactory)
 {
     _rectangleIntersectionService = rectangleIntersectionService;
     _adjacencyService = adjacencyService;
     _resolver = resolver;
     _shapeFactory = shapeFactory;
 }
开发者ID:JasonvanBrackel,项目名称:Rectangles,代码行数:7,代码来源:ComparisonService.cs


示例18: TransportManager

 /// <summary>
 /// Initializes a new instance of <see cref="TransportManager"/> class.
 /// </summary>
 /// <param name="resolver">The default <see cref="IDependencyResolver"/>.</param>
 public TransportManager(IDependencyResolver resolver)
 {
     Register("foreverFrame", context => new ForeverFrameTransport(context, resolver));
     Register("serverSentEvents", context => new ServerSentEventsTransport(context, resolver));
     Register("longPolling", context => new LongPollingTransport(context, resolver));
     Register("webSockets", context => new WebSocketTransport(context, resolver));
 }
开发者ID:Kazzje,项目名称:SignalR,代码行数:11,代码来源:TransportManager.cs


示例19: BuildManagerViewEngine

        internal BuildManagerViewEngine(IViewPageActivator viewPageActivator, IResolver<IViewPageActivator> activatorResolver,
            IDependencyResolver dependencyResolver, VirtualPathProvider pathProvider)
        {
            if (viewPageActivator != null)
            {
                _viewPageActivator = viewPageActivator;
            }
            else
            {
                _activatorResolver = activatorResolver ?? new SingleServiceResolver<IViewPageActivator>(
                                                              () => null,
                                                              new DefaultViewPageActivator(dependencyResolver),
                                                              "BuildManagerViewEngine constructor");
            }

            if (pathProvider != null)
            {
                Func<VirtualPathProvider> providerFunc = () => pathProvider;
                _fileExistsCache = new FileExistenceCache(providerFunc);
                VirtualPathProviderFunc = providerFunc;
            }
            else
            {
                if (_sharedFileExistsCache == null)
                {
                    // Startup initialization race is OK providing service remains read-only
                    _sharedFileExistsCache = new FileExistenceCache(() => HostingEnvironment.VirtualPathProvider);
                }

                _fileExistsCache = _sharedFileExistsCache;
            }
        }
开发者ID:tlycken,项目名称:aspnetwebstack,代码行数:32,代码来源:BuildManagerViewEngine.cs


示例20: AddSignalRInjection

        private void AddSignalRInjection(IContainer container,IDependencyResolver resolver)
        {
            var updater = new ContainerBuilder();

            updater.RegisterInstance(resolver.Resolve<IConnectionManager>());
            updater.Update(container);
        }
开发者ID:radu-matei,项目名称:signalr-dependency-injection-autofac,代码行数:7,代码来源:Startup.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDeploymentSettingsManager类代码示例发布时间:2022-05-24
下一篇:
C# IDependency类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap