Inheritance: IStartupLoader
示例#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
 internal static OwinAppContext Build()
 {
     string appStartup = ConfigurationManager.AppSettings[Constants.OwinAppStartup];
     var loader = new DefaultLoader();
     Action<IAppBuilder> startup = loader.Load(appStartup ?? string.Empty);
     return Build(startup);
 }
示例#3
0
        public static AppDelegate DefaultFactory()
        {
            var loader = new DefaultLoader();
            var builder = new AppBuilder();

            var startupName = ConfigurationManager.AppSettings["owin:Startup"];
            var startupMethod = loader.Load(startupName);
            if (startupMethod != null)
            {
                startupMethod.Invoke(builder);
            }
            return (AppDelegate)builder.Build(typeof(AppDelegate));
        }
示例#4
0
        internal static Action<IAppBuilder> GetAppStartup()
        {
            string appStartup = ConfigurationManager.AppSettings[Constants.OwinAppStartup];

            var loader = new DefaultLoader(new ReferencedAssembliesWrapper());
            IList<string> errors = new List<string>();
            Action<IAppBuilder> startup = loader.Load(appStartup ?? string.Empty, errors);

            if (startup == null)
            {
                throw new EntryPointNotFoundException(Resources.Exception_AppLoderFailure
                    + Environment.NewLine + " - " + string.Join(Environment.NewLine + " - ", errors)
                    + (IsAutomaticAppStartupEnabled ? Environment.NewLine + Resources.Exception_HowToDisableAutoAppStartup : string.Empty)
                    + Environment.NewLine + Resources.Exception_HowToSpecifyAppStartup);
            }
            return startup;
        }
示例#5
0
 public virtual Func<string, Action<IAppBuilder>> Create(Func<string, Action<IAppBuilder>> nextLoader)
 {
     var loader = new DefaultLoader(nextLoader, _activator.Activate);
     return loader.Load;
 }
示例#6
0
 /// <summary>
 /// Create a new chained app loader.
 /// </summary>
 /// <param name="nextLoader"></param>
 /// <returns></returns>
 public virtual AppLoaderFunc Create(AppLoaderFunc nextLoader)
 {
     var loader = new DefaultLoader(nextLoader, _activator.Activate);
     return loader.Load;
 }