Img.cs

Description du code

Img.cs est un fichier du projet BiblioBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.

Projet BiblioBrol :

Gestion de media en CSharp.

Pour plus d'infos, vous pouvez consulter la brève analyse.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. using System.IO;
  6. using be.gaudry.bibliobrol.model;
  7. using System.Drawing;
  8. using System.Resources;
  9. using be.gaudry.observer;
  10. using be.gaudry.model.drawing;
  11. using be.gaudry.bibliobrol.config;
  12.  
  13. namespace be.gaudry.bibliobrol.view.utils
  14. {
  15. public class Img : ImageHelper
  16. {
  17. private static ResourceManager rm = new ResourceManager("be.gaudry.bibliobrol.Properties.Resources", typeof(Img).Assembly);
  18.  
  19. /// <summary>
  20. /// Get an image from the resource file
  21. /// </summary>
  22. /// <param name="typeName">Name of the brolType</param>
  23. /// <returns>Requested image or default imageif not found</returns>
  24. public static Image getTypeImage(String typeName)
  25. {
  26. Image img;
  27. try
  28. {
  29. //try to find user custom image
  30. img = new System.Drawing.Bitmap(String.Format("{0}{1}{2}.gif", Config.ImgAppDir, Path.DirectorySeparatorChar, typeName));
  31. }
  32. catch
  33. {
  34. //try to find image in the resources
  35. img = rm.GetObject(String.Format("{0}TypeSmall", typeName)) as Bitmap;
  36. if (img == null)
  37. {
  38. //use default image
  39. img = global::be.gaudry.bibliobrol.Properties.Resources.defaultTypeSmall;
  40. }
  41. }
  42. return img;
  43. }
  44. /// <summary>
  45. /// Get person's image file path. Needed to have each time a same naming method.
  46. /// </summary>
  47. /// <returns>(String) Path of the person image file</returns>
  48. public static String getPersImgPath(Person person)
  49. {
  50. if (person == null) return "";
  51. /*StringBuilder s = new StringBuilder(RefactoredConfig.ImgAppDir);
  52.   if(person.LastName!=null) s.Append(person.LastName.Trim().ToLower());
  53.   s.Append("_");
  54.   if (person.FirstName != null) s.Append(person.FirstName.Trim().ToLower());
  55.   s.Append(".jpg");
  56.   return s.ToString();*/
  57. return string.Format("{0}{1}{2}.jpg", Config.ImgPersDir, Path.DirectorySeparatorChar, person.Id);
  58. }
  59.  
  60. /// <summary>
  61. /// Get person's image file path. Needed to have each time a same naming method.
  62. /// </summary>
  63. /// <returns>(String) Path of the person image file</returns>
  64. public static String getPersImgPath(PersonLO person)
  65. {
  66. if (person == null) return "";
  67. /*StringBuilder s = new StringBuilder(RefactoredConfig.ImgAppDir);
  68.   s.Append(person.Text.Replace(' ','_'));
  69.   s.Append(".jpg");
  70.   return s.ToString();*/
  71. return string.Format("{0}{1}{2}.jpg", Config.ImgAppDir, Path.DirectorySeparatorChar, person.Id);
  72. }
  73.  
  74. /// <summary>
  75. /// Get brol's image file path. Needed to have each time a same naming method.
  76. /// </summary>
  77. /// <returns>(String) Path of the brol image file</returns>
  78. public static String getBrolImgPath(Brol brol)
  79. {
  80. if (brol==null || brol.Id < 1) return "";
  81. StringBuilder s = new StringBuilder(Config.ImgBrolDir);
  82. s.Append(Path.DirectorySeparatorChar);
  83. s.Append(brol.Id);
  84. s.Append(".jpg");
  85. return s.ToString();
  86. }
  87. }
  88. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/view/utils/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1719629530 29/06/2024 04:52:10
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/view/utils/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csExportControl.cs27.1 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csMultiWebInfoControl.cs2.13 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csImagesImporter.Designer.cs3.64 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csImg.cs3.45 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .resx|.resxMediabrolInfoControl.resx5.68 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .resx|.resxExportControl.resx5.68 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csConsole.Designer.cs4.25 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .resx|.resxConsole.resx6.06 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csMediabrolInfoControl.Designer.cs12.57 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csMultiWebInfoControl.Designer.cs1.46 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csImagesImporter.cs1.89 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csExportControl.Designer.cs42.38 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .resx|.resxMultiWebInfoControl.resx5.68 Ko31/10/2018 18:33:04-refusé-
Afficher le fichier .cs|.csMediabrolInfoControl.cs1.9 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .resx|.resxImagesImporter.resx5.68 Ko31/10/2018 18:33:03-refusé-
Afficher le fichier .cs|.csConsole.cs16.89 Ko31/10/2018 18:33:03-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.

Document créé le 16/10/2009, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/cs-bibliobrol-source-rf-view/utils//Img.cs.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.