Esempio n. 1
0
        public static void RegisterServices(ServicesContainer services)
        {
            // Exception logger
            services.Add(typeof(IExceptionLogger), new ElmahExceptionLogger());

            // Exception handler
            services.Replace(typeof(IExceptionHandler), new GenericExceptionHandler());
        }
Esempio n. 2
0
        /// <summary>
        /// 注册服务
        /// </summary>
        public static void RegisterService()
        {
            if (_noRegistered)
            {
                _mapServer.Add(typeof(ICommonService), "JFH.MX.App.Core.CommonService,JFH.MX.App.Core");

                _noRegistered = false;
            }
        }
Esempio n. 3
0
        /// <summary>Replaces all filter providers in services with <see cref="DryIocFilterProvider"/>, and registers it in container.</summary>
        /// <param name="container">DryIoc container.</param> <param name="services">Services</param>
        public static void SetFilterProvider(this IContainer container, ServicesContainer services)
        {
            var providers = services.GetFilterProviders();

            services.RemoveAll(typeof(IFilterProvider), _ => true);
            var filterProvider = new DryIocFilterProvider(container, providers);

            services.Add(typeof(IFilterProvider), filterProvider);
            container.UseInstance <IFilterProvider>(filterProvider);
        }
Esempio n. 4
0
        public static IClrTypeKeyResolver GetClrTypeKeyResolver(this ServicesContainer services)
        {
            var resolver = services.GetService(typeof(IClrTypeKeyResolver)) as IClrTypeKeyResolver;

            if (resolver == null)
            {
                resolver = new DefalutClrTypeKeyResolver();
                services.Add(typeof(IClrTypeKeyResolver), resolver);
            }
            return(resolver);
        }
Esempio n. 5
0
        private static void RegisterService()
        {
            if (!noRegistered)
            {
                return;
            }
            ///增加对应的接口与实现类的对应关系

            _mapServer.Add(typeof(ICRMService), "KEEPER.K3.App.CRMService,KEEPER.K3.App");

            //这句话放到最后
            noRegistered = false;
        }
        private static void RegisterService()
        {
            if (!noRegistered)
            {
                return;
            }

            ////增加对应的接口与实现类的对应关系

            _mapServer.Add(typeof(ICommonService), "GYIN.K3.FXBZ.PROCANDSALEOUTSTOCK.App.CommonService,GYIN.K3.FXBZ.PROCANDSALEOUTSTOCK.APP");

            //这句话放到最后
            noRegistered = false;
        }
        static void UpdateControllerServices <T>(ServicesContainer services, IComponentContext container, ControllerTypeKey serviceKey) where T : class
        {
            var resolvedInstances = container.ResolveOptionalKeyed <IEnumerable <Meta <T> > >(serviceKey).ToArray();

            if (resolvedInstances.Any(service => ClearExistingServices(service.Metadata)))
            {
                services.Clear(typeof(T));
            }

            foreach (var instance in resolvedInstances)
            {
                services.Add(typeof(T), instance.Value);
            }
        }
 public static void RegisterModelBindings(ServicesContainer services)
 {
     services.Add(typeof(ModelBinderProvider), new GeocodeOptionsModelBindingProvider());
     services.Add(typeof(ModelBinderProvider), new ArcGisOnlineOptionsModelBindingProvide());
     services.Add(typeof(ModelBinderProvider), new RouteMilepostOptionsModelBindingProvider());
     services.Add(typeof(ModelBinderProvider), new SearchOptionsModelBindingProvider());
     services.Add(typeof(ModelBinderProvider), new ReverseMilepostOptionsModelBindingProvider());
     services.Add(typeof(ModelBinderProvider), new ReverseGeocodeOptionsModelBindingProvider());
 }
Esempio n. 9
0
        public static void RegisterService()
        {
            if (!noRegistered)
            {
                return;
            }


            ////增加对应的接口与实现类的对应关系

            _mapServer.Add(typeof(IOrderRequestService), "KEEPER.K3.App.OrderRequestService,KEEPER.K3.App");

            //这句话放到最后
            noRegistered = false;
        }
Esempio n. 10
0
        /// <summary>
        ///     Installs Filter provider with injectable property dependencies support.
        /// </summary>
        /// <param name="services">Services container, <see cref="ServicesContainer" /></param>
        /// <param name="container">Windsor container, <see cref="IWindsorContainer" /> </param>
        /// <param name="propertyDescriptorCache">Injectable property cache</param>
        /// <returns>Windsor container</returns>
        public static void InstallHttpFilterProvider([NotNull] this ServicesContainer services,
                                                     [NotNull] IWindsorContainer container, ITypePropertyDescriptorCache propertyDescriptorCache)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }
            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }

            var providers = services.GetFilterProviders().Where(i => i is ActionDescriptorFilterProvider).ToArray();

            foreach (var filterProvider in providers)
            {
                services.Remove(typeof(IFilterProvider), filterProvider);
            }

            services.Add(typeof(IFilterProvider), new WindsorHttpFilterProvider(container, propertyDescriptorCache));
        }
 public static void Configure(ServicesContainer services)
 {
     services.Add(typeof(IExceptionLogger), new ElmahExceptionLogger());
 }
Esempio n. 12
0
 public static void RegisterService()
 {
     _mapServer = new ServicesContainer();
     lock (_mapServer)
     {
         if (noRegistered)
         {
             _mapServer.Add(typeof(ICommonService), "Kingdee.K3.FIN.BM.App.Core.CommonService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IDistributeService), "Kingdee.K3.FIN.BM.App.Core.DistributeService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IReportOperationService), "Kingdee.K3.FIN.BM.App.Core.PivotGrid.OperationService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetMonitorService), "Kingdee.K3.FIN.BM.App.Core.BudgetMonitorService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetReportPlateService), "Kingdee.K3.FIN.BM.App.Core.BudgetReportPlateService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IReportOrgService), "Kingdee.K3.FIN.BM.App.Core.ReportOrgService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetCtrlPlateformService), "Kingdee.K3.FIN.BM.App.Core.BudgetCtrlPlateformService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetAdjust), "Kingdee.K3.FIN.BM.App.Core.BudgetAdjustService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(ICaculateService), "Kingdee.K3.FIN.BM.App.Core.Caculate.CaculateService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetFormulaService), "Kingdee.K3.FIN.BM.App.Core.BudgetFormulaService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetOrgEditService), "Kingdee.K3.FIN.BM.App.Core.BudgetOrgEditService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetCalendarService), "Kingdee.K3.FIN.BM.App.Core.BudgetCalendarService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IReportSchemeService), "Kingdee.K3.FIN.BM.App.Core.ReportSchemeService,Kingdee.K3.FIN.BM.App.Core");
             _mapServer.Add(typeof(IBudgetDimensionService), "Kingdee.K3.FIN.BM.App.Core.BudgetDimensionService,Kingdee.K3.FIN.BM.App.Core");
             noRegistered = false;
         }
     }
 }
Esempio n. 13
0
 public static void RegisterServices(ServicesContainer services)
 {
     // Exception logger
     services.Add(typeof(IExceptionLogger), new ElmahExceptionLogger());
 }
Esempio n. 14
0
 public static void RegisterIFilterProvider(ServicesContainer services, Container container)
 {
     services.Remove(typeof(IFilterProvider), GlobalConfiguration.Configuration.Services.GetFilterProviders().OfType <ActionDescriptorFilterProvider>().Single());
     services.Add(typeof(IFilterProvider), new SimpleInjectorActionFilterProvider(container));
 }
Esempio n. 15
0
 public static void RegisterService()
 {
     ////增加对应的接口与实现类的对应关系
     _mapServer.Add(typeof(ICommonService), "Keeper.K3.MES.App.Core.CommonService,Keeper.K3.MES.App.Core");
 }
 public static void AddLuccaLogs(this ServicesContainer servicesContainer)
 {
     servicesContainer.Add(typeof(IExceptionLogger), new LuccaExceptionLogger());
     servicesContainer.Replace(typeof(IExceptionHandler), new ExceptionHandler());
 }