コード例 #1
0
        private IntegratedPipelineBlueprint InitializeBlueprint()
        {
            IntegratedPipelineBlueprintStage firstStage = null;

            string appStartup            = ConfigurationManager.AppSettings[Constants.OwinAppStartup];
            var    loader                = new DefaultLoader();
            Action <IAppBuilder> startup = loader.Load(appStartup ?? string.Empty);

            if (startup == null)
            {
                return(null);
            }

            var appContext = OwinBuilder.Build(builder =>
            {
                EnableIntegratedPipeline(builder, stage => firstStage = stage);
                startup.Invoke(builder);
            });

            if (appContext == null)
            {
                return(null);
            }

            string basePath = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            return(new IntegratedPipelineBlueprint(appContext, firstStage, basePath));
        }
コード例 #2
0
ファイル: OwinRouteHandler.cs プロジェクト: evicertia/Katana
        /// <summary>
        /// Initialize an OwinRouteHandler
        /// </summary>
        /// <param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
        public OwinRouteHandler(Action <IAppBuilder> startup)
        {
            _pathBase = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            OwinAppContext app         = null;
            bool           initialized = false;
            var            syncLock    = new object();

            _appAccessor = () => LazyInitializer.EnsureInitialized(
                ref app,
                ref initialized,
                ref syncLock,
                () => OwinBuilder.Build(startup));
        }
コード例 #3
0
ファイル: OwinHttpModule.cs プロジェクト: evicertia/Katana
        private IntegratedPipelineBlueprint InitializeBlueprint()
        {
            IntegratedPipelineBlueprintStage firstStage = null;

            Action <IAppBuilder> startup    = OwinBuilder.GetAppStartup();
            OwinAppContext       appContext = OwinBuilder.Build(builder =>
            {
                EnableIntegratedPipeline(builder, stage => firstStage = stage);
                startup.Invoke(builder);
            });

            string basePath = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            return(new IntegratedPipelineBlueprint(appContext, firstStage, basePath));
        }
コード例 #4
0
ファイル: OwinRouteHandler.cs プロジェクト: zhangrl/katana
 /// <summary>
 /// Initialize an OwinRouteHandler
 /// </summary>
 /// <param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
 public OwinRouteHandler(Action <IAppBuilder> startup)
 {
     _pathBase    = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);
     _appAccessor = () => OwinBuilder.Build(startup);
 }