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


C# IServiceLocator.ResolveServices方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:13,代码来源:ModelBinderBlade.cs

示例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;
            }
        }
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:13,代码来源:InferredActionBlade.cs

示例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;
			}
		}
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:13,代码来源:HttpModuleBlade.cs

示例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;
     }
 }
开发者ID:runxc1,项目名称:mvcturbine,代码行数:13,代码来源:ViewBlade.cs

示例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;
     }
 }
开发者ID:jeff-french,项目名称:mvcturbine,代码行数:13,代码来源:RoutingBlade.cs

示例6: GetRenderRegistries

 protected virtual IList<IRendererRegistry> GetRenderRegistries(IServiceLocator locator) {
     try {
         return locator.ResolveServices<IRendererRegistry>();
     }
     catch {
         return null;
     }
 }
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:8,代码来源:RendererBlade.cs

示例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);
            }
        }
开发者ID:jglozano,项目名称:samples,代码行数:10,代码来源:AutowireApplication.cs

示例8: GetValidationProviders

		public virtual IList<ModelValidatorProvider> GetValidationProviders(IServiceLocator serviceLocator) {
			return serviceLocator.ResolveServices<ModelValidatorProvider>();
		}
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:3,代码来源:ModelValidatorBlade.cs

示例9: GetValueProviders

		public virtual IList<ValueProviderFactory> GetValueProviders(IServiceLocator locator) {
			return locator.ResolveServices<ValueProviderFactory>();
		}
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:3,代码来源:ValueProviderBlade.cs

示例10: GetRegisteredAreas

		public virtual IList<AreaRegistration> GetRegisteredAreas(IServiceLocator locator) {
			return locator.ResolveServices<AreaRegistration>();
		}
开发者ID:calebjenkins,项目名称:mvcturbine,代码行数:3,代码来源:AreaBlade.cs


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