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

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

Executes the requested action with ALL FW applications temporarily shut down and then (re)starts the applications in a sensible order. At the end, we're guaranteed to have at least one app started or FieldWorks will be shut down.
private static ExecuteWithAllFwProcessesShutDown ( string abbrevOfDefaultAppToStart, Func action ) : void
abbrevOfDefaultAppToStart string The abbreviation of the default application /// to start.
action Func The action to execute.
Результат void
		private static void ExecuteWithAllFwProcessesShutDown(string abbrevOfDefaultAppToStart,
			Func<ProjectId> action)
		{
			s_fSingleProcessMode = true;
			try
			{
				// Try to shut down other instances of FieldWorks gracefully so that their data
				// folders can be moved.
				RunOnRemoteClients(kFwRemoteRequest, requestor => requestor.CloseAllMainWindows());
				List<Process> processes = ExistingProcesses;
				foreach (Process proc in processes)
				{
					if (!proc.HasExited)
						proc.CloseMainWindow();
					if (!proc.HasExited)
					{
						proc.Kill();
						proc.WaitForExit();
					}
					proc.Close();
				}
				ExecuteWithAppsShutDown(abbrevOfDefaultAppToStart, action);
			}
			finally
			{
				s_fSingleProcessMode = false;
			}
		}
FieldWorks