Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

PluginsManager.cs

Description du code

PluginsManager.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.Collections.Generic;
  2. using System.IO;
  3. using be.gaudry.model.enums;
  4.  
  5. namespace be.gaudry.model.config
  6. {
  7. public class PluginsManager
  8. {
  9.  
  10. #region declarations
  11. private Dictionary<PLUGIN, Plugin> plugins;
  12. private bool
  13. brolexplorerPlgAvailable,
  14. photobrolPlgAvailable,
  15. renamerPlgAvailable,
  16. zipPlgAvailable,
  17. brolFilePropertiesAvailable,
  18. brolExifAvailable;
  19. #endregion
  20.  
  21. #region singleton
  22. static PluginsManager instance = null;
  23. static readonly object padlock = new object();
  24. private PluginsManager()
  25. {
  26. plugins = new Dictionary<PLUGIN, Plugin>();
  27. brolexplorerPlgAvailable = plugAvailable("BrolExplorer.dll", PLUGIN.explorer);
  28. photobrolPlgAvailable = plugAvailable("PhotoBrol.dll", PLUGIN.photo);
  29. renamerPlgAvailable = plugAvailable("BrolRenamer.exe", PLUGIN.renamer);
  30. zipPlgAvailable = plugAvailable("BrolZip.exe", PLUGIN.zip);
  31. brolFilePropertiesAvailable = plugAvailable("BrolFilePropertiesViewer.exe", PLUGIN.metadata);
  32. brolExifAvailable = plugAvailable("BrolExifEditor.exe", PLUGIN.exif);
  33. plugAvailable("BrolFileStats.exe", PLUGIN.stats);
  34. }
  35. public static PluginsManager Instance
  36. {
  37. get
  38. {
  39. lock (padlock)
  40. {
  41. if (instance == null)
  42. {
  43. instance = new PluginsManager();
  44. }
  45. return instance;
  46. }
  47. }
  48. }
  49. #endregion
  50.  
  51. #region private methods
  52.  
  53. /// <summary>
  54. /// Test if a plugin is available for bibliobrol
  55. /// if it is available, add it in the plugins list
  56. /// </summary>
  57. /// <param name="plugName"></param>
  58. /// <returns></returns>
  59. private bool plugAvailable(string plugName, PLUGIN plugin)
  60. {
  61. if (File.Exists(plugName))
  62. {
  63. plugins.Add(plugin, new Plugin("", plugName));
  64. return true;
  65. }
  66. return false;
  67. }
  68. #endregion
  69.  
  70. #region static methods
  71. /*
  72.   public static Plugin addPlugin(string plugName)
  73.   {
  74.   Plugin p = null;
  75.   if (File.Exists(plugName))
  76.   {
  77.   p = new Plugin("", plugName);
  78.   instance.plugins.Add(plugName,p);
  79.   }
  80.   return p;
  81.   }*/
  82. public static Plugin getPlugin(PLUGIN plugin)
  83. {
  84. if (Instance.plugins.ContainsKey(plugin))
  85. {
  86. return Instance.plugins[plugin];
  87. }
  88. return null;
  89. }
  90. public static int Count
  91. {
  92. get { return Instance.plugins.Count; }
  93. }
  94. /// <summary>
  95. /// Get true if bibliobrol can use brolexplorer plugin
  96. /// </summary>
  97. public static bool BrolExplorerPlugAvailable
  98. {
  99. get { return Instance.brolexplorerPlgAvailable; }
  100. }
  101. /// <summary>
  102. /// Get true if bibliobrol can use photobrol plugin
  103. /// </summary>
  104. public static bool PhotoBrolPlugAvailable
  105. {
  106. get { return Instance.photobrolPlgAvailable; }
  107. }
  108.  
  109. public static List<Plugin> Plugins
  110. {
  111. get
  112. {
  113. List<Plugin> plugins = new List<Plugin>();
  114. foreach (KeyValuePair<PLUGIN, Plugin> kvp in Instance.plugins)
  115. {
  116. plugins.Add(kvp.Value);
  117. }
  118. return plugins;
  119. }
  120. }
  121. #endregion
  122. }
  123. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/model/config/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1714722310 03/05/2024 09:45:10
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/model/config/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csPluginsManager.cs3.8 Ko31/10/2018 18:33:08-refusé-
Afficher le fichier .cs|.csSource.cs2.8 Ko31/10/2018 18:33:08-refusé-
Afficher le fichier .cs|.csSettings.cs6.91 Ko31/10/2018 18:33:08-refusé-
Afficher le fichier .cs|.csPlugin.cs3.36 Ko31/10/2018 18:33:08-refusé-
Afficher le fichier .cs|.csSourcesManager.cs1.38 Ko31/10/2018 18:33:08-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.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 16/10/2009 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/cs-broldev-source-rf-model/config/PluginsManager.cs.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.