Load() public method

Executes the loader, searching for the entry point by name.
public Load ( string startupName ) : Action
startupName string The name of the assembly and type entry point
return Action
コード例 #1
0
ファイル: OwinHttpModule.cs プロジェクト: tkggand/katana
        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
ファイル: OwinBuilder.cs プロジェクト: tkggand/katana
 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
ファイル: AppSingleton.cs プロジェクト: dragan/gate
        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
ファイル: OwinBuilder.cs プロジェクト: Kstal/Microsoft.Owin
        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;
        }