本文整理汇总了C#中IServiceLocator.ResolveServices方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceLocator.ResolveServices方法的具体用法?C# IServiceLocator.ResolveServices怎么用?C# IServiceLocator.ResolveServices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceLocator
的用法示例。
在下文中一共展示了IServiceLocator.ResolveServices方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetModelBinderProviders
/// <summary>
/// Gets all registered <see cref="IModelBinderProvider"/> from the container.
/// </summary>
/// <param name="locator">Current <see cref="IServiceLocator"/> instance for the application.</param>
/// <returns>A list of <see cref="IModelBinderProvider"/>, null if instances could not be resolved.</returns>
protected virtual IList<IModelBinderProvider> GetModelBinderProviders(IServiceLocator locator) {
try {
return locator.ResolveServices<IModelBinderProvider>();
}
catch {
return null;
}
}
示例2: GetActionRegistries
/// <summary>
/// Gets all the <see cref="IInferredActionRegistry"/> types that have been registered with the system.
/// </summary>
/// <param name="serviceLocator"></param>
/// <returns></returns>
protected virtual IList<IInferredActionRegistry> GetActionRegistries(IServiceLocator serviceLocator) {
try {
return serviceLocator.ResolveServices<IInferredActionRegistry>();
}
catch {
return null;
}
}
示例3: GetModuleRegistries
/// <summary>
/// Gets all <see cref="IHttpModuleProvider"/> types registered with the system.
/// </summary>
/// <param name="locator"></param>
/// <returns></returns>
protected IList<IHttpModuleProvider> GetModuleRegistries(IServiceLocator locator) {
try {
return locator.ResolveServices<IHttpModuleProvider>();
}
catch {
return null;
}
}
示例4: GetViewEngines
/// <summary>
/// Gets the <see cref="IViewEngine"/> registered with the system.
/// </summary>
/// <param name="locator">Instance of <see cref="IServiceLocator"/> to use.</param>
/// <returns>List of <see cref="IViewEngine"/>, null otherwise.</returns>
protected virtual IList<IViewEngine> GetViewEngines(IServiceLocator locator)
{
try {
return locator.ResolveServices<IViewEngine>();
} catch {
return null;
}
}
示例5: GetRouteRegistrations
/// <summary>
/// Gets the <see cref="IRouteRegistrator"/> registered with the system.
/// </summary>
/// <param name="locator">Instance of <see cref="IServiceLocator"/> to use.</param>
/// <returns>List of <see cref="IRouteRegistrator"/>, null otherwise.</returns>
protected virtual IList<IRouteRegistrator> GetRouteRegistrations(IServiceLocator locator)
{
try {
return locator.ResolveServices<IRouteRegistrator>();
} catch {
return null;
}
}
示例6: GetRenderRegistries
protected virtual IList<IRendererRegistry> GetRenderRegistries(IServiceLocator locator) {
try {
return locator.ResolveServices<IRendererRegistry>();
}
catch {
return null;
}
}
示例7: InitializeModules
protected virtual void InitializeModules(IServiceLocator locator)
{
List<IHttpModule> modules = locator.ResolveServices<IHttpModule>();
if (modules == null) return;
foreach (IHttpModule module in modules)
{
module.Init(this);
}
}
示例8: GetValidationProviders
public virtual IList<ModelValidatorProvider> GetValidationProviders(IServiceLocator serviceLocator) {
return serviceLocator.ResolveServices<ModelValidatorProvider>();
}
示例9: GetValueProviders
public virtual IList<ValueProviderFactory> GetValueProviders(IServiceLocator locator) {
return locator.ResolveServices<ValueProviderFactory>();
}
示例10: GetRegisteredAreas
public virtual IList<AreaRegistration> GetRegisteredAreas(IServiceLocator locator) {
return locator.ResolveServices<AreaRegistration>();
}