Ejemplo n.º 1
0
 public static object Get(Type serviceType)
 {
     try
     {
         return(IttyBittyIoC.Resolve(serviceType));
     }
     catch (Exception)
     {
         Log.Error("ServiceLocatorGet", "Unable to resolve type: " + serviceType.Name);
         throw;
     }
 }
Ejemplo n.º 2
0
        static ServiceLocator()
        {
            // services/repositories
            IttyBittyIoC.Register <Context>(() => Context);
            IttyBittyIoC.Register <IStockDataProvider, YahooStockDataProvider>();
            IttyBittyIoC.Register <IPortfolioRepository, AndroidSqlitePortfolioRepository>();
            IttyBittyIoC.Register <IPortfolioService, PortfolioService>();
            IttyBittyIoC.Register <IConfigRepository, AndroidSqliteConfigRepository>();

            // presenters
            IttyBittyIoC.Register <IMainPresenter, MainPresenter>();
            IttyBittyIoC.Register <IPortfolioPresenter, PortfolioPresenter>();
            IttyBittyIoC.Register <IEditPortfolioPresenter, EditPortfolioPresenter>();
            IttyBittyIoC.Register <IEditPositionPresenter, EditPositionPresenter>();
            IttyBittyIoC.Register <IConfigPresenter, ConfigPresenter>();
        }