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.

Phone.cs

Description du code

Phone.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.  
  5. namespace be.gaudry.bibliobrol.model
  6. {
  7. [Serializable]
  8. public class Phone : ICloneable
  9. {
  10. #region constructor and declarations
  11. public enum TYPE { _, bureau, domicile, gsm }
  12. private int id;
  13. private String number;
  14. private TYPE type;
  15.  
  16. public Phone()
  17. {
  18. reset();
  19. }
  20. public Phone(String number)
  21. : this()
  22. {
  23. this.number = number;
  24. }
  25. public Phone(int id, String number)
  26. : this(number)
  27. {
  28. this.id = id;
  29. }
  30. public Phone(int id, String number, TYPE type)
  31. : this(id, number)
  32. {
  33. this.type = type;
  34. }
  35. #endregion
  36.  
  37. #region overrided methods
  38. public override String ToString()
  39. {
  40. /*if(id==-1)
  41.   return "Nouveau numro";*/
  42. return number + " (" + getTypeLocalName(type) + ")";
  43. }
  44. public override bool Equals(object obj)
  45. {
  46. Phone phone = obj as Phone;
  47. if (phone == null) return false;
  48. if (phone.Id != id) return false;
  49. return phone.Number.Equals(number) && phone.Type.Equals(type);
  50. }
  51. public override int GetHashCode()
  52. {
  53. return (ToString()+id).GetHashCode();
  54. }
  55. #endregion
  56.  
  57. #region public methods
  58. /// <summary>
  59. /// Used to set default values for all fields
  60. /// </summary>
  61. public void reset()
  62. {
  63. id = -1;
  64. number = "";
  65. type = TYPE._;
  66. }
  67. /// <summary>
  68. /// Get the local name of a phone type enum item
  69. /// </summary>
  70. /// <param name="t">Phone type enum item</param>
  71. /// <returns>Local name of param</returns>
  72. public static String getTypeLocalName(TYPE t)
  73. {
  74. switch (t)
  75. {
  76. case TYPE.gsm: return "GSM";//break;
  77. case TYPE.domicile: return "Maison";//break;
  78. case TYPE.bureau: return "Bureau";//break;
  79. default: return "Sans type";
  80. }
  81. }
  82. /// <summary>
  83. /// Get the phone type enum item from a local name
  84. /// </summary>
  85. /// <param name="t">Local name of type</param>
  86. /// <returns>Phone type enum item</returns>
  87. public static TYPE getTypeFromLocalName(String t)
  88. {
  89. switch (t)
  90. {
  91. case "GSM": return TYPE.gsm;//break;
  92. case "Maison": return TYPE.domicile;//break;
  93. case "Bureau": return TYPE.bureau;//break;
  94. default: return TYPE._;
  95. }
  96. }
  97. /// <summary>
  98. /// Get the local name of a phone type enum item name
  99. /// </summary>
  100. /// <param name="typeName">(String) Phone type enum item name</param>
  101. /// <returns>Local name of param</returns>
  102. public static String getTypeLocalName(String typeName)
  103. {
  104. TYPE t;
  105. try
  106. {
  107. t = (TYPE)Enum.Parse(typeof(TYPE), typeName);
  108. }
  109. catch(Exception)
  110. {
  111. t = TYPE._;
  112. }
  113. return getTypeLocalName(t);
  114. }
  115. #endregion
  116.  
  117. #region properties
  118. public int Id
  119. {
  120. get { return this.id; }
  121. set { this.id = value; }
  122. }
  123. public String Number
  124. {
  125. get { return this.number; }
  126. set
  127. {
  128. //todo : implement validation rules
  129. this.number = value;
  130. }
  131. }
  132. /// <summary>
  133. /// Just use to display
  134. /// </summary>
  135. public String NumberAndType
  136. {
  137. //no setter!!!
  138. get { return ToString(); }
  139. }
  140. public TYPE Type
  141. {
  142. get { return this.type; }
  143. set { this.type = value; }
  144. }
  145. #endregion
  146.  
  147. #region ICloneable Members
  148. public object Clone()
  149. {
  150. Phone p = (Phone)MemberwiseClone();
  151. return p;
  152. }
  153. #endregion
  154. }
  155. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/model/ 
IcôneNomTailleModification
IcôneNomTailleModification
| _ Répertoire parent0 octets1727449544 27/09/2024 17:05:44
| _identity0 octets1541007175 31/10/2018 18:32:55
| _eid0 octets1541007175 31/10/2018 18:32:55
| _LightObjects0 octets1541007175 31/10/2018 18:32:55
| _comparators0 octets1541007174 31/10/2018 18:32:54
| _aws0 octets1541007173 31/10/2018 18:32:53
| _enums0 octets1541007175 31/10/2018 18:32:55
| _dao0 octets1541007174 31/10/2018 18:32:54
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/model/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csPhone.cs4.32 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csPerson.cs5.49 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csActor.cs3.86 Ko31/10/2018 18:32:23-refusé-
Afficher le fichier .cs|.csBrolType.cs1.05 Ko31/10/2018 18:32:23-refusé-
Afficher le fichier .cs|.csGenericContainer.cs1.41 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csStatus.cs1.24 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csQuality.cs2.2 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csIBrol.cs252 octets31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csIIdentityFull.cs1.18 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csBrol.cs10.49 Ko31/10/2018 18:32:23-refusé-
Afficher le fichier .cs|.csUser.cs5.17 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csMedia.cs2.04 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csCounter.cs1.17 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csSerieItem.cs1.42 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csIIdentityLight.cs333 octets31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csBorrow.cs2.45 Ko31/10/2018 18:32:23-refusé-
Afficher le fichier .cs|.csTask.cs3.01 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csMediaBrol.cs4.97 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csBrolCategory.cs856 octets31/10/2018 18:32:23-refusé-
Afficher le fichier .cs|.csGenericStateContainer.cs777 octets31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csSerie.cs688 octets31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csModelAdapter.cs33.51 Ko31/10/2018 18:32:24-refusé-
Afficher le fichier .cs|.csActorRole.cs2.72 Ko31/10/2018 18:32:23-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//Phone.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.