示例#1
0
        protected override void InitialiseInternal(TinyIoC.TinyIoCContainer container)
        {
            base.InitialiseInternal(container);

            var configuration = new StitchConfiguration()
                                    {
                                        /*Compilers = new[]
                                                        {
                                                            new StitchConfigurationCompiler {Type = typeof (JavaScriptCompiler).AssemblyQualifiedName, Extension = ".js"},
                                                            new StitchConfigurationCompiler {Type = typeof (CoffeeScriptCompiler).AssemblyQualifiedName, Extension = ".coffee"},
                                                            new StitchConfigurationCompiler {Type = typeof (jQueryTemplateCompiler).AssemblyQualifiedName, Extension = ".tmpl"}
                                                        },*/
                                        Files = new[]
                                                    {
                                                        new StitchConfiguration()
                                                            {
                                                                Name = "/Scripts/app.stitch",
                                                                Paths = new[]
                                                                            {
                                                                                "Scripts/App"
                                                                            }
                                                            }
                                                    }
                                    };

            container.Register<IStitchConfiguration>(configuration);

            Stitch.Enable(this, container.Resolve<IRootPathProvider>(), container.Resolve<IStitchConfiguration>());
        }
        static StitchHttpHandler()
        {
            try
            {
                configuration = (StitchConfiguration) ConfigurationManager.GetSection("stitch");

                compilers = new List<ICompile>();
                foreach (var compiler in configuration.Compilers)
                {
                    compilers.Add((ICompile) Activator.CreateInstance(Type.GetType(compiler.Type)));
                }
            }
            catch (Exception ex)
            {
                exception = ex;
            }
        }
示例#3
0
        protected override void InitialiseInternal(TinyIoC.TinyIoCContainer container)
        {
            base.InitialiseInternal(container);

            var configuration = new StitchConfiguration()
                                    {
                                        Files = new[]
                                                    {
                                                        new StitchConfiguration()
                                                            {
                                                                Name = "/Scripts/app.stitch",
                                                                Paths = new[]
                                                                            {
                                                                                "Scripts/App"
                                                                            }
                                                            }
                                                    }
                                    };

            container.Register<IStitchConfiguration>(configuration);

            Stitch.Enable(this, container.Resolve<IRootPathProvider>(), container.Resolve<IStitchConfiguration>());
        }