using Android.Content;
using Android.OS;
using FabAccessAPI;

namespace Borepin.Droid.Services
{
    class APIServiceConnection : Java.Lang.Object, IServiceConnection
    {
        #region Members
        public bool IsConnected
        {
            get
            {
                return Binder != null;
            }
        }
        public APIBinder Binder { get; private set; } = null;
        #endregion

        #region Methods
        public void OnServiceConnected(ComponentName name, IBinder service)
        {
            Binder = service as APIBinder;
        }

        public void OnServiceDisconnected(ComponentName name)
        {
            Binder = null;
        }
        #endregion
    }
}