using Android.App;
using Android.Content;
using Borepin.Service;
using FabAccessAPI;

namespace Borepin.Droid.Services
{
    public class APIService_New : IAPIService
    {
        #region Private Members
        private readonly APIServiceConnection _APIServiceConnection;
        #endregion

        #region Constructors
        public APIService_New()
        {
            Context context = Application.Context;
            Intent service = new Intent(context, typeof(APIBindedService));
            context.BindService(service, _APIServiceConnection, Bind.AutoCreate);
        }
        #endregion

        public IAPI GetAPI()
        {
            return _APIServiceConnection?.Binder?.Service?.GetAPI();
        }
    }
}