/// <summary> /// Main form closing event handler. /// Disconnect from the current protocol. /// /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">The event arguments.</param> private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { try { Facade facade = Facade.GetInstance(); facade.SaveAllMailMessages(); facade.Disconnect(); } catch (Exception) { } }