本文整理汇总了C#中FubuMVC.Core.FubuRegistry.WithSparkDefaults方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.WithSparkDefaults方法的具体用法?C# FubuRegistry.WithSparkDefaults怎么用?C# FubuRegistry.WithSparkDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FubuMVC.Core.FubuRegistry
的用法示例。
在下文中一共展示了FubuRegistry.WithSparkDefaults方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: configures_settings_with_default_assemblies_and_namespaces
public void configures_settings_with_default_assemblies_and_namespaces()
{
var registry = new FubuRegistry();
registry.WithSparkDefaults();
SparkSettings settings = null;
registry.Services(x =>
{
settings = (SparkSettings) x.DefaultServiceFor<ISparkSettings>().Value;
});
registry.BuildGraph();
settings
.UseAssemblies
.ShouldContain(typeof(HtmlTag).Assembly.FullName);
settings
.UseAssemblies
.ShouldContain(typeof(FubuPageExtensions).Assembly.FullName);
settings
.UseNamespaces
.ShouldContain(typeof(FubuRegistryExtensions).Namespace);
settings
.UseNamespaces
.ShouldContain(typeof(FubuPageExtensions).Namespace);
settings
.UseNamespaces
.ShouldContain(typeof(HtmlTag).Namespace);
}
示例2: registers_spark_view_factory
public void registers_spark_view_factory()
{
var registry = new FubuRegistry();
registry.WithSparkDefaults();
ISparkViewFactory factory = null;
registry.Services(x =>
{
factory = (ISparkViewFactory)x.DefaultServiceFor<ISparkViewFactory>().Value;
});
registry.BuildGraph();
factory.ShouldNotBeNull();
}
示例3: first_configuration_supercedes_second
public void first_configuration_supercedes_second()
{
var registry = new FubuRegistry();
registry.Spark(spark => spark.Settings.AddNamespace("Test"));
registry.WithSparkDefaults();
SparkSettings settings = null;
registry.Services(x =>
{
settings = (SparkSettings) x.DefaultServiceFor<ISparkSettings>().Value;
});
registry.BuildGraph();
settings
.UseNamespaces
.ShouldContain("Test");
}
示例4: registers_spark_view_renderer
public void registers_spark_view_renderer()
{
var registry = new FubuRegistry();
registry.WithSparkDefaults();
var hasRenderer = false;
registry.Services(x => x.Each((type, def) =>
{
if(type == typeof(ISparkViewRenderer<>))
{
hasRenderer = def.Type == typeof (SparkViewRenderer<>);
}
}));
registry.BuildGraph();
hasRenderer.ShouldBeTrue();
}