예제 #1
0
		public override void OnCreate( )
		{
			base.OnCreate( );

			PreferencesHelper.SetIsAuthenticated( ApplicationContext, true );
			PreferencesHelper.SetInstanceUrl( ApplicationContext, "http://192.168.108.219:57204/" );

			string instanceUrl = PreferencesHelper.GetIsAuthenticated( ApplicationContext ) ? PreferencesHelper.GetInstanceUrl( ApplicationContext ) : "todo";
			string consumerKey = CoreConfig.TestConsumerKey.ToString( );

			Container = new UnityContainer( );

			Container.RegisterInstance( RestService.For<IApi>( ApiHelper.GetHttpClient( instanceUrl, consumerKey ) ) );
			Container.RegisterType<IContactsDataSource, ContactsApiDataSource>( "ContactsRemoteDataSource" );
			Container.RegisterType<IGetContactsCallback, ContactsViewCallback>( );
			Container.RegisterType<IContactsDataSource, ContactsRepository>( new InjectionConstructor( new ResolvedParameter<IContactsDataSource>( "ContactsRemoteDataSource" ) ) );
		}