Example #1
0
        protected override void OnExit(object sender, EventArgs e)
        {
            this.Log().Info("Starting Espera shutdown");

            this.Log().Info("Shutting down the library");
            Locator.Current.GetService <Library>().Dispose();

            this.Log().Info("Shutting down BlobCaches");
            BlobCache.Shutdown().Wait();
            var requestCache = Locator.Current.GetService <IBlobCache>(BlobCacheKeys.RequestCacheContract);

            requestCache.InvalidateAll().Wait();
            requestCache.Dispose();
            requestCache.Shutdown.Wait();

            this.Log().Info("Shutting down NLog");
            NLog.LogManager.Shutdown();

            if (this.mobileApi != null)
            {
                this.Log().Info("Shutting down mobile API");
                this.mobileApi.Dispose();
            }

            this.Log().Info("Shutting down analytics client");
            AnalyticsClient.Instance.Dispose();

            this.Log().Info("Shutdown finished");
        }
 public void Cleanup_Akavache()
 {
     BlobCache.Secure.InvalidateAll();
     BlobCache.UserAccount.InvalidateAll();
     BlobCache.LocalMachine.InvalidateAll();
     BlobCache.Shutdown().Wait();
 }
Example #3
0
        protected override async void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);

            AudioPlayer.Instance.Dispose();
            await BlobCache.Shutdown();
        }
Example #4
0
        public App()
        {
            Directory.CreateDirectory(AppDataFolderPath);

            this.Events().Exit
            .SelectMany(_ => Observable.FromAsync(() => BlobCache.Shutdown()))
            .Subscribe();
        }
Example #5
0
 protected override void OnSleep()
 {
     BlobCache.Shutdown().Wait();
     MessagingCenter.Unsubscribe <ILoginViewModel, bool>(this, "LoginStatus");
     MessagingCenter.Unsubscribe <ILogoutPage>(this, "LogMeOut");
     MessagingCenter.Unsubscribe <ITermsPage>(this, "mTermsAgreed");
     CrossConnectivity.Current.ConnectivityChanged -= ConnectionError;
     // Handle when your app sleeps
 }
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    cache = null;
                    BlobCache.Shutdown().Wait();
                }

                // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                // TODO: set large fields to null
                disposedValue = true;
            }
        }
Example #7
0
        protected override void OnDestroy()
        {
            try
            {
                this.disposer?.Dispose();
                this.disposer = null;

                //卸载广播
                UnregisterReceiver(screenStateReceiver);

                //BlobCache.Shutdown()方法对 Akavache 缓存的完整性至关重要。
                //当您的应用程序关闭时,您必须调用它。而且,一定要等待结果:
                //不这样做可能意味着排队的项目不会刷新到缓存中。
                BlobCache.Shutdown().Wait();
            }
            catch (System.Exception) { }
            finally
            {
                base.OnDestroy();
            }
        }
Example #8
0
 protected override void OnSleep()
 {
     BlobCache.Shutdown().Wait();
 }
Example #9
0
 protected override void OnDestroy()
 {
     BlobCache.Shutdown().Wait();
     base.OnDestroy();
 }
Example #10
0
 private void CleanUp()
 {
     BlobCache.Shutdown().Wait();
     this.mutex.ReleaseMutex();
     this.mutex.Dispose();
 }
Example #11
0
 protected override void OnSleep()
 {
     // Handle when your app sleeps
     BlobCache.Shutdown().Wait();
 }
Example #12
0
 public override void WillTerminate(UIApplication application)
 {
     // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
     BlobCache.Shutdown().Wait();
 }
 public async Task Shutdown()
 {
     await BlobCache.Shutdown();
 }
Example #14
0
 public static void Shutdown() => BlobCache.Shutdown().Wait();
Example #15
0
 public override void WillTerminate(UIApplication application)
 {
     BlobCache.Shutdown().Wait();
 }
 private void _timer_Tick(object sender, EventArgs e)
 {
     _count++;
     BlobCache.Shutdown().Wait();
     RestartApplication();
 }
Example #17
0
 private void ApplicationExit(object sender, ExitEventArgs e)
 {
     BlobCache.Shutdown().Wait();
 }
Example #18
0
 public void Shutdown()
 {
     BlobCache.Shutdown().Wait();
 }
 protected override void OnExit(ExitEventArgs e)
 {
     base.OnExit(e);
     BlobCache.Shutdown().Wait();
 }
Example #20
0
 protected override void OnExiting(object sender, EventArgs args)
 {
     level?.SaveGame();
     BlobCache.Shutdown().Wait();
     base.OnExiting(sender, args);
 }
 public override void OnTerminate()
 {
     base.OnTerminate();
     BlobCache.Shutdown().Wait();
 }
Example #22
0
 public override void WillTerminate(UIApplication uiApplication)
 {
     BlobCache.Shutdown();
     base.WillTerminate(uiApplication);
 }
Example #23
0
 public static async Task ShutdownAsync()
 {
     await BlobCache.Shutdown();
 }