public IReadOnlyList<string> UnsavedChanges() { var args = new ClosingEventArgs(); Logging.Debug(args); Closing?.Invoke(this, args); Logging.Debug(args.UnsavedDisplayNames.JoinToString(";")); return args.UnsavedDisplayNames; }
public void Closing(object sender, ClosingEventArgs e) { if (pivot.SelectedItem != null && pivot.SelectedItem is PivotItem) { PivotItem selectedItem = (PivotItem)pivot.SelectedItem; if (selectedItem.Content != null && selectedItem.Content is NavigationPanel) { ((NavigationPanel)selectedItem.Content).Closing(sender, e); } } }
void MainWindowClosing(object sender, ClosingEventArgs e) { if (actuallyClosing) return; e.Cancel = true; Execute.OnUIThread(() => { var shell = IoC.Get<IShell>(); shell.CanClose(result => { if(result) { actuallyClosing = true; mainWindow.Close(); } }); }); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { Debug.WriteLine("CLOSING"); using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (myIsolatedStorage.FileExists(SerialStore)) { myIsolatedStorage.DeleteFile(SerialStore); } } }
// when app gets tombstoned, user press back past first page async void OnClosing(object sender, ClosingEventArgs e) { // populate isolated storage. //SerializePropertyStore (); await _application.SendSleepAsync(); }
protected override void OnClose(object sender, ClosingEventArgs e) { // When the application closes, delete any deactivation settings from isolated storage RemoveCurrentDeactivationSettings(); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { LogInstance.LogInfo("Application is closing"); }
void AppClosing(object sender, ClosingEventArgs e) { //Debug.WriteLine("AppClosing"); }
/// <summary> /// Closes this object. /// </summary> /// <returns>True if the object was closed, otherwise false.</returns> protected internal bool Close(UserInteraction interactive, CloseReason reason) { // easy case - bail if interaction is prohibited and we can't close without interacting if (interactive == UserInteraction.NotAllowed && !CanClose()) return false; // either we can close without interacting, or interaction is allowed, so let's try and close // begin closing - the operation may yet be cancelled _state = DesktopObjectState.Closing; ClosingEventArgs args = new ClosingEventArgs(reason, interactive); OnClosing(args); if (args.Cancel || !PrepareClose(reason)) { _state = DesktopObjectState.Open; return false; } _view.CloseRequested -= OnViewCloseRequested; _view.VisibleChanged -= OnViewVisibleChanged; _view.ActiveChanged -= OnViewActiveChanged; // notify inactive this.Active = false; try { // close the view _view.Dispose(); } catch (Exception e) { Platform.Log(LogLevel.Error, e); } _view = null; // close was successful _state = DesktopObjectState.Closed; OnClosed(new ClosedEventArgs(reason)); // dispose of this object after firing the Closed event // (reason being that handlers of the Closed event may expect this object to be intact) (this as IDisposable).Dispose(); return true; }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { this.RelayContext.SaveToStorage(); }
private void AppClosing(object sender, ClosingEventArgs e) { XLog.WriteInfo(" AppClosing"); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { change_tile(); //Obtain a virtual store for application IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication(); //Create new subdirectory fileStorage.CreateDirectory("textFiles"); //Create a new StreamWriter, to write the file to the specified location. StreamWriter fileWriter = new StreamWriter(new IsolatedStorageFileStream("textFiles\\newText.txt", FileMode.OpenOrCreate, fileStorage)); //Write the contents of our TextBox to the file. if (Pivot.proba) fileWriter.WriteLine(Pivot.loginn+","+Pivot.passs); else fileWriter.WriteLine(",");///////////////////////////////////////////////////////////////////////////////////////////////////////////// // MessageBox.Show("hard ending!"); //Close the StreamWriter. fileWriter.Close(); }
public void Closing(object sender, ClosingEventArgs e) { }
static void Application_Closing(object sender, ClosingEventArgs e) { Utils.log("Application_Closing"); //Disable event manager EventManager.setEnabled(false); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { MessengerInstance.Send<MediaPlayerStopMessage>( new MediaPlayerStopMessage()); logger.Info("Application closed"); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated public virtual void OnClosing(object sender, ClosingEventArgs e) { }
/// <summary> /// Raises the <see cref="Closing"/> event. /// </summary> protected virtual void OnClosing(ClosingEventArgs args) { EventsHelper.Fire(_closing, this, args); }
private void Application_Closing(object sender, ClosingEventArgs e) { EcosModel.Disconnect(); SaveProfiles(); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { // Ensure that required application state is persisted here. }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { App.UseGps = false; Settings.stopGPSLocationService(); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { RHODESAPP().stopApp(); // m_logThread.CancelAsync(); }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { MessageBoxResult result = MessageBox.Show("Encerrar aplicação?", "Sair", MessageBoxButton.OKCancel); switch (result) { case MessageBoxResult.OK: break; case MessageBoxResult.Cancel: break; } }
// Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { Roster.Save(); Settings.Save(); }