Exemplo n.º 1
0
        public static void RegisterOrderFlows(OrderFlowCollection orderFlows)
        {
            var defaultOrderFlow = new OrderFlow("DefaultFlow", new[] { "Domains", "HostingPackage", "Account", "Checkout" });

            // Alias Default to Domains, to match Default route setup. 
            defaultOrderFlow.AddRouteNameAlias("OrderFlowStart", "Domains");

            orderFlows.Add(defaultOrderFlow, true);
        }
        /// <summary>
        /// Register configuration for Unity, filters, routes, bundles, order flow and model validation. Add legacy global settings configuration.
        /// </summary>
        public override void  Application_Start(object sender, EventArgs e)
        {
            AreaRegistration.RegisterAllAreas();

            var container = new UnityContainer();
            var orderFlows = new OrderFlowCollection();

            UnityConfig.RegisterComponents(container);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            OrderFlowConfig.RegisterOrderFlows(GlobalOrderFlows.OrderFlows);

            RegisterConfiguration(container);

            container.LoadConfiguration();

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));

            // RazorThemeViewEngine works with one instance per theme and lets the view engine selection 
            // algorithm do its work to find a view.
            var themeNamesProvider = container.Resolve<IThemeNamesProvider>();
            foreach (var theme in themeNamesProvider.GetActiveThemeNames())
            {
                ViewEngines.Engines.Add(new RazorThemeViewEngine(theme));
            }

            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(CustomerValidationAttribute), typeof(CustomerValidationAttribute.CustomerValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaRegularExpressionAttribute), typeof(AtomiaRegularExpressionValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaRequiredAttribute), typeof(AtomiaRequiredValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaStringLengthAttribute), typeof(AtomiaStringLengthValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaRangeAttribute), typeof(AtomiaRangeValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaUsernameAttribute), typeof(AtomiaUsernameAttribute.AtomiaUsernameValidator));
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(AtomiaUsernameRequiredAttribute), typeof(AtomiaUsernameRequiredValidator));

            foreach (GlobalSetting globalSetting in AppConfig.Instance.GlobalSettingsList)
            {
                if (HttpContext.Current != null)
                {
                    HttpContext.Current.Application[globalSetting.Name] = globalSetting.Value;
                }
            }
        }
Exemplo n.º 3
0
 public static void RegisterOrderFlows(OrderFlowCollection orderFlows)
 {
 }