本文整理汇总了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>();
}
示例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);
}
示例3: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Import<WindowsAuthFubuRegistryExtension>();
theGraphWithWindowsAuthentication = BehaviorGraph.BuildFrom(registry);
}
示例4: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Import<YuiCompressionExtensions>();
theServices = BehaviorGraph.BuildFrom(registry).Services;
}
示例5: configure
protected override void configure(FubuRegistry registry)
{
registry.Import<SparkEngine>();
registry.Actions.IncludeType<UsesPartialController>();
registry.Actions.IncludeType<HelloPartialController>();
registry.Views.TryToAttachWithDefaultConventions();
}
示例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"
});
}
示例7: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Import<BasicLocalizationSupport>();
graphWithBasicLocalizationAsIs = BehaviorGraph.BuildFrom(registry);
}
示例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());
});
}
示例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>();
}
示例11: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Import<ApplyWindowsAuthentication>();
theGraph = BehaviorGraph.BuildFrom(registry);
}
示例12: Configure
public void Configure(FubuRegistry registry)
{
registry.Import<HtmlConventionRegistry>(x =>
{
x.FieldChrome<BootstrapFieldChrome>();
x.Labels.Add(new BootstrapLabelModifier());
});
}
示例13: Configure
public void Configure(FubuRegistry registry)
{
// registry
// .Import<SassExtension>();
registry
.Import<VisualizationFubuRegistry>(DiagnosticsRegistration.DIAGNOSTICS_URL_ROOT);
}
示例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"));
}
示例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);
}