using System.Reflection; using Artemis.UI.Shared.Routing; using Artemis.UI.Shared.Services; using DryIoc; namespace Artemis.UI.Shared.DryIoc; /// /// Provides an extension method to register services onto a DryIoc . /// public static class ContainerExtensions { /// /// Registers shared UI services into the container. /// /// The builder building the current container public static void RegisterSharedUI(this IContainer container) { container.Register(Reuse.Singleton); Assembly artemisShared = typeof(IArtemisSharedUIService).GetAssembly(); container.RegisterMany(new[] {artemisShared}, type => type.IsAssignableTo(), Reuse.Singleton); UI.Locator = container; } }