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

MustCopyFoldersAndFiles() private static méthode

Check whether we must copy the project folders and files because the new Projects folder is on a different device than the old Projects folder.
private static MustCopyFoldersAndFiles ( string oldFolderForProjects, string newFolderForProjects ) : bool
oldFolderForProjects string
newFolderForProjects string
Résultat bool
		private static bool MustCopyFoldersAndFiles(string oldFolderForProjects, string newFolderForProjects)
		{
			List<string> driveMounts = GetDriveMountList();
			var oldPath = oldFolderForProjects;
			if (!Path.IsPathRooted(oldPath))
			{
				try   { oldPath = Path.GetFullPath(oldPath); }
				catch { return true; }		// better safe than sorry if we can't tell the drives
			}
			var newPath = newFolderForProjects;
			if (!Path.IsPathRooted(newPath))
			{
				try   { newPath =  Path.GetFullPath(newPath); }
				catch { return true; }
			}
			string oldRoot = null;
			string newRoot = null;
			if (!MiscUtils.IsUnix)
			{
				oldPath = oldPath.ToLowerInvariant();
				newPath = newPath.ToLowerInvariant();
			}
			for (var i = 0; i < driveMounts.Count; ++i)
			{
				var mount = driveMounts[i];
				if (oldRoot == null && oldPath.StartsWith(mount))
					oldRoot = mount;
				if (newRoot == null && newPath.StartsWith(mount))
					newRoot = mount;
				if (oldRoot != null && newRoot != null)
					return oldRoot != newRoot;
			}
			return true;	// shouldn't ever get here, but be safe if we do.
		}
FieldWorks