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
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
The Resolver type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Resolver | Initializes a new instance of the Resolver class |
Methods
Name | Description | |
---|---|---|
Dispose | Releases all resources used by the Resolver | |
Register(Type) | ||
Register T | ||
RegisterInstance |
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 | |
RegisterSingleton(Type) | ||
RegisterSingleton T | ||
Resolve BaseType |
Fields
Name | Description | |
---|---|---|
alreadyRegisteredTypes | ||
ClickIgnoreToContinue | ||
ErrorWasCopiedToClipboardMessage |
Properties
Name | Description | |
---|---|---|
IsAlreadyInitialized |
Remarks
Examples
[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