本文整理汇总了C#中FubuMVC.Core.FubuRegistry.HostWith方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.HostWith方法的具体用法?C# FubuRegistry.HostWith怎么用?C# FubuRegistry.HostWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FubuMVC.Core.FubuRegistry
的用法示例。
在下文中一共展示了FubuRegistry.HostWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
_controller = _input.BuildRemoteController();
var context = new StorytellerContext(_controller, _input);
if (_controller.BinPath.IsEmpty())
{
throw new Exception("Could not determine any BinPath for the testing AppDomain. Has the Storyteller specification project been compiled, \nor is Storyteller using the wrong compilation target maybe?\n\ntype 'st.exe ? open' or st.exe ? run' to see the command usages\n\n");
}
context.Start();
var registry = new FubuRegistry();
registry.AlterSettings<DiagnosticsSettings>(_ => _.TraceLevel = TraceLevel.Verbose);
registry.Mode = "development";
registry.HostWith<NOWIN>();
registry.Services.For<IRemoteController>().Use(_controller);
registry.Services.For<StorytellerContext>().Use(context);
registry.Services.IncludeRegistry<WebApplicationRegistry>();
_server = registry.ToRuntime();
}
示例2: Initialize
public void Initialize(Type applicationType, StartApplication message)
{
_registry = Activator.CreateInstance(applicationType).As<FubuRegistry>();
_registry.RootPath = message.PhysicalPath;
_registry.Port = PortFinder.FindPort(message.PortNumber);
_registry.Mode = message.Mode;
_registry.AlterSettings<OwinSettings>(owin =>
{
owin.AddMiddleware<HtmlHeadInjectionMiddleware>().Arguments.With(new InjectionOptions
{
Content = c => message.HtmlHeadInjectedText
});
});
if (_registry.Host == null) _registry.HostWith<Katana>();
StartUp();
}
示例3: serverFor
private FubuRuntime serverFor(Action<OwinSettings> action)
{
var registry = new FubuRegistry();
registry.AlterSettings(action);
registry.HostWith<Katana>();
return registry.ToRuntime();
}