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(); }
protected override async void OnExit(ExitEventArgs e) { base.OnExit(e); AudioPlayer.Instance.Dispose(); await BlobCache.Shutdown(); }
public App() { Directory.CreateDirectory(AppDataFolderPath); this.Events().Exit .SelectMany(_ => Observable.FromAsync(() => BlobCache.Shutdown())) .Subscribe(); }
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; } }
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(); } }
protected override void OnSleep() { BlobCache.Shutdown().Wait(); }
protected override void OnDestroy() { BlobCache.Shutdown().Wait(); base.OnDestroy(); }
private void CleanUp() { BlobCache.Shutdown().Wait(); this.mutex.ReleaseMutex(); this.mutex.Dispose(); }
protected override void OnSleep() { // Handle when your app sleeps BlobCache.Shutdown().Wait(); }
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(); }
public static void Shutdown() => BlobCache.Shutdown().Wait();
public override void WillTerminate(UIApplication application) { BlobCache.Shutdown().Wait(); }
private void _timer_Tick(object sender, EventArgs e) { _count++; BlobCache.Shutdown().Wait(); RestartApplication(); }
private void ApplicationExit(object sender, ExitEventArgs e) { BlobCache.Shutdown().Wait(); }
public void Shutdown() { BlobCache.Shutdown().Wait(); }
protected override void OnExit(ExitEventArgs e) { base.OnExit(e); BlobCache.Shutdown().Wait(); }
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(); }
public override void WillTerminate(UIApplication uiApplication) { BlobCache.Shutdown(); base.WillTerminate(uiApplication); }
public static async Task ShutdownAsync() { await BlobCache.Shutdown(); }