SIL.FieldWorks.FieldWorks.CloseAllMainWindowsForApp C# (CSharp) Méthode

CloseAllMainWindowsForApp() private static méthode

Closes all main windows for the specified application ignoring any errors that occur.
private static CloseAllMainWindowsForApp ( FwApp app ) : void
app SIL.FieldWorks.Common.Framework.FwApp The application.
Résultat void
		private static void CloseAllMainWindowsForApp(FwApp app)
		{
			if (app == null)
				return;
			foreach (Form mainWnd in app.MainWindows.OfType<Form>())
			{
				if (mainWnd.IsDisposed)
					continue;	// This can happen in renaming.
				// This is typically used if an exception happens to gracefully close any
				// open main windows so we need to ignore any errors because we have no
				// idea what state the application is in.
				Form wnd = mainWnd;
				mainWnd.Invoke((Action) (() => ExceptionHelper.LogAndIgnoreErrors(wnd.Close)));
			}
		}
		#endregion
FieldWorks