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

OpenExistingProject() static private méthode

Opens the specified project. This may start a new FieldWorks.exe process to handle the project if no FieldWorks processes are running for the specified project.
static private OpenExistingProject ( SIL.FieldWorks.ProjectId projectId, FwApp app, Form wndCopyFrom ) : bool
projectId SIL.FieldWorks.ProjectId The project id.
app SIL.FieldWorks.Common.Framework.FwApp The app.
wndCopyFrom System.Windows.Forms.Form The window to copy from (optional).
Résultat bool
		internal static bool OpenExistingProject(ProjectId projectId, FwApp app, Form wndCopyFrom)
		{
			if (projectId == null)
				throw new ArgumentNullException("projectId");
			if (app != s_flexApp && app != s_teApp)
				throw new ArgumentException("Invalid application", "app");

			if (projectId.Equals(s_projectId))
			{
				// We're trying to open this same project. Just open a new window for the
				// specified application
				return CreateAndInitNewMainWindow(app, false, wndCopyFrom, false);
			}

			string sAppAbbrev = GetCommandLineAbbrevForAppName(app.ApplicationName);
			if (TryFindExistingProcess(projectId, new FwAppArgs(sAppAbbrev, projectId.Handle,
				projectId.ServerName, null, Guid.Empty)))
			{
				Logger.WriteEvent("Found existing FieldWorks.exe for project " + projectId.UiName + ". BEP:" + projectId.Type);
				return true; // Found another process for this project, so we're done.
			}

			return OpenProjectWithNewProcess(projectId, sAppAbbrev) != null;
		}
FieldWorks