Resolver ClassDelta Engine Documentation
Basic resolver functionality via Autofac, each configuration registers concrete types. For example GLFW uses GLFWGraphics, GLFWSound, GLFWKeyboard, etc. and makes them available. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms Resolver
    DeltaEngine.Platforms ApproveFirstFrameScreenshot

Namespace: DeltaEngine.Platforms
Assembly: DeltaEngine.Platforms (in DeltaEngine.Platforms.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract class Resolver : IDisposable

The Resolver type exposes the following members.

Constructors

  NameDescription
Protected methodResolver
Initializes a new instance of the Resolver class
Top
Methods

  NameDescription
Public methodDispose
Releases all resources used by the Resolver
Public methodRegister(Type)
Public methodRegister T  
Protected methodRegisterInstance
Registers an already created instance and overwrite all base classes and interfaces. For example if registering WpfHostedFormsWindow will force all Resolve Window calls to use it. View code on GitHub
Public methodRegisterSingleton(Type)
Public methodRegisterSingleton T  
Public methodResolve BaseType 
Top
Fields

  NameDescription
Protected fieldalreadyRegisteredTypes
Protected fieldStatic memberClickIgnoreToContinue
Public fieldStatic memberErrorWasCopiedToClipboardMessage
Top
Properties

  NameDescription
Protected propertyIsAlreadyInitialized
Top
Remarks

Tests: DeltaEngine.Platforms.Tests.ResolverTests
Examples

8 unit tests call DeltaEngine.Platforms.Resolver
[Test]
public void RegisterTypeTwice()
{
    resolver.Register(typeof(A));
    resolver.Register(typeof(A));
}
[Test]
public void RegisterSingletonTypeTwice()
{
    resolver.RegisterSingleton(typeof(A));
    resolver.RegisterSingleton(typeof(A));
}
[Test]
public void RegisterAfterInitializationThrows()
{
    Assert.IsFalse(resolver.IsInitialized);
    resolver.Register(typeof(A));
    resolver.Resolve<A>();
    Assert.IsTrue(resolver.IsInitialized);
    Assert.Throws<Resolver.UnableToRegisterMoreTypesAppAlreadyStarted>(
        () => resolver.Register(typeof(B)));
    Assert.Throws<Resolver.UnableToRegisterMoreTypesAppAlreadyStarted>(
        () => resolver.RegisterSingleton(typeof(C)));
}
See Also