using System; using Android.Content; using Android.Util; using MonoStockPortfolio.Activites.ConfigScreen; using MonoStockPortfolio.Activites.EditPortfolioScreen; using MonoStockPortfolio.Activites.EditPositionScreen; using MonoStockPortfolio.Activites.MainScreen; using MonoStockPortfolio.Activites.PortfolioScreen; using MonoStockPortfolio.Core.Config; using MonoStockPortfolio.Core.PortfolioRepositories; using MonoStockPortfolio.Core.Services; using MonoStockPortfolio.Core.StockData; namespace MonoStockPortfolio.Framework { public static class ServiceLocator { public static Context Context { get; set; } static ServiceLocator() { // services/repositories IttyBittyIoC.Register(() => Context); IttyBittyIoC.Register(); IttyBittyIoC.Register(); IttyBittyIoC.Register(); IttyBittyIoC.Register(); // presenters IttyBittyIoC.Register(); IttyBittyIoC.Register(); IttyBittyIoC.Register(); IttyBittyIoC.Register(); IttyBittyIoC.Register(); } public static object Get(Type serviceType) { try { return IttyBittyIoC.Resolve(serviceType); } catch (Exception) { Log.Error("ServiceLocatorGet", "Unable to resolve type: " + serviceType.Name); throw; } } } }