当前位置: 首页>>代码示例>>C#>>正文


C# FubuRegistry.ReplaceSettings方法代码示例

本文整理汇总了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);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:17,代码来源:RegisterAllSettingsTester.cs

示例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);
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:19,代码来源:RegisterAllSettingsTester.cs

示例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);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:10,代码来源:FubuRegistryTester.cs


注:本文中的FubuMVC.Core.FubuRegistry.ReplaceSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。