示例#1
0
 private void Connectivity_ConnectivityChanged(object sender, Xamarin.Essentials.ConnectivityChangedEventArgs e)
 {
     if (e.NetworkAccess != NetworkAccess.Internet)
     {
         _offlineManager = null;
         _offlineManager = OfflineManager.GetInstance(Application.Context);
     }
 }
        private Task <OfflineTilePyramidRegionDefinition> GetDefinition()
        {
            var tcs = new TaskCompletionSource <OfflineTilePyramidRegionDefinition>();

            OfflineManager.GetInstance(_context).ListOfflineRegions(new OfflineRegionCallback()
            {
                OnListCallback = regions =>
                {
                    tcs.SetResult(regions.Last().Definition as OfflineTilePyramidRegionDefinition);
                }
            });

            return(tcs.Task);
        }
示例#3
0
 public OfflineStorageService()
 {
     offlineManager = OfflineManager.GetInstance(Android.App.Application.Context);
     RunningTasks   = new List <TaskCompletionSource <OfflinePack> >();
 }
示例#4
0
 public MapBoxOfflineService()
 {
     _offlineManager = OfflineManager.GetInstance(Application.Context);
     Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged;
 }
 public OfflineStorageService()
 {
     offlineManager = OfflineManager.GetInstance(Android.App.Application.Context);
 }