Beispiel #1
0
 // ReSharper disable UnusedMember.Global
 public static void ApplicationShutdown()
 {
     Trace.Source.TraceInformation("Application shutdown - disposing resources.");
     _container.Dispose();
     IsolatedStorageContainer.Dispose();
     CassetteApplicationContainer.TriggerShutdown();
 }
Beispiel #2
0
        // ReSharper restore UnusedMember.Global

        static void InitializeApplicationContainer()
        {
            var factory = CreateApplicationContainerFactory();

            _container = factory.CreateContainer();
            CassetteApplicationContainer.SetApplicationAccessor(() => _container.Application);
            var forceCreation = _container.Application;
        }
Beispiel #3
0
        public Bundles_Test()
        {
            urlGenerator     = new Mock <IUrlGenerator>();
            referenceBuilder = new Mock <IReferenceBuilder>();
            bundleContainer  = new Mock <IBundleContainer>();
            application      = new TestableApplication(urlGenerator.Object, referenceBuilder.Object, bundleContainer.Object);

            CassetteApplicationContainer.SetApplicationAccessor(() => application);
        }
        public CassetteStartup(IRootPathProvider rootPathProvider)
        {
            this.rootPathProvider = rootPathProvider;

            // This will trigger creation of the Cassette infrastructure at the time of the first request.
            // The virtual directory is not known until that point, and the virtual directory is required for creation.
            this.getApplication = InitializeApplication;
            CassetteApplicationContainer.SetApplicationAccessor(() => getApplication());

            routeGenerator = new CassetteRouteGenerator(rootPathProvider.GetRootPath(), GetCurrentContext);
        }
Beispiel #5
0
        // This runs *after* Global.asax Application_Start.
// ReSharper disable UnusedMember.Global
        public static void PostApplicationStart()
// ReSharper restore UnusedMember.Global
        {
            _storage = IsolatedStorageFile.GetMachineStoreForAssembly(); // TODO: Check if this should be GetMachineStoreForApplication instead

            _configurations       = CreateConfigurations();
            _applicationContainer = GetSystemWebCompilationDebug()
                ? new CassetteApplicationContainer <CassetteApplication>(CreateCassetteApplication, HttpRuntime.AppDomainAppPath)
                : new CassetteApplicationContainer <CassetteApplication>(CreateCassetteApplication);

            CassetteHttpModule.GetApplication = () => _applicationContainer.Application;
            CassetteApplicationContainer.SetAccessor(() => _applicationContainer.Application);

            _applicationContainer.Initialize();
        }
Beispiel #6
0
 // ReSharper restore UnusedMember.Global
 static void InitializeApplicationContainer()
 {
     var factory = CreateApplicationContainerFactory();
     _container = factory.CreateContainer();
     CassetteApplicationContainer.SetApplicationAccessor(() => _container.Application);
     var forceCreation = _container.Application;
 }
Beispiel #7
0
        // ReSharper restore UnusedMember.Global
        // This runs *after* Global.asax Application_Start.
        // ReSharper disable UnusedMember.Global
        public static void PostApplicationStart()
        {
            _storage = IsolatedStorageFile.GetMachineStoreForAssembly(); // TODO: Check if this should be GetMachineStoreForApplication instead

            _configurations = CreateConfigurations();
            _applicationContainer = GetSystemWebCompilationDebug()
                ? new CassetteApplicationContainer<CassetteApplication>(CreateCassetteApplication, HttpRuntime.AppDomainAppPath)
                : new CassetteApplicationContainer<CassetteApplication>(CreateCassetteApplication);

            CassetteHttpModule.GetApplication = () => _applicationContainer.Application;
            CassetteApplicationContainer.SetAccessor(() => _applicationContainer.Application);
        }
Beispiel #8
0
        // This runs *after* Global.asax Application_Start.
        public static void PostApplicationStart()
        {
            storage = IsolatedStorageFile.GetMachineStoreForAssembly();

            configurations = CreateConfigurations();
            applicationContainer = ShouldOptimizeOutput() ? new CassetteApplicationContainer<CassetteApplication>(CreateCassetteApplication)
                                                          : new CassetteApplicationContainer<CassetteApplication>(CreateCassetteApplication, HttpRuntime.AppDomainAppPath);

            Assets.GetApplication = () => CassetteApplication;
        }