No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

AbstractFilesAndDirParser.cs

Description du code

AbstractFilesAndDirParser.cs est un fichier du projet BrolDev.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/broldev/src/.

Projet BrolDev : Librairie de composants réutilisables pour les applications BrolDev en CSharp.

Code source ou contenu du fichier

  1. using System;
  2. using System.ComponentModel;
  3. using System.IO;
  4. using be.gaudry.model.enums;
  5.  
  6. namespace be.gaudry.model.file
  7. {
  8. public abstract class AbstractFilesAndDirParser : AbstractFileParser
  9. {
  10. #region methods to implement
  11. /// <summary>
  12. /// Do something on each directory
  13. /// </summary>
  14. /// <param name="bgw">BackgroundWorker to perform cancel if needed, and report progress</param>
  15. /// <param name="e">DoWorkEventArgs to perform cancel if needed, and report progress</param>
  16. /// <param name="di">DirectoryInfo to check</param>
  17. /// <returns>
  18. /// true if we must stop the parsing of current directory (ie. if we have a vob file, we don't check the other files in this directory)
  19. /// false otherwise
  20. ///</returns>
  21. protected abstract bool performOnDirectory(BackgroundWorker bgw, DoWorkEventArgs e, DirectoryInfo di);
  22. #endregion
  23.  
  24. #region private methods
  25. /// <summary>
  26. ///
  27. /// </summary>
  28. /// <param name="bgw">BackgroundWorker to perform cancel if needed, and report progress</param>
  29. /// <param name="e">DoWorkEventArgs to perform cancel if needed, and report progress</param>
  30. /// <param name="dirsInf">DirectoryInfo to get size</param>
  31. /// <param name="subDirDeep">Deep of the directory in comparison with start directory</param>
  32. protected internal new void parseFiles(BackgroundWorker bgw, DoWorkEventArgs e, DirectoryInfo dirsInf, int subDirDeep)
  33. {
  34. if (bgw.CancellationPending)
  35. {
  36. e.Cancel = true;
  37. }
  38. else
  39. {
  40. bgw.ReportProgress((int)BGWORKER.currentInfo, dirsInf.Name);
  41. try
  42. {
  43. FileInfo[] filesInf = dirsInf.GetFiles();
  44. foreach (FileInfo fi in filesInf)
  45. {
  46. progressToDo -= fi.Length;
  47. // add length to avoid calculate progressMax each time
  48. if (!validPreviousProgress)
  49. {
  50. progressMax += fi.Length;
  51. }
  52. if (perform(bgw, e, fi, subDirDeep))
  53. {
  54. break;
  55. }
  56. }
  57. }
  58. catch (Exception) { }
  59. if (includeSubFolders)
  60. {
  61. try
  62. {
  63. subDirDeep++;
  64. foreach (DirectoryInfo dir in dirsInf.GetDirectories())
  65. {
  66. parseFiles(bgw, e, dir, subDirDeep);
  67. }
  68. }
  69. catch (Exception) { }
  70. }
  71. performOnDirectory(bgw, e, dirsInf);
  72. }
  73. }
  74. #endregion
  75. }
  76. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/model/file/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1713997648 25/04/2024 00:27:28
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/model/file/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csAbstractFileParser.cs9.32 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csFileHelper.cs9.48 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csAbstractFilesAndDirParser.cs2.97 Ko31/10/2018 18:33:10-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 16/10/2009, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/cs-broldev-source-rf-model/file/AbstractFilesAndDirParser.cs.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.