Table of Contents

Class InjectorLocator

Namespace
Switchboard
Assembly
Switchboard.InjectorLocator.dll

A static service locator that provides an IInjector.

public static class InjectorLocator
Inheritance
InjectorLocator

Methods

AssignLocatorDelegate(Func<IInjector>)

Assigns the delegate that provides the IInjector instance.

public static void AssignLocatorDelegate(Func<IInjector> locatorDelegate)

Parameters

locatorDelegate Func<IInjector>

The delegate to set as the IInjector locator.

Exceptions

ArgumentNullException

Thrown if the locatorDelegate is null.

InvalidOperationException

Thrown if the locator delegate is already assigned.

GetInjector()

Provides an IInjector by invoking the locator delegate.

public static IInjector GetInjector()

Returns

IInjector

Returns the result of invoking the assigned IInjector locator delegate.

RemoveLocatorDelegate(Func<IInjector>)

Removes the current IInjector locator delegate if it matches the locatorDelegate argument.

public static void RemoveLocatorDelegate(Func<IInjector> locatorDelegate)

Parameters

locatorDelegate Func<IInjector>

The IInjector locator delegate to be removed.

Exceptions

ArgumentNullException

Thrown if the locatorDelegate is null.