SIL.FieldWorks.FieldWorks.GracefullyShutDown C# (CSharp) Метод

GracefullyShutDown() статический приватный Метод

Attempts to shut down as nicely as possible. Typically this method doesn't do anything when the application is shut down normally (e.g. the user has closed all of the open main windows) because the applications will have already been disposed of. Thus, any exceptions that are thrown are ignored by this method as there is no guarantee that the application is in a valid state.
Any exeptions that are thrown are logged to the log file.
static private GracefullyShutDown ( ) : void
Результат void
		internal static void GracefullyShutDown()
		{
			// Give any open main windows a chance to close normally before being forcibly
			// disposed.
			CloseAllMainWindowsForApp(s_teApp);
			CloseAllMainWindowsForApp(s_flexApp);

			// Its quite possible that there are some important messages to process.
			// (e.g., an FwApp.RemoveWindow asynchronous call from FwMainWnd.Dispose)
			// These need to be handled before we shut down the applications or race conditions
			// might occur. (FWR-1687)
			ExceptionHelper.LogAndIgnoreErrors(Application.DoEvents);

			GracefullyShutDownApp(s_teApp);
			GracefullyShutDownApp(s_flexApp);

			// If FieldWorks was in app server mode, there is a chance that the apps could have
			// already been shut down, but the cache is still running. In this case, we need
			// to shut down the cache explicitly.
			ExitCleanly();

			if (!s_noUserInterface)
			{
				Debug.Assert(s_teApp == null, "The TE app did not get properly cleaned up");
				Debug.Assert(s_flexApp == null, "The FLEx app did not get properly cleaned up");
				Debug.Assert(s_cache == null, "The cache did not get properly cleaned up");
			}
		}
FieldWorks