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
Code c# (AWSFilm.cs) (262 lignes)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.ComponentModel; namespace be.gaudry.bibliobrol.model.aws { public class AWSFilm { #region declarations and constructors private string upc, title, description, rating, runningTime, releasedDate, webPageUrl, imageUrl; private string[] actors, directors; private BindingList<Actor> brolActors; private ActorRole rActor, rRealisator; public Bitmap ImageCache = null; public AWSFilm() { } public AWSFilm(string title, string upc, string description, string[] actors, string[] directors, string rating, string runningTime, string releasedDate, string webPageUrl, string imageUrl) { //this.actors = new string[] { }; //this.directors = new string[] { }; this.upc = checkString(upc); this.title = checkString(title); this.description = checkString(description); this.actors = actors; this.directors = directors; this.rating = checkString(rating); this.runningTime = checkString(runningTime); this.releasedDate = checkString(releasedDate); this.webPageUrl = checkString(webPageUrl); this.imageUrl = checkString(imageUrl); rActor = ModelAdapter.getRole(1); rRealisator = ModelAdapter.getRole(5); } public AWSFilm(string title, string upc, string description, string actors, string directors, string rating, string releasedDate, string webPageUrl, string imageUrl) { this.upc = checkString(upc); this.title = checkString(title); this.description = checkString(description); this.actors[0] = actors; this.directors[0] = directors; this.rating = checkString(rating); this.runningTime = checkString(runningTime); this.releasedDate = checkString(releasedDate); this.webPageUrl = checkString(webPageUrl); this.imageUrl = checkString(imageUrl); rActor = ModelAdapter.getRole(1); rRealisator = ModelAdapter.getRole(5); } #endregion #region properties public string UPC { get { return this.upc; } } public string Title { get { return this.title; } } public string Description { get { return this.description; } } public BindingList<Actor> Actors { get { if (brolActors == null) { if (actors != null) { Actor actor; ActorRole role = rActor;//new ActorRole(); //role.Name = "Acteur"; foreach (string s in actors) { s.Trim(); actor.Role = role; string[] splited = s.Split(separator, 2); if (splited.Length > 0) { actor.FirstName = splited[0]; } if (splited.Length > 1) { actor.LastName = splited[1]; } //actor.Pseudo = s; brolActors.Add(actor); } role = rRealisator;//new ActorRole(); //role.Name = "Réalisateur"; foreach (string s in directors) { s.Trim(); actor.Role = role; string[] splited = s.Split(separator, 2); if (splited.Length > 0) { actor.FirstName = splited[0]; } if (splited.Length > 1) { actor.LastName = splited[1]; } //actor.Pseudo = s; brolActors.Add(actor); } } } return brolActors; } } /* /// <summary> /// Single string with actors, separated by system line returns /// </summary> public string Actors { get { return arrayToString(actors); } } public string[] ActorsArray { get { return actors; } }*/ /// <summary> /// Single string with directors, separated by system line returns /// </summary> public string Directors { get { return arrayToString(directors); } } public string[] DirectorsArray { get { return directors; } } public string ImageUrl { get { return this.imageUrl; } set { imageUrl = value; } } public string Rating { get { return this.rating; } } public string ReleasedDate { get { return this.releasedDate; } } public string RunningTime { get { return this.runningTime; } } public string WebPageUrl { get { return this.webPageUrl; } } #endregion #region overrided methods public override string ToString() { return String.Format("{0} {1}", this.title, this.releasedDate); } #endregion #region private methods /// <summary> /// Converts null strings to the empty string. /// </summary> /// <param name="str">String to check against Nothing.</param> /// <returns>If the original value is _, returns the empty string. Else, returns the original value.</returns> /// <remarks></remarks> private static string checkString(string str) { return (str == null)?"":str; } /// <summary> /// Get string from strings array. Strings are separated by a system line return /// </summary> /// <param name="strs">Strings array to transform</param> /// <returns>Single String (String.Empty if the array is null or empty)</returns> private string arrayToString(string[] strs) { if (strs != null) { foreach (string s in strs) { str.AppendLine(s); } return str.ToString(); } return String.Empty; } #endregion } }
Structure et Fichiers du projet
Afficher/masquer...Icône | Nom | Taille | Modification |
Pas de sous-répertoires. | |||
Icône | Nom | Taille | Modification |
| _ | Répertoire parent | 0 octets | 1731736737 16/11/2024 06:58:57 |
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.