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


C# FubuRegistry.Import方法代码示例

本文整理汇总了C#中FubuMVC.Core.FubuRegistry.Import方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.Import方法的具体用法?C# FubuRegistry.Import怎么用?C# FubuRegistry.Import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FubuMVC.Core.FubuRegistry的用法示例。


在下文中一共展示了FubuRegistry.Import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: register_with_basic_authentication_disabled

        public void register_with_basic_authentication_disabled()
        {
            var registry = new FubuRegistry();
            registry.Import<Saml2Extensions>();
            registry.Import<ApplyAuthentication>();

            var samlCertificateRepository = MockRepository.GenerateMock<ISamlCertificateRepository>();
            samlCertificateRepository.Stub(x => x.AllKnownCertificates()).Return(new SamlCertificate[0]);

            registry.Services(x =>
            {
                x.SetServiceIfNone<IPrincipalBuilder>(MockRepository.GenerateMock<IPrincipalBuilder>());
                x.AddService<ISamlResponseHandler>(MockRepository.GenerateMock<ISamlResponseHandler>());
                x.SetServiceIfNone<ISamlCertificateRepository>(samlCertificateRepository);
            });

            registry.AlterSettings<AuthenticationSettings>(x => {
                x.MembershipEnabled = MembershipStatus.Disabled;
            });

            var container = new Container();
            var runtime = FubuApplication.For(registry).StructureMap(container).Bootstrap();


            var strategies = container.GetAllInstances<IAuthenticationStrategy>();
            strategies.Single().ShouldBeOfType<SamlAuthenticationStrategy>();

        }
开发者ID:sbartlett,项目名称:FubuMVC.Saml2,代码行数:28,代码来源:bottle_configuration_integration_tester.cs

示例2: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<NothingEndpoint>(); // Have to do this to make it an isolated test
            registry.Import<ApplyAuthentication>();
            registry.Import<FormsAuthenticationRegistry>();

            theGraphWithBasicAuthentication = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:9,代码来源:AuthenticationBootstrapperTests.cs

示例3: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<WindowsAuthFubuRegistryExtension>();

            theGraphWithWindowsAuthentication = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:mtscout6,项目名称:FubuMVC.Authentication,代码行数:7,代码来源:setup_with_windows_authentication.cs

示例4: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<YuiCompressionExtensions>();

            theServices = BehaviorGraph.BuildFrom(registry).Services;
        }
开发者ID:mtscout6,项目名称:FubuMVC.AssetTransforms,代码行数:7,代码来源:default_services_are_registered.cs

示例5: configure

 protected override void configure(FubuRegistry registry)
 {
     registry.Import<SparkEngine>();
     registry.Actions.IncludeType<UsesPartialController>();
     registry.Actions.IncludeType<HelloPartialController>();
     registry.Views.TryToAttachWithDefaultConventions();
 }
开发者ID:ketiko,项目名称:fubumvc,代码行数:7,代码来源:PartialNoLayoutIntegrationTester.cs

示例6: default_namespaces_are_set_including_anything_from_CommonViewNamespaces

        public void default_namespaces_are_set_including_anything_from_CommonViewNamespaces()
        {
            var registry = new FubuRegistry();
            registry.Import<RazorViewFacility>();
            registry.AlterSettings<CommonViewNamespaces>(x =>
            {
                x.Add("Foo");
                x.Add("Bar");
            });

            var graph = BehaviorGraph.BuildFrom(registry);
            var useNamespaces = graph.Services.DefaultServiceFor<CommonViewNamespaces>().Value.As<CommonViewNamespaces>();

            useNamespaces.Namespaces.ShouldHaveTheSameElementsAs(new[]
            {
            "System.Web",
            "System",
            "FubuCore",
            "System.Linq",
            "HtmlTags",
            "FubuMVC.Core.UI",
            "FubuMVC.Core.UI.Extensions",
            "FubuMVC.Razor",
            "Foo",
            "Bar"
            });
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:27,代码来源:NamespacesImportedTester.cs

示例7: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<BasicLocalizationSupport>();

            graphWithBasicLocalizationAsIs = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:mtscout6,项目名称:FubuMVC.Localization,代码行数:7,代码来源:LocalizationBootstrappingTester.cs

示例8: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<ServerSentEventsExtension>();

            theGraph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.ServerSentEvents,代码行数:7,代码来源:ServerSentEventExtensionIntegratedTester.cs

示例9: Configure

		public void Configure(FubuRegistry registry)
		{
			registry.Import<HtmlConventionRegistry>(x =>
			{
				x.Forms.Add(new FormModifier());
			});
		}
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Ajax,代码行数:7,代码来源:AjaxExtensions.cs

示例10: configurationIs

        private void configurationIs(Action<DateTimePolicies> action)
        {
            container = new Container();
            var registry = new FubuRegistry();
            registry.Services(x =>
            {
                x.SetServiceIfNone<ITimeZoneContext>(theTimeZoneContext);
            });
            registry.Import<FubuMVC.Core.UI.FubuHtmlRegistration>();
            registry.Import<DateTimePolicies>(action);

            FubuApplication.For(registry).StructureMap(container).Bootstrap();


            _formatter = container.GetInstance<IDisplayFormatter>();
        }
开发者ID:DarthFubuMVC,项目名称:FubuMVC.Dates,代码行数:16,代码来源:DateTimeFormatting_import_integration_testing.cs

示例11: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry();
            registry.Import<ApplyWindowsAuthentication>();

            theGraph = BehaviorGraph.BuildFrom(registry);
        }
开发者ID:RobertTheGrey,项目名称:FubuMVC.Authentication,代码行数:7,代码来源:setup_with_windows_authentication.cs

示例12: Configure

 public void Configure(FubuRegistry registry)
 {
     registry.Import<HtmlConventionRegistry>(x =>
     {
         x.FieldChrome<BootstrapFieldChrome>();
         x.Labels.Add(new BootstrapLabelModifier());
     });
 }
开发者ID:synhershko,项目名称:FubuMVC.Bootstrap,代码行数:8,代码来源:BootstrapExtensions.cs

示例13: Configure

        public void Configure(FubuRegistry registry)
        {
//            registry
//                .Import<SassExtension>();

             registry
                 .Import<VisualizationFubuRegistry>(DiagnosticsRegistration.DIAGNOSTICS_URL_ROOT);
        }
开发者ID:rauhryan,项目名称:FubuMVC.Visualizations,代码行数:8,代码来源:VisualizationExtension.cs

示例14: register_a_non_default_culture_info

        public void register_a_non_default_culture_info()
        {
            var registry = new FubuRegistry();
            registry.Import<BasicLocalizationSupport>(x => x.DefaultCulture = new CultureInfo("en-CA"));

            BehaviorGraph.BuildFrom(registry).Services.DefaultServiceFor(typeof (CultureInfo))
                .Value.ShouldEqual(new CultureInfo("en-CA"));
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:8,代码来源:LocalizationBootstrappingTester.cs

示例15: uses_the_specified_OAuthSettings

        public void uses_the_specified_OAuthSettings()
        {
            var theSettings = new OAuthSettings {ConsumerKey = "blah", ConsumerSecret = "private"};
            var registry = new FubuRegistry();
            registry.Import<ApplyTwitterAuthentication>(x => x.UseOAuthSettings(theSettings));

            var graph = BehaviorGraph.BuildFrom(registry);
            graph.Services.DefaultServiceFor<OAuthSettings>().Value.ShouldEqual(theSettings);
        }
开发者ID:RobertTheGrey,项目名称:FubuMVC.Authentication,代码行数:9,代码来源:TwitterBootstrapperTests.cs


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