AWSFilm.cs

Description du code

AWSFilm.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.Drawing;
  5. using System.ComponentModel;
  6.  
  7. namespace be.gaudry.bibliobrol.model.aws
  8. {
  9. public class AWSFilm
  10. {
  11. #region declarations and constructors
  12. private string upc, title, description, rating, runningTime, releasedDate, webPageUrl, imageUrl;
  13. private string[] actors, directors;
  14. private BindingList<Actor> brolActors;
  15. private ActorRole rActor, rRealisator;
  16. public Bitmap ImageCache = null;
  17.  
  18. public AWSFilm() { }
  19. public AWSFilm(string title, string upc, string description, string[] actors, string[] directors, string rating, string runningTime, string releasedDate, string webPageUrl, string imageUrl)
  20. {
  21. //this.actors = new string[] { };
  22. //this.directors = new string[] { };
  23.  
  24. this.upc = checkString(upc);
  25. this.title = checkString(title);
  26. this.description = checkString(description);
  27. this.actors = actors;
  28. this.directors = directors;
  29. this.rating = checkString(rating);
  30. this.runningTime = checkString(runningTime);
  31. this.releasedDate = checkString(releasedDate);
  32. this.webPageUrl = checkString(webPageUrl);
  33. this.imageUrl = checkString(imageUrl);
  34. rActor = ModelAdapter.getRole(1);
  35. rRealisator = ModelAdapter.getRole(5);
  36. }
  37. public AWSFilm(string title, string upc, string description, string actors, string directors, string rating, string releasedDate, string webPageUrl, string imageUrl)
  38. {
  39. this.actors = new string[] { };
  40. this.directors = new string[] { };
  41.  
  42. this.upc = checkString(upc);
  43. this.title = checkString(title);
  44. this.description = checkString(description);
  45. this.actors[0] = actors;
  46. this.directors[0] = directors;
  47. this.rating = checkString(rating);
  48. this.runningTime = checkString(runningTime);
  49. this.releasedDate = checkString(releasedDate);
  50. this.webPageUrl = checkString(webPageUrl);
  51. this.imageUrl = checkString(imageUrl);
  52. rActor = ModelAdapter.getRole(1);
  53. rRealisator = ModelAdapter.getRole(5);
  54. }
  55. #endregion
  56.  
  57. #region properties
  58.  
  59. public string UPC
  60. {
  61. get
  62. {
  63. return this.upc;
  64. }
  65. }
  66.  
  67. public string Title
  68. {
  69. get
  70. {
  71. return this.title;
  72. }
  73. }
  74.  
  75. public string Description
  76. {
  77. get
  78. {
  79. return this.description;
  80. }
  81. }
  82. public BindingList<Actor> Actors
  83. {
  84. get
  85. {
  86. if (brolActors == null)
  87. {
  88. brolActors = new BindingList<Actor>();
  89. if (actors != null)
  90. {
  91. Actor actor;
  92. ActorRole role = rActor;//new ActorRole();
  93. //role.Name = "Acteur";
  94. char[] separator = new char[]{' '};
  95. foreach (string s in actors)
  96. {
  97. s.Trim();
  98. actor = new Actor();
  99. actor.Role = role;
  100. string[] splited = s.Split(separator, 2);
  101. if (splited.Length > 0)
  102. {
  103. actor.FirstName = splited[0];
  104. }
  105. if (splited.Length > 1)
  106. {
  107. actor.LastName = splited[1];
  108. }
  109. //actor.Pseudo = s;
  110. brolActors.Add(actor);
  111. }
  112.  
  113. role = rRealisator;//new ActorRole();
  114. //role.Name = "Réalisateur";
  115. foreach (string s in directors)
  116. {
  117. s.Trim();
  118. actor = new Actor();
  119. actor.Role = role;
  120. string[] splited = s.Split(separator, 2);
  121. if (splited.Length > 0)
  122. {
  123. actor.FirstName = splited[0];
  124. }
  125. if (splited.Length > 1)
  126. {
  127. actor.LastName = splited[1];
  128. }
  129. //actor.Pseudo = s;
  130. brolActors.Add(actor);
  131. }
  132. }
  133. }
  134. return brolActors;
  135. }
  136. }
  137. /*
  138.   /// <summary>
  139.   /// Single string with actors, separated by system line returns
  140.   /// </summary>
  141.   public string Actors
  142.   {
  143.   get
  144.   {
  145.   return arrayToString(actors);
  146.   }
  147.   }
  148.  
  149.   public string[] ActorsArray
  150.   {
  151.   get
  152.   {
  153.   return actors;
  154.   }
  155.   }*/
  156.  
  157. /// <summary>
  158. /// Single string with directors, separated by system line returns
  159. /// </summary>
  160. public string Directors
  161. {
  162. get
  163. {
  164. return arrayToString(directors);
  165. }
  166. }
  167.  
  168. public string[] DirectorsArray
  169. {
  170. get
  171. {
  172. return directors;
  173. }
  174. }
  175.  
  176. public string ImageUrl
  177. {
  178. get
  179. {
  180. return this.imageUrl;
  181. }
  182. set
  183. {
  184. imageUrl = value;
  185. }
  186. }
  187.  
  188. public string Rating
  189. {
  190. get
  191. {
  192. return this.rating;
  193. }
  194. }
  195.  
  196. public string ReleasedDate
  197. {
  198. get
  199. {
  200. return this.releasedDate;
  201. }
  202.  
  203. }
  204.  
  205.  
  206. public string RunningTime
  207. {
  208. get
  209. {
  210. return this.runningTime;
  211. }
  212. }
  213.  
  214.  
  215. public string WebPageUrl
  216. {
  217. get
  218. {
  219. return this.webPageUrl;
  220. }
  221. }
  222. #endregion
  223.  
  224. #region overrided methods
  225. public override string ToString()
  226. {
  227. return String.Format("{0} {1}", this.title, this.releasedDate);
  228. }
  229. #endregion
  230.  
  231. #region private methods
  232. /// <summary>
  233. /// Converts null strings to the empty string.
  234. /// </summary>
  235. /// <param name="str">String to check against Nothing.</param>
  236. /// <returns>If the original value is _, returns the empty string. Else, returns the original value.</returns>
  237. /// <remarks></remarks>
  238. private static string checkString(string str)
  239. {
  240. return (str == null)?"":str;
  241. }
  242. /// <summary>
  243. /// Get string from strings array. Strings are separated by a system line return
  244. /// </summary>
  245. /// <param name="strs">Strings array to transform</param>
  246. /// <returns>Single String (String.Empty if the array is null or empty)</returns>
  247. private string arrayToString(string[] strs)
  248. {
  249. if (strs != null)
  250. {
  251. StringBuilder str = new StringBuilder();
  252. foreach (string s in strs)
  253. {
  254. str.AppendLine(s);
  255. }
  256. return str.ToString();
  257. }
  258. return String.Empty;
  259. }
  260. #endregion
  261. }
  262. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/model/aws/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1731747102 16/11/2024 09:51:42
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/model/aws/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csAWSSearchResult.cs2.26 Ko31/10/2018 18:32:53-refusé-
Afficher le fichier .cs|.csAWSSearchIndices.cs4.46 Ko31/10/2018 18:32:53-refusé-
Afficher le fichier .cs|.csAWSFilm.cs7.99 Ko31/10/2018 18:32:53-refusé-
Afficher le fichier .cs|.csAWSHelper.cs9.27 Ko31/10/2018 18:32:53-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-bibliobrol-source-rf-model/aws//AWSFilm.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.