本文整理汇总了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
);
}
示例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;
}
示例3: Test_Way_1
private static void Test_Way_1(IIocManager iocManager)
{
var tester = iocManager.Resolve<Tester>();
tester.Test();
iocManager.Release(tester);
}
示例4: AbpNHibernateInterceptor
public AbpNHibernateInterceptor(IIocManager iocManager)
{
_iocManager = iocManager;
_abpSession =
new Lazy<IAbpSession>(
() => _iocManager.IsRegistered(typeof(IAbpSession))
? _iocManager.Resolve<IAbpSession>()
: NullAbpSession.Instance
);
}
示例5: Initialize
public static void Initialize(IIocManager iocManager)
{
_auditingConfiguration = iocManager.Resolve<IAuditingConfiguration>();
if (!_auditingConfiguration.IsEnabled)
{
return;
}
iocManager.IocContainer.Kernel.ComponentRegistered += Kernel_ComponentRegistered;
}
示例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)));
}
};
}
示例7: EventInitializer
public EventInitializer()
{
_iocManager = IocManager.Instance;
_eventHandlerFinder = _iocManager.Resolve<IEventHandlerFinder>();
}
示例8: AuditingInterceptorRegistrar
public AuditingInterceptorRegistrar(IIocManager iocManager)
{
_iocManager = iocManager;
_auditingConfiguration = _iocManager.Resolve<IAuditingConfiguration>();
}