Ejemplo n.º 1
0
        public static ZlpDirectoryInfo CreateSubdirectory(this ZlpDirectoryInfo o, string name)
        {
            var path = ZlpPathHelper.Combine(o.FullName, name);

            ZlpIOHelper.CreateDirectory(path);
            return(new ZlpDirectoryInfo(path));
        }
        /// <summary>
        /// Deep-deletes the contents, but not the folder itself.
        /// </summary>
        public static void SafeDeleteDirectoryContents(
            string folderPath)
        {
            var info = new ZlpDirectoryInfo(folderPath);

            SafeDeleteDirectoryContents(info);
        }
 public static int Compare(
     ZlpFileOrDirectoryInfo one,
     ZlpDirectoryInfo two)
 {
     return(string.Compare(one.FullName.TrimEnd('\\'), two.FullName.TrimEnd('\\'),
                           StringComparison.OrdinalIgnoreCase));
 }
Ejemplo n.º 4
0
        public static ZlpDirectoryInfo CombineDirectory(this ZlpDirectoryInfo one, ZlpDirectoryInfo two)
        {
            if (one == null) return two;
            else if (two == null) return one;

            else return new ZlpDirectoryInfo(ZlpPathHelper.Combine(one.FullName, two.FullName));
        }
        /// <summary>
        /// Deep-deletes the contents, but not the folder itself.
        /// </summary>
        public static void SafeDeleteDirectoryContents(
            ZlpDirectoryInfo folderPath)
        {
            if (folderPath != null && folderPath.Exists)
            {
                foreach (var filePath in folderPath.GetFiles())
                {
                    SafeDeleteFile(filePath);
                }

                foreach (var childFolderPath in
                         folderPath.GetDirectories())
                {
                    SafeDeleteDirectoryContents(childFolderPath);

                    // If empty now, remove.
                    // Only for childs, not for the root.
                    if (childFolderPath.GetFiles().Length <= 0 &&
                        childFolderPath.GetDirectories().Length <= 0)
                    {
                        childFolderPath.Delete(true);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public static bool StartsWith(this ZlpDirectoryInfo folder1, string folder2)
        {
            var f1 = folder1?.FullName;

            return(!string.IsNullOrEmpty(f1) && !string.IsNullOrEmpty(folder2) &&
                   f1.TrimEnd('\\').ToLowerInvariant().StartsWith(folder2.TrimEnd('\\').ToLowerInvariant()));
        }
 // ReSharper restore SuggestBaseTypeForParameter
 public ZlpFileOrDirectoryInfo(
     // ReSharper disable SuggestBaseTypeForParameter
     ZlpDirectoryInfo info)
 {
     _preferedType = PreferedType.Directory;
     _fullPath = info.FullName;
     _originalPath = info.ToString();
 }
 /// <summary>
 /// Deep-deletes the contents, as well as the folder itself.
 /// </summary>
 public static void SafeDeleteDirectory(
     ZlpDirectoryInfo folderPath)
 {
     if (folderPath != null)
     {
         SafeDeleteDirectory(folderPath.FullName);
     }
 }
 public ZlpFileOrDirectoryInfo(
     // ReSharper disable SuggestBaseTypeForParameter
     ZlpDirectoryInfo info)
 // ReSharper restore SuggestBaseTypeForParameter
 {
     _preferedType = PreferedType.Directory;
     _fullPath     = info.FullName;
     _originalPath = info.ToString();
 }
Ejemplo n.º 10
0
 public long DirSize(ZlpDirectoryInfo d)
 {
     // Add file sizes.
     var fis = d.GetFiles();
     var size = fis.Sum(fi => fi.Length);
     // Add subdirectory sizes.
     var dis = d.GetDirectories();
     size += dis.Sum(di => DirSize(di));
     return size;
 }
Ejemplo n.º 11
0
        public static ZlpFileInfo CombineFile(this ZlpDirectoryInfo one, string two, string three, params string[] fours)
        {
            var result = CombineFile(one, two);

            result = CombineFile(result?.FullName, three);

            return(fours.Aggregate(result,
                                   (current, four) =>
                                   CombineFile(current?.FullName, four)));
        }
Ejemplo n.º 12
0
        public static ZlpDirectoryInfo CombineDirectory(this ZlpDirectoryInfo one,
            ZlpDirectoryInfo two,
            ZlpDirectoryInfo three,
            params ZlpDirectoryInfo[] fours)
        {
            var result = CombineDirectory(one, two);
            result = CombineDirectory(result, three);

            result = fours.Aggregate(result, CombineDirectory);
            return result;
        }
 public ZlpFileOrDirectoryInfo Combine(
     ZlpDirectoryInfo info)
 {
     return
         (new ZlpFileOrDirectoryInfo(
              ZlpPathHelper.Combine(
                  EffectiveDirectory.FullName,
                  // According to Reflector, "ToString()" returns the
                  // "OriginalPath". This is what we need here.
                  info.ToString())));
 }
Ejemplo n.º 14
0
        public static ZlpDirectoryInfo CombineDirectory(this ZlpDirectoryInfo one,
                                                        string two,
                                                        string three,
                                                        params string[] fours)
        {
            var result = CombineDirectory(one, two);

            result = CombineDirectory(result, three);

            result = fours.Aggregate(result, CombineDirectory);
            return(result);
        }
Ejemplo n.º 15
0
        public static ZlpFileInfo CombineFile(this ZlpDirectoryInfo one,
                                              ZlpFileInfo two,
                                              ZlpFileInfo three,
                                              params ZlpFileInfo[] fours)
        {
            var result = CombineFile(one, two);

            result = CombineFile(result == null ? null : result.FullName, three == null ? null : three.FullName);

            return(fours.Aggregate(result,
                                   (current, four) =>
                                   CombineFile(current == null ? null : current.FullName, four == null ? null : four.FullName)));
        }
Ejemplo n.º 16
0
        public static ZlpDirectoryInfo CheckExists(this ZlpDirectoryInfo folder)
        {
            if (folder == null)
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (!folder.Exists)
            {
                throw new Exception(string.Format(Resources.FolderNotFound, folder));
            }

            return(folder);
        }
Ejemplo n.º 17
0
        public static ZlpDirectoryInfo CheckCreate(this ZlpDirectoryInfo folder)
        {
            if (folder == null)
            {
                throw new ArgumentNullException(nameof(folder));
            }

            if (!folder.Exists)
            {
                folder.Create();
            }

            return(folder);
        }
Ejemplo n.º 18
0
        public void ConstructTreeDfs(Folder dir)
        {
            var directory = new ZlpDirectoryInfo(dir.Name);
            if (directory.Exists)
            {
                ZlpDirectoryInfo[] childDirs;
                try
                {
                    childDirs = directory.GetDirectories();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    return;
                }

                var childFolders = new Folder[childDirs.Length];
                for (var i = 0; i < childDirs.Length; i++)
                {
                    childFolders[i] = new Folder(childDirs[i].FullName);
                }
                dir.AddChildFolders(childFolders);

                var files = directory.GetFiles();
                var f = new File[files.Length];
                for (var i = 0; i < files.Length; i++)
                {
                    try
                    {
                        f[i] = new File(files[i].FullName, files[i].Length);
                    }
                    catch (Exception)
                    {

                        continue;
                    }
                }
                dir.AddFiles(f);
                if (DeepWalk)
                {
                    foreach (var item in childFolders)
                    {
                        ConstructTreeDfs(item);
                    }
                }
            }

        }
Ejemplo n.º 19
0
        public static ZlpDirectoryInfo CombineDirectory(this ZlpDirectoryInfo one, ZlpDirectoryInfo two)
        {
            if (one == null)
            {
                return(two);
            }
            else if (two == null)
            {
                return(one);
            }

            else
            {
                return(new ZlpDirectoryInfo(ZlpPathHelper.Combine(one.FullName, two.FullName)));
            }
        }
Ejemplo n.º 20
0
        public static bool EqualsNoCase(this ZlpDirectoryInfo o, string p)
        {
            if (o == null && p == null)
            {
                return(true);
            }
            else if (o == null || p == null)
            {
                return(false);
            }

            return(string.Equals(
                       o.FullName.TrimEnd('\\', '/'),
                       p.TrimEnd('\\', '/'),
                       StringComparison.InvariantCultureIgnoreCase));
        }
Ejemplo n.º 21
0
        private static void Main(string[] args)
        {
            var f1 = new ZlpFileInfo(@"C:\Ablage\test-only\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Ablage\Lalala.txt");
            f1.Directory.Create();
            f1.WriteAllText("lalala.");
            Console.WriteLine(f1.Length);

            new ZlpDirectoryInfo(@"C:\Ablage\test-only\").Delete(true);
            //f1.MoveToRecycleBin();


            var f = new ZlpFileInfo(@"C:\Ablage\Lalala.txt");
            f.WriteAllText("lalala.");
            f.MoveToRecycleBin();

            var d = new ZlpDirectoryInfo(@"C:\Ablage\LalalaOrdner");
            d.Create();
            d.MoveToRecycleBin();
        }
Ejemplo n.º 22
0
        public static ZlpFileInfo CombineFile(this ZlpDirectoryInfo one, string two)
        {
            if (one == null && two == null)
            {
                return(null);
            }
            else if (two == null)
            {
                return(null);
            }
            else if (one == null)
            {
                return(new ZlpFileInfo(two));
            }

            else
            {
                return(new ZlpFileInfo(ZlpPathHelper.Combine(one.FullName, two)));
            }
        }
 public static int Compare(
     ZlpDirectoryInfo one,
     string two)
 {
     return(new ZlpFileOrDirectoryInfo(one).Compare(two));
 }
 public static ZlpFileOrDirectoryInfo Combine(
     ZlpDirectoryInfo one,
     string two)
 {
     return(new ZlpFileOrDirectoryInfo(one).Combine(two));
 }
 public static int Compare(
     ZlpFileOrDirectoryInfo one,
     ZlpDirectoryInfo two)
 {
     return string.Compare(one.FullName.TrimEnd('\\'), two.FullName.TrimEnd('\\'), StringComparison.OrdinalIgnoreCase);
 }
Ejemplo n.º 26
0
 public ZlpDirectoryInfo(ZlpDirectoryInfo path)
 {
     FullName = path?.FullName;
 }
 public static bool SafeDirectoryExists(
     ZlpDirectoryInfo folderPath)
 {
     return(folderPath != null && SafeDirectoryExists(folderPath.FullName));
 }
 public static int Compare(
     ZlpDirectoryInfo one,
     string two)
 {
     return new ZlpFileOrDirectoryInfo(one).Compare(two);
 }
 public static void SafeCheckCreateDirectory(
     ZlpDirectoryInfo folderPath)
 {
     SafeCheckCreateDirectory(folderPath?.FullName);
 }
 public ZlpFileOrDirectoryInfo Combine(
     ZlpDirectoryInfo info)
 {
     return
         new ZlpFileOrDirectoryInfo(
             ZlpPathHelper.Combine(
                 EffectiveDirectory.FullName,
                 // According to Reflector, "ToString()" returns the 
                 // "OriginalPath". This is what we need here.
                 info.ToString()));
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Deep-deletes the contents, as well as the folder itself.
 /// </summary>
 public static void SafeDeleteDirectory(
     ZlpDirectoryInfo folderPath)
 {
     if (folderPath != null)
     {
         SafeDeleteDirectory(folderPath.FullName);
     }
 }
Ejemplo n.º 32
0
 public static string MakeAbsoluteTo(
     this ZlpFileInfo pathToMakeAbsolute,
     ZlpDirectoryInfo basePathToWhichToMakeAbsoluteTo)
 {
     return(ZlpPathHelper.GetAbsolutePath(pathToMakeAbsolute.FullName, basePathToWhichToMakeAbsoluteTo.FullName));
 }
Ejemplo n.º 33
0
 public static bool SafeDirectoryExists(
     ZlpDirectoryInfo folderPath)
 {
     return folderPath != null && SafeDirectoryExists(folderPath.FullName);
 }
Ejemplo n.º 34
0
    public override ExitCode compile()
    {
        if (inPlayground || inTest) {
          return base.compile();
        } else {
          var status = Console.batch("ant " + profile + " -buildfile build.xml", home: project);
          if (!status) return -1;

          println();
          println("Transplanting partest to " + donneeName() + "...");
          status = status && transplantDir("build/quick/classes/partest", "build/locker/classes/partest");
          status = status && transplantDir("build/quick/classes/library/scala/actors", "build/locker/classes/library/scala/actors");
          // status = status && transplantDir("build/pack/lib/scala-actors.jar/scala/actors", "build/locker/classes/library/scala/actors");
          status = status && transplantDir("build/quick/classes/scalap/scala/tools/scalap", "build/locker/classes/partest/scala/tools/scalap");
          status = status && transplantDir("build/quick/classes/scalacheck/org/scalacheck", "build/locker/classes/partest/org/scalacheck");
          status = status && transplantFile("build/pack/misc/scala-devel/plugins/continuations.jar", "build/locker/classes/continuations.jar");
          status = status && transplantDir("build/pack/misc/scala-devel/plugins/continuations.jar", "build/locker/classes/continuations");
          status = status && transplantDir("build/quick/classes/library/scala/util/continuations", "build/locker/classes/library/scala/util/continuations");
          status = status && transplantDir("lib/forkjoin.jar/scala/concurrent/forkjoin", "build/locker/classes/library/scala/concurrent/forkjoin");
          status = status && transplantDir("lib/forkjoin.jar/scala/concurrent/util", "build/locker/classes/library/scala/concurrent/util", overwrite: false);
          status = status && transplantDir("build/asm/classes/scala/tools/asm", "build/locker/classes/compiler/scala/tools/asm");
          status = status && transplantDir("lib/fjbg.jar/ch/epfl/lamp/fjbg", "build/locker/classes/compiler/ch/epfl/lamp/fjbg");
          status = status && transplantDir("lib/fjbg.jar/ch/epfl/lamp/util", "build/locker/classes/compiler/ch/epfl/lamp/util");
          status = status && transplantDir("lib/msil.jar/ch/epfl/lamp/compiler/msil", "build/locker/classes/compiler/ch/epfl/lamp/compiler/msil");
          status = status && transplantDir("lib/jline.jar/org/fusesource", "build/locker/classes/library/org/fusesource");
          status = status && transplantDir("lib/jline.jar/scala/tools/jline", "build/locker/classes/library/scala/tools/jline");

          if (status) {
        println();
        println("Calculating longest path lengths in " + donneeName() + "...");
        var locker = new ZlpDirectoryInfo(donnee().project + "\\build\\locker" );
        var classes = locker.GetFiles("*.class", SearchOption.AllDirectories).ToList();
        classes = classes.OrderByDescending(f => f.FullName.Length).ToList();
        classes = classes.Take(5).Concat(classes.Skip(5).Where(f => f.FullName.Length > 260)).ToList();
        classes.ForEach(f => println(String.Format("  * {0} {1}", f.FullName.Length, f.FullName)));
        if (classes[0].FullName.Length > 260) {
          println("WARNING: THERE ARE FILES WITH NAMES LONGER THAN 260 CHARACTERS, JVM WON'T BE ABLE TO LOAD THEM UNLESS THEY ARE PACKED INTO A JAR");
          //return -1;
        }

        println();
        status = status && donnee().packLockerIntoJars();

        // works around an infrastructure bug that I'm cba to fix right know
        // transplantFile(@"C:\Projects\scala-partest.jar", "/build/locker/lib/scala-partest.jar");
          }

          return status;
        }
    }
Ejemplo n.º 35
0
 public static void SafeCheckCreateDirectory(
     ZlpDirectoryInfo folderPath)
 {
     SafeCheckCreateDirectory(folderPath?.FullName);
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Deep-deletes the contents, but not the folder itself.
        /// </summary>
        public static void SafeDeleteDirectoryContents(
            ZlpDirectoryInfo folderPath)
        {
            if (folderPath != null && folderPath.Exists)
            {
                foreach (var filePath in folderPath.GetFiles())
                {
                    SafeDeleteFile(filePath);
                }

                foreach (var childFolderPath in
                    folderPath.GetDirectories())
                {
                    SafeDeleteDirectoryContents(childFolderPath);

                    // If empty now, remove.
                    // Only for childs, not for the root.
                    if (childFolderPath.GetFiles().Length <= 0 &&
                        childFolderPath.GetDirectories().Length <= 0)
                    {
                        childFolderPath.Delete(true);
                    }
                }
            }
        }
Ejemplo n.º 37
0
 public static string MakeRelativeTo(
     this ZlpFileInfo pathToMakeRelative,
     ZlpDirectoryInfo pathToWhichToMakeRelativeTo)
 {
     return ZlpPathHelper.GetRelativePath(pathToWhichToMakeRelativeTo.FullName, pathToMakeRelative.FullName);
 }
Ejemplo n.º 38
0
 public void MoveTo(ZlpDirectoryInfo destinationDirectoryPath)
 {
     ZlpIOHelper.MoveDirectory(_path, destinationDirectoryPath.FullName);
 }
Ejemplo n.º 39
0
 public static string MakeRelativeTo(
     this ZlpFileInfo pathToMakeRelative,
     ZlpDirectoryInfo pathToWhichToMakeRelativeTo)
 {
     return(ZlpPathHelper.GetRelativePath(pathToWhichToMakeRelativeTo.FullName, pathToMakeRelative.FullName));
 }
 public static ZlpFileOrDirectoryInfo Combine(
     ZlpDirectoryInfo one,
     string two)
 {
     return new ZlpFileOrDirectoryInfo(one).Combine(two);
 }
Ejemplo n.º 41
0
 public static bool StartsWith(this ZlpDirectoryInfo folder1, ZlpDirectoryInfo folder2)
 {
     return StartsWith(folder1, folder2?.FullName);
 }
 public int Compare(
     ZlpDirectoryInfo b)
 {
     return Compare(b.FullName);
 }
Ejemplo n.º 43
0
 public static bool IsSame(this ZlpDirectoryInfo folder1, ZlpDirectoryInfo folder2)
 {
     return IsSame(folder1, folder2?.FullName);
 }
Ejemplo n.º 44
0
		/// <summary>
		/// Checks and creates the folder if not yet exists.
		/// </summary>
		/// <param name="folderPath">The folder path.</param>
		/// <returns></returns>
		public static ZlpDirectoryInfo CheckCreateFolder(
			ZlpDirectoryInfo folderPath)
		{
			if ( folderPath != null && !folderPath.Exists )
			{
				folderPath.Create();
			}

			return folderPath;
		}
Ejemplo n.º 45
0
 public static bool IsSame(this ZlpDirectoryInfo folder1, ZlpDirectoryInfo folder2)
 {
     return(IsSame(folder1, folder2?.FullName));
 }
Ejemplo n.º 46
0
 public void MoveTo(ZlpDirectoryInfo destinationDirectoryPath)
 {
     ZlpIOHelper.MoveDirectory(FullName, destinationDirectoryPath.FullName);
 }
Ejemplo n.º 47
0
 public static bool IsSame(this ZlpDirectoryInfo folder1, string folder2)
 {
     return(ZlpPathHelper.AreSameFolders(folder1.FullName, folder2));
 }
Ejemplo n.º 48
0
 public static ZlpDirectoryInfo FromOther(ZlpDirectoryInfo path)
 {
     return(new ZlpDirectoryInfo(path));
 }
Ejemplo n.º 49
0
 public static bool StartsWith(this ZlpDirectoryInfo folder1, ZlpDirectoryInfo folder2)
 {
     return(StartsWith(folder1, folder2?.FullName));
 }
 public int Compare(
     ZlpDirectoryInfo b)
 {
     return(Compare(b.FullName));
 }
Ejemplo n.º 51
0
        public static bool EqualsNoCase(this ZlpDirectoryInfo o, ZlpDirectoryInfo p)
        {
            if (o == null && p == null) return true;
            else if (o == null || p == null) return false;

            return string.Equals(
                o.FullName.TrimEnd('\\', '/'),
                p.FullName.TrimEnd('\\', '/'),
                StringComparison.InvariantCultureIgnoreCase);
        }
Ejemplo n.º 52
0
 public static ZlpSplittedPath SplitPath(
     ZlpDirectoryInfo path)
 {
     return new ZlpFileOrDirectoryInfo(path).ZlpSplittedPath;
 }
Ejemplo n.º 53
0
 /// <summary>
 /// Deep-deletes the contents, but not the folder itself.
 /// </summary>
 public static void SafeDeleteDirectoryContents(
     string folderPath)
 {
     var info = new ZlpDirectoryInfo(folderPath);
     SafeDeleteDirectoryContents(info);
 }
Ejemplo n.º 54
0
 public static ZlpSplittedPath SplitPath(
     ZlpDirectoryInfo path)
 {
     return(new ZlpFileOrDirectoryInfo(path).ZlpSplittedPath);
 }
		/*
		/// <summary>
		/// Does the automatically add resource files.
		/// </summary>
		/// <param name="backgroundWorker">The background worker.</param>
		/// <param name="parentProjectFolder">The parent project folder.</param>
		/// <param name="fileGroupCount">The file group count.</param>
		/// <param name="fileCount">The file count.</param>
		/// <param name="folderPath">The folder path.</param>
		private void doAutomaticallyAddResourceFiles(
			BackgroundWorker backgroundWorker,
			ProjectFolder parentProjectFolder,
			ref int fileGroupCount,
			ref int fileCount,
			ZlpDirectoryInfo folderPath)
		{
			if (backgroundWorker.CancellationPending)
			{
				throw new OperationCanceledException();
			}

			// Omit hidden or system folders.
			if ((folderPath.Attributes & FileAttributes.Hidden) == 0 &&
				(folderPath.Attributes & FileAttributes.System) == 0)
			{
				var filePaths = folderPath.GetFiles(@"*.resx");

				if (filePaths.Length > 0)
				{
					FileGroup fileGroup = null;
					string previousBaseFileName = null;

					foreach (var filePath in filePaths)
					{
						if (backgroundWorker.CancellationPending)
						{
							throw new OperationCanceledException();
						}

						var baseFileName =
							filePath.Name.Substring(0, filePath.Name.IndexOf('.'));

						var wantAddResourceFile =
							checkWantAddResourceFile(filePath);

						if (wantAddResourceFile)
						{
							if (fileGroup == null ||
								previousBaseFileName == null ||
								string.Compare(baseFileName, previousBaseFileName, true) != 0)
							{
								if (fileGroup != null && fileGroup.Count > 0)
								{
									// Look for same entries.
									if (!_project.FileGroups.HasFileGroupWithChecksum(
											fileGroup.GetChecksum(_project)))
									{
										_project.FileGroups.Add(fileGroup);

										fileGroupCount++;
										fileCount += fileGroup.Count;
									}
								}

								fileGroup =
									new FileGroup(_project)
									{
										ProjectFolder = parentProjectFolder
									};
							}

							fileGroup.Add(
								new FileInformation(fileGroup)
									{
										File = filePath
									});

							previousBaseFileName = baseFileName;
						}
					}

					// Add remaining.
					if (fileGroup != null && fileGroup.Count > 0)
					{
						// Look for same entries.
						if (!_project.FileGroups.HasFileGroupWithChecksum(
								fileGroup.GetChecksum(_project)))
						{
							_project.FileGroups.Add(fileGroup);

							fileGroupCount++;
							fileCount += fileGroup.Count;
						}
					}
				}
			}

			// Recurse childs.
			foreach (var childFolderPath in folderPath.GetDirectories())
			{
				doAutomaticallyAddResourceFiles(
					backgroundWorker,
					parentProjectFolder,
					ref fileGroupCount,
					ref fileCount,
					childFolderPath);
			}
		}
		*/

		private void doAutomaticallyAddResourceFiles(
			BackgroundWorker backgroundWorker,
			ProjectFolder parentProjectFolder,
			ref int fileGroupCount,
			ref int fileCount,
			ZlpDirectoryInfo folderPath)
		{
			if (backgroundWorker.CancellationPending)
			{
				throw new OperationCanceledException();
			}

			// Omit hidden or system folders.
			if ((folderPath.Attributes & ZetaLongPaths.Native.FileAttributes.Hidden) == 0 &&
				(folderPath.Attributes & ZetaLongPaths.Native.FileAttributes.System) == 0)
			{
				//CHANGED use comon method to look load new files:

				var filePaths = new List<ZlpFileInfo>(folderPath.GetFiles(@"*.resx"));
				filePaths.AddRange(new List<ZlpFileInfo>(folderPath.GetFiles(@"*.resw")));

				new VisualStudioImporter(Project).
					DoAutomaticallyAddResourceFilesFromList(
						backgroundWorker,
						parentProjectFolder,
						ref fileGroupCount,
						ref fileCount,
						filePaths);
			}

			// Recurse childs.
			foreach (var childFolderPath in folderPath.GetDirectories())
			{
				doAutomaticallyAddResourceFiles(
					backgroundWorker,
					parentProjectFolder,
					ref fileGroupCount,
					ref fileCount,
					childFolderPath);
			}
		}