本文整理汇总了C#中FubuMVC.Core.FubuRegistry.ReplaceSettings方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.ReplaceSettings方法的具体用法?C# FubuRegistry.ReplaceSettings怎么用?C# FubuRegistry.ReplaceSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FubuMVC.Core.FubuRegistry
的用法示例。
在下文中一共展示了FubuRegistry.ReplaceSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: all_explicitly_changed_settings_should_get_registered_as_a_service
public void all_explicitly_changed_settings_should_get_registered_as_a_service()
{
var registry = new FubuRegistry();
var oneSettings = new OneSettings();
registry.ReplaceSettings(oneSettings);
var twoSettings = new TwoSettings();
registry.ReplaceSettings(twoSettings);
var threeSettings = new ThreeSettings();
registry.ReplaceSettings(threeSettings);
var graph = BehaviorGraph.BuildFrom(registry);
graph.Services.DefaultServiceFor<OneSettings>().Value.ShouldBeTheSameAs(oneSettings);
graph.Services.DefaultServiceFor<TwoSettings>().Value.ShouldBeTheSameAs(twoSettings);
graph.Services.DefaultServiceFor<ThreeSettings>().Value.ShouldBeTheSameAs(threeSettings);
}
示例2: all_explicitly_changed_settings_should_get_registered_as_a_service
public void all_explicitly_changed_settings_should_get_registered_as_a_service()
{
var registry = new FubuRegistry();
var oneSettings = new OneSettings();
registry.ReplaceSettings(oneSettings);
var twoSettings = new TwoSettings();
registry.ReplaceSettings(twoSettings);
var threeSettings = new ThreeSettings();
registry.ReplaceSettings(threeSettings);
using (var runtime = registry.ToRuntime())
{
var container = runtime.Get<IContainer>();
container.DefaultRegistrationIs(oneSettings);
container.DefaultRegistrationIs(twoSettings);
container.DefaultRegistrationIs(threeSettings);
}
}
示例3: replace_settings
public void replace_settings()
{
var settings1 = new SettingsObject();
var registry = new FubuRegistry();
registry.ReplaceSettings(settings1);
BehaviorGraph.BuildFrom(registry).Settings.Get<SettingsObject>()
.ShouldBeTheSameAs(settings1);
}