本文整理汇总了C#中IServiceRegistry.SetServiceIfNone方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceRegistry.SetServiceIfNone方法的具体用法?C# IServiceRegistry.SetServiceIfNone怎么用?C# IServiceRegistry.SetServiceIfNone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceRegistry
的用法示例。
在下文中一共展示了IServiceRegistry.SetServiceIfNone方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: configureServices
private void configureServices(IServiceRegistry services)
{
var configuration = new TemplateServiceConfiguration {BaseTemplateType = typeof (FubuRazorView)};
services.ReplaceService<ITemplateRegistry<IRazorTemplate>>(_templateRegistry);
services.ReplaceService<IFubuTemplateService>(new FubuTemplateService(_templateRegistry, new TemplateService(configuration), new FileSystem()));
services.ReplaceService<ITemplateServiceConfiguration>(configuration);
services.ReplaceService<IParsingRegistrations<IRazorTemplate>>(_parsings);
services.SetServiceIfNone<ITemplateDirectoryProvider<IRazorTemplate>, TemplateDirectoryProvider<IRazorTemplate>>();
services.SetServiceIfNone<ISharedPathBuilder>(new SharedPathBuilder());
var graph = new SharingGraph();
services.SetServiceIfNone(graph);
services.SetServiceIfNone<ISharingGraph>(graph);
services.FillType<IActivator, RazorActivator>();
services.FillType<ISharedTemplateLocator<IRazorTemplate>, SharedTemplateLocator<IRazorTemplate>>();
services.FillType<ISharingAttacher<IRazorTemplate>, MasterAttacher<IRazorTemplate>>();
services.FillType<ITemplateSelector<IRazorTemplate>, RazorTemplateSelector>();
services.FillType<IActivator, SharingAttacherActivator<IRazorTemplate>>();
services.FillType<IRenderStrategy, AjaxRenderStrategy>();
services.FillType<IRenderStrategy, DefaultRenderStrategy>();
services.SetServiceIfNone<IViewModifierService<IFubuRazorView>, ViewModifierService<IFubuRazorView>>();
services.FillType<IViewModifier<IFubuRazorView>, LayoutActivation>();
services.FillType<IViewModifier<IFubuRazorView>, PartialRendering>();
services.FillType<IViewModifier<IFubuRazorView>, FubuPartialRendering>();
}
示例2: registerDefaultServices
private static void registerDefaultServices(IServiceRegistry s)
{
s.SetServiceIfNone<ILogger, ExceptionLogger>();
s.SetServiceIfNone<Parser, OptimizedParser>();
s.SetServiceIfNone<IStylizer, PlainStylizer>();
s.SetServiceIfNone<IImporter, DefaultImporter>();
s.SetServiceIfNone<IFileReader, FileReader>();
s.SetServiceIfNone<ILessEngine, DefaultEngine>();
s.SetServiceIfNone<IPathResolver, AssetPathResolver>();
s.SetServiceIfNone<ILessCompiler, LessCompiler>();
s.AddService<ITransformerPolicy, LessTransformerPolicy>();
}
示例3: configureServices
private void configureServices(IServiceRegistry services)
{
services.SetServiceIfNone<ITemplateRegistry>(_templateRegistry);
services.SetServiceIfNone<ISparkViewEngine>(new SparkViewEngine());
services.AddService<IActivator, SparkActivator>();
services.AddService<IRenderStrategy, NestedRenderStrategy>();
services.AddService<IRenderStrategy, AjaxRenderStrategy>();
services.AddService<IRenderStrategy, DefaultRenderStrategy>();
services.AddService<IViewModifier, PageActivation>();
services.AddService<IViewModifier, SiteResourceAttacher>();
services.AddService<IViewModifier, ContentActivation>();
services.AddService<IViewModifier, OnceTableActivation>();
services.AddService<IViewModifier, OuterViewOutputActivator>();
services.AddService<IViewModifier, NestedViewOutputActivator>();
services.AddService<IViewModifier, ViewContentDisposer>();
services.AddService<IViewModifier, NestedOutputActivation>();
}
示例4: registerCompiler
private static void registerCompiler(IServiceRegistry registry)
{
var compilerDef = registry.SetServiceIfNone(typeof (ICoffeeCompiler), typeof (SassCoffeeCompiler));
var innerCompilerDef = ObjectDef.ForType<CoffeeScriptCompiler>();
var instanceProvider = ObjectDef.ForType<InstanceProvider<IJavaScriptRuntime>>();
Func<IJavaScriptRuntime> runtimeFunc = () => new IEJavaScriptRuntime();
instanceProvider.DependencyByValue(typeof(Func<IJavaScriptRuntime>), runtimeFunc);
innerCompilerDef.Dependency(typeof(IInstanceProvider<IJavaScriptRuntime>), instanceProvider);
compilerDef.Dependency(typeof(CoffeeScriptCompiler), innerCompilerDef);
}
示例5: addServices
private static void addServices(IServiceRegistry registry)
{
var pipeline = new AssetPipeline();
registry.SetServiceIfNone<IAssetPipeline>(pipeline);
registry.SetServiceIfNone<IAssetFileRegistration>(pipeline);
registry.SetServiceIfNone(new AssetGraph());
registry.SetServiceIfNone(new AssetLogsCache());
registry.SetServiceIfNone<IAssetTagWriter, AssetTagWriter>();
registry.SetServiceIfNone<ICombinationDeterminationService, CombinationDeterminationService>();
registry.SetServiceIfNone<IAssetCombinationCache, AssetCombinationCache>();
registry.SetServiceIfNone<IAssetDependencyFinder, AssetDependencyFinderCache>();
registry.SetServiceIfNone<IAssetTagPlanner, AssetTagPlanner>();
registry.SetServiceIfNone<IAssetTagBuilder, AssetTagBuilder>();
registry.SetServiceIfNone<IAssetRequirements, AssetRequirements>();
registry.SetServiceIfNone<IMissingAssetHandler, TraceOnlyMissingAssetHandler>();
registry.SetServiceIfNone<IAssetTagPlanCache, AssetTagPlanCache>();
registry.SetServiceIfNone<ITransformerPolicyLibrary, TransformerPolicyLibrary>();
registry.SetServiceIfNone<IContentPlanner, ContentPlanner>();
registry.SetServiceIfNone<IContentPlanCache, ContentPlanCache>();
registry.SetServiceIfNone<IContentPipeline, ContentPipeline>();
registry.SetServiceIfNone<IContentWriter, ContentWriter>();
registry.SetServiceIfNone<IETagGenerator<IEnumerable<AssetFile>>, AssetFileEtagGenerator>();
}
示例6: setupAssetCaching
private void setupAssetCaching(IServiceRegistry registry)
{
registry.SetServiceIfNone<IAssetFileChangeListener>(_assetCache);
registry.SetServiceIfNone<IAssetContentCache>(_assetCache);
registry.SetServiceIfNone<IAssetFileWatcher, AssetFileWatcher>();
}
示例7: registerDefaultServices
private static void registerDefaultServices(IServiceRegistry s)
{
s.SetServiceIfNone<ILessEngine>(new LessEngine());
s.SetServiceIfNone<ILessCompiler, LessCompiler>();
s.AddService<ITransformerPolicy, LessTransformerPolicy>();
}
示例8: services
private static void services(IServiceRegistry s)
{
s.SetServiceIfNone<ISassCompiler, DefaultSassCompiler>();
s.SetServiceIfNone<SassAndCoffee.Ruby.Sass.ISassCompiler, SassAndCoffee.Ruby.Sass.SassCompiler>();
s.AddService<ITransformerPolicy, SassTransformerPolicy>();
}
示例9: configureServices
private void configureServices(IServiceRegistry services)
{
services.ReplaceService<ISparkTemplateRegistry>(_templateRegistry);
services.ReplaceService<ITemplateRegistry<ITemplate>>(_templateRegistry);
services.ReplaceService<IParsingRegistrations<ITemplate>>(_parsings);
var graph = new SharingGraph();
services.SetServiceIfNone(graph);
services.SetServiceIfNone<ISharingGraph>(graph);
services.SetServiceIfNone<ISparkViewEngine>(new SparkViewEngine());
services.SetServiceIfNone<ICacheService>(new DefaultCacheService(HttpRuntime.Cache));
services.SetServiceIfNone(new SharingLogsCache());
services.FillType<IActivator, SharingConfigActivator>();
services.FillType<IActivator, SharingPolicyActivator>();
services.FillType<IActivator, SharingAttacherActivator<ITemplate>>();
services.FillType<IActivator, SparkActivator>();
services.FillType<IActivator, SparkPrecompiler>();
services.FillType<ISharingAttacher<ITemplate>, MasterAttacher<ITemplate>>();
services.FillType<ISharingAttacher<ITemplate>, BindingsAttacher>();
services.SetServiceIfNone<ISharedPathBuilder>(new SharedPathBuilder());
services.SetServiceIfNone<ITemplateDirectoryProvider<ITemplate>, TemplateDirectoryProvider<ITemplate>>();
services.SetServiceIfNone<ISharedTemplateLocator, SharedTemplateLocator>();
services.FillType<ISharedTemplateLocator<ITemplate>, SharedTemplateLocator>();
services.FillType<IRenderStrategy, NestedRenderStrategy>();
services.FillType<IRenderStrategy, AjaxRenderStrategy>();
services.FillType<IRenderStrategy, DefaultRenderStrategy>();
services.FillType<ITemplateSelector<ITemplate>, SparkTemplateSelector>();
services.SetServiceIfNone<IViewEntryProviderCache, ViewEntryProviderCache>();
services.SetServiceIfNone<IViewModifierService<IFubuSparkView>, ViewModifierService<IFubuSparkView>>();
services.FillType<IViewModifier<IFubuSparkView>, PageActivation<IFubuSparkView>>();
services.FillType<IViewModifier<IFubuSparkView>, SiteResourceAttacher>();
services.FillType<IViewModifier<IFubuSparkView>, ContentActivation>();
services.FillType<IViewModifier<IFubuSparkView>, OnceTableActivation>();
services.FillType<IViewModifier<IFubuSparkView>, OuterViewOutputActivator>();
services.FillType<IViewModifier<IFubuSparkView>, NestedViewOutputActivator>();
services.FillType<IViewModifier<IFubuSparkView>, ViewContentDisposer>();
services.FillType<IViewModifier<IFubuSparkView>, NestedOutputActivation>();
services.SetServiceIfNone<IHtmlEncoder, DefaultHtmlEncoder>();
services.SetServiceIfNone(new DefaultViewDefinitionPolicy());
services.SetServiceIfNone<IViewDefinitionResolver, ViewDefinitionResolver>();
}