本文整理汇总了C#中IServiceRegistry.AddService方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceRegistry.AddService方法的具体用法?C# IServiceRegistry.AddService怎么用?C# IServiceRegistry.AddService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceRegistry
的用法示例。
在下文中一共展示了IServiceRegistry.AddService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AudioSystem
/// <summary>
/// Create an new instance of AudioSystem
/// </summary>
/// <param name="registry">The service registry in which to register the <see cref="AudioSystem"/> services</param>
public AudioSystem(IServiceRegistry registry)
: base(registry)
{
Enabled = true;
registry.AddService(typeof(AudioSystem), this);
registry.AddService(typeof(IAudioEngineProvider), this);
}
示例2: SceneSystem
/// <summary>
/// Initializes a new instance of the <see cref="GameSystemBase" /> class.
/// </summary>
/// <param name="registry">The registry.</param>
/// <remarks>The GameSystem is expecting the following services to be registered: <see cref="IGame" /> and <see cref="IAssetManager" />.</remarks>
public SceneSystem(IServiceRegistry registry)
: base(registry)
{
registry.AddService(typeof(SceneSystem), this);
Enabled = true;
Visible = true;
}
示例3: SpriteAnimationSystem
/// <summary>
/// Creates a new instance of <see cref="SpriteAnimationSystem"/> and register it in the services.
/// </summary>
/// <param name="registry"></param>
public SpriteAnimationSystem(IServiceRegistry registry)
: base(registry)
{
registry.AddService(typeof(SpriteAnimationSystem), this);
DefaultFramesPerSecond = 30;
}
示例4: AudioSystem
/// <summary>
/// Create an new instance of AudioSystem
/// </summary>
/// <param name="registry">The service registry in which to register the <see cref="AudioSystem"/> services</param>
public AudioSystem(IServiceRegistry registry)
: base(registry)
{
Enabled = true;
AudioEngine = AudioEngineFactory.NewAudioEngine();
registry.AddService(typeof(AudioSystem), this);
}
示例5: Bullet2PhysicsSystem
public Bullet2PhysicsSystem(IServiceRegistry registry)
: base(registry)
{
UpdateOrder = -1000; //make sure physics runs before everything
registry.AddService(typeof(IPhysicsSystem), this);
Enabled = true; //enabled by default
}
示例6: GraphicsDeviceServiceLocal
/// <summary>
/// Initializes a new instance of the <see cref="GraphicsDeviceServiceLocal"/> class.
/// </summary>
/// <param name="registry">The registry.</param>
/// <param name="graphicsDevice">The graphics device.</param>
public GraphicsDeviceServiceLocal(IServiceRegistry registry, GraphicsDevice graphicsDevice)
{
if (registry != null)
{
registry.AddService(typeof(IGraphicsDeviceService), this);
}
GraphicsDevice = graphicsDevice;
}
示例7: DebugConsoleSystem
public DebugConsoleSystem(IServiceRegistry registry) : base(registry)
{
registry.AddService(typeof(DebugConsoleSystem), this);
Visible = true;
DrawOrder = 0xffffff;
UpdateOrder = -100100; //before script
}
示例8: GamePlatformDesktop
public GamePlatformDesktop(IServiceRegistry services) : base(services)
{
// By default, the mouse is hidden
isMouseVisible = false;
Cursor.Hide();
IsBlockingRun = true;
gameWindowDesktop = new GameWindowDesktop();
services.AddService(typeof(IGraphicsDeviceFactory), this);
}
示例9: 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>();
}
示例10: 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>();
}
示例11: GamePlatform
protected GamePlatform(GameBase game)
{
this.game = game;
Services = game.Services;
Services.AddService(typeof(IGraphicsDeviceFactory), this);
}
示例12: RegisterServices
public void RegisterServices(IServiceRegistry services)
{
services.AddService<IContentFolderService>(_contentFolderService);
services.AddService<IMimeTypeProvider>(_mimeTypeProvider);
}
示例13: 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>();
}
示例14: GamePlatformDesktop
public GamePlatformDesktop(IServiceRegistry services) : base(services)
{
IsBlockingRun = true;
gameWindowDesktop = new GameWindowDesktop();
services.AddService(typeof(IGraphicsDeviceFactory), this);
}
示例15: registerDefaultServices
private static void registerDefaultServices(IServiceRegistry s)
{
s.SetServiceIfNone<ILessEngine>(new LessEngine());
s.SetServiceIfNone<ILessCompiler, LessCompiler>();
s.AddService<ITransformerPolicy, LessTransformerPolicy>();
}