Ejemplo n.º 1
0
 public IEnumerable <ControllerInfo> GetControllers()
 {
     return
         (from t in GetControllerTypes()
          where !this.Settings.IgnoredControllers.Contains(t)
          let c = CodeRoutingProvider.AnalyzeControllerType(t, this)
                  where c != null &&
                  c.IsInRootNamespace
                  select c);
 }
Ejemplo n.º 2
0
        public static void RegisterProvider(CodeRoutingProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            lock (staticLock) {
                providers.Add(provider);
            }
        }
Ejemplo n.º 3
0
        public RegisterSettings(Assembly assembly, Type rootController)
        {
            if (rootController != null)
            {
                if (CodeRoutingProvider.GetProviderForControllerType(rootController) == null ||
                    !IsValidControllerType(rootController))
                {
                    throw new InvalidOperationException("The specified root controller is not a valid controller type.");
                }

                if (assembly != null &&
                    rootController.Assembly != assembly)
                {
                    throw new InvalidOperationException("The specified root controller does not belong to the specified assembly.");
                }
            }
            else if (assembly == null)
            {
                throw new ArgumentException("Either assembly or rootController must be specified.");
            }

            this.Assembly       = assembly;
            this.RootController = rootController;
        }
Ejemplo n.º 4
0
 static CodeRoutingHttpExtensions()
 {
     CodeRoutingProvider.RegisterProvider(new HttpCodeRoutingProvider());
 }
Ejemplo n.º 5
0
 static CodeRoutingExtensions()
 {
     CodeRoutingProvider.RegisterProvider(new Web.Mvc.MvcCodeRoutingProvider());
 }