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


C# IIocManager.Resolve方法代码示例

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


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

示例1: AbpNHibernateInterceptor

        public AbpNHibernateInterceptor(IIocManager iocManager)
        {
            _iocManager = iocManager;

            _abpSession =
                new Lazy<IAbpSession>(
                    () => _iocManager.IsRegistered(typeof(IAbpSession))
                        ? _iocManager.Resolve<IAbpSession>()
                        : NullAbpSession.Instance,
                    isThreadSafe: true
                    );
            _guidGenerator =
                new Lazy<IGuidGenerator>(
                    () => _iocManager.IsRegistered(typeof(IGuidGenerator))
                        ? _iocManager.Resolve<IGuidGenerator>()
                        : SequentialGuidGenerator.Instance,
                    isThreadSafe: true
                    );

            _eventBus =
                new Lazy<IEventBus>(
                    () => _iocManager.IsRegistered(typeof(IEventBus))
                        ? _iocManager.Resolve<IEventBus>()
                        : NullEventBus.Instance,
                    isThreadSafe: true
                );
        }
开发者ID:vytautask,项目名称:aspnetboilerplate,代码行数:27,代码来源:AbpNHibernateInterceptor.cs

示例2: BdfNHibernateInterceptor

        public BdfNHibernateInterceptor(IIocManager iocManager)
        {
            _iocManager = iocManager;
             _BdfSession =
                new Lazy<IBdfSession>(
                    () => _iocManager.IsRegistered(typeof(IBdfSession))
                        ? _iocManager.Resolve<IBdfSession>()
                        : NullBdfSession.Instance
                    );

            EntityChangedEventHelper =
                _iocManager.IsRegistered(typeof (IEntityChangedEventHelper))
                    ? _iocManager.Resolve<IEntityChangedEventHelper>()
                    : NullEntityChangedEventHelper.Instance;
        }
开发者ID:lizhi5753186,项目名称:BDF,代码行数:15,代码来源:BdfNHibernateInterceptor.cs

示例3: Test_Way_1

        private static void Test_Way_1(IIocManager iocManager)
        {
            var tester = iocManager.Resolve<Tester>();

            tester.Test();

            iocManager.Release(tester);
        }
开发者ID:ChEhrhard,项目名称:aspnetboilerplate-samples,代码行数:8,代码来源:Program.cs

示例4: AbpNHibernateInterceptor

 public AbpNHibernateInterceptor(IIocManager iocManager)
 {
     _iocManager = iocManager;
     _abpSession =
         new Lazy<IAbpSession>(
             () => _iocManager.IsRegistered(typeof(IAbpSession))
                 ? _iocManager.Resolve<IAbpSession>()
                 : NullAbpSession.Instance
             );
 }
开发者ID:lukaaaaaaaay,项目名称:aspnetboilerplate,代码行数:10,代码来源:AbpNHibernateInterceptor.cs

示例5: Initialize

        public static void Initialize(IIocManager iocManager)
        {
            _auditingConfiguration = iocManager.Resolve<IAuditingConfiguration>();

            if (!_auditingConfiguration.IsEnabled)
            {
                return;
            }

            iocManager.IocContainer.Kernel.ComponentRegistered += Kernel_ComponentRegistered;
        }
开发者ID:Zbun,项目名称:Gld.Activity.Project,代码行数:11,代码来源:AuditingInterceptorRegistrar.cs

示例6: Initialize

 public static void Initialize(IIocManager iocManager)
 {
     var auditingConfiguration = iocManager.Resolve<IAuditingConfiguration>();
     iocManager.IocContainer.Kernel.ComponentRegistered += (key, handler) =>
     {
         if (ShouldIntercept(auditingConfiguration, handler.ComponentModel.Implementation))
         {
             handler.ComponentModel.Interceptors.Add(new InterceptorReference(typeof(AuditingInterceptor)));
         }
     };
 }
开发者ID:vytautask,项目名称:aspnetboilerplate,代码行数:11,代码来源:AuditingInterceptorRegistrar.cs

示例7: EventInitializer

 public EventInitializer()
 {
     _iocManager = IocManager.Instance;
     _eventHandlerFinder = _iocManager.Resolve<IEventHandlerFinder>();
 }
开发者ID:yangganggood,项目名称:EMP,代码行数:5,代码来源:EventInitializer.cs

示例8: AuditingInterceptorRegistrar

 public AuditingInterceptorRegistrar(IIocManager iocManager)
 {
     _iocManager = iocManager;
     _auditingConfiguration = _iocManager.Resolve<IAuditingConfiguration>();
 }
开发者ID:JimDeng,项目名称:aspnetboilerplate,代码行数:5,代码来源:AuditingInterceptorRegistrar.cs


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