private void ResolveApp(StartContext context) { context.Builder.Use(typeof(Encapsulate), context.EnvironmentData); if (context.App == null) { IList <string> errors = new List <string>(); if (context.Startup == null) { string appName = DetermineApplicationName(context); context.Startup = _appLoader.Load(appName, errors); } if (context.Startup == null) { throw new EntryPointNotFoundException(Resources.Exception_AppLoadFailure + Environment.NewLine + " - " + string.Join(Environment.NewLine + " - ", errors)); } // 把Startup中的内容加到AppBuiler中 context.Startup(context.Builder); } else { context.Builder.Use(new Func <object, object>(_ => context.App)); } }
private void ResolveApp(StartContext context) { context.Builder.Use(typeof(Encapsulate), context.EnvironmentData); if (context.App == null) { IList <string> errors = new List <string>(); if (context.Startup == null) { string appName = DetermineApplicationName(context); context.Startup = _appLoader.Load(appName, errors); } context.Startup(context.Builder); } else { context.Builder.Use(new Func <object, object>(_ => context.App)); } }
private void ResolveApp(StartContext context) { context.Builder.Use(typeof(Encapsulate), context.EnvironmentData); if (context.App == null) { if (context.Startup == null) { string appName = DetermineApplicationName(context); context.Startup = _appLoader.Load(appName); } if (context.Startup == null) { throw new EntryPointNotFoundException(Resources.Exception_MissingApplicationEntryPoint); } context.Startup(context.Builder); } else { context.Builder.Use(new Func <object, object>(_ => context.App)); } }