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

UpdateProjectsLocation() private static méthode

Updates the projects default directory.
private static UpdateProjectsLocation ( string newFolderForProjects, FwApp fwApp, string projectPath ) : void
newFolderForProjects string The new folder for projects.
fwApp FwApp used to get parent window of dialog
projectPath string path to the current project
Résultat void
		private static void UpdateProjectsLocation(string newFolderForProjects, FwApp fwApp,
			string projectPath)
		{
			if (newFolderForProjects == null || newFolderForProjects == FwDirectoryFinder.ProjectsDirectory ||
				!FileUtils.EnsureDirectoryExists(newFolderForProjects))
				return;

			bool fMoveFiles;
			using (var dlg = new MoveProjectsDlg(fwApp))
			{
				fMoveFiles = dlg.ShowDialog(fwApp.ActiveMainWindow) == DialogResult.Yes;
			}
			string oldFolderForProjects = FwDirectoryFinder.ProjectsDirectory;
			try
			{
				FwDirectoryFinder.ProjectsDirectory = newFolderForProjects;
			}
			catch (Exception)
			{
				MessageBox.Show(Form.ActiveForm, Properties.Resources.ksChangeProjectLocationFailedDetails,
					Properties.Resources.ksChangeProjectLocationFailed, MessageBoxButtons.OK, MessageBoxIcon.Error);
				return; // don't move files!!
			}
			if (fMoveFiles)
			{
				var oldProjectId = (ProjectId)Cache.ProjectId;
				ExecuteWithAllFwProcessesShutDown(GetCommandLineAbbrevForAppName(fwApp.ApplicationName),
					() => MoveProjectFolders(oldFolderForProjects, newFolderForProjects, projectPath, oldProjectId));
			}
		}
FieldWorks