Example #1
0
        public static string ProcessVirtualPath(
            Assembly assembly,
            string baseVirtualPath,
            string virtualPath
            )
        {
            if (_partRegistry == null)
            {
                // This was called without registering a part.
                throw new InvalidOperationException(
                          String.Format(
                              CultureInfo.CurrentCulture,
                              WebPageResources.ApplicationPart_ModuleNotRegistered,
                              assembly
                              )
                          );
            }

            ApplicationPart applicationPart = _partRegistry[new ResourceAssembly(assembly)];

            if (applicationPart == null)
            {
                throw new InvalidOperationException(
                          String.Format(
                              CultureInfo.CurrentCulture,
                              WebPageResources.ApplicationPart_ModuleNotRegistered,
                              assembly
                              )
                          );
            }

            return(applicationPart.ProcessVirtualPath(baseVirtualPath, virtualPath));
        }
        // REVIEW: Do we need an Unregister?
        // Register an assembly as an application module, which makes its compiled web pages
        // and embedded resources available
        public static void Register(ApplicationPart applicationPart) {
            // Ensure the registry is ready and the route handlers are set up
            _initApplicationPart.EnsurePerformed();
            Debug.Assert(_partRegistry != null, "Part registry should be initialized");

            _partRegistry.Register(applicationPart);
        }
Example #3
0
        // REVIEW: Do we need an Unregister?
        // Register an assembly as an application module, which makes its compiled web pages
        // and embedded resources available
        public static void Register(ApplicationPart applicationPart)
        {
            // Ensure the registry is ready and the route handlers are set up
            _initApplicationPart.EnsurePerformed();
            Debug.Assert(_partRegistry != null, "Part registry should be initialized");

            _partRegistry.Register(applicationPart);
        }
Example #4
0
        public static void Start()
        {
            SiteAdmin.Register("~/Rabbit/", "Rabbit Framework Admin",
                "Administrative Tools to manage modules, to generate code and to run unit tests.");

            var appPart = new ApplicationPart(typeof(PreApplicationStartCode).Assembly,
                SiteAdmin.GetVirtualPath("~/Rabbit/"));

            ApplicationPart.Register(appPart);

            SiteEngine.Start();
        }