AboutUserControl.cs

Description du code

AboutUserControl.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;
  2. using System.ComponentModel;
  3. using System.Drawing;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using be.gaudry.model.config;
  8.  
  9. namespace be.gaudry.view.controls
  10. {
  11. public partial class AboutUserControl : UserControl
  12. {
  13. private Assembly assembly;
  14. public AboutUserControl()
  15. {
  16. InitializeComponent();
  17. assembly = Assembly.GetCallingAssembly();
  18. // Initialize the AboutBox to display the product information from the assembly information.
  19. // Change assembly information settings for your application through either:
  20. // - Project->Properties->Application->Assembly Information
  21. // - AssemblyInfo.cs
  22. this.Text = String.Format("À propos de {0}", AssemblyTitle);
  23. this.productNameLbl.Text = AssemblyProduct;
  24. this.versionLbl.Text = String.Format("Version {0}", AssemblyVersion);
  25. this.copyrightLbl.Text = AssemblyCopyright;
  26. this.companyNameLbl.Text = AssemblyCompany;
  27. this.descriptionTB.Text = AssemblyDescription;
  28. }
  29.  
  30. #region Assembly properties
  31.  
  32. public string AssemblyTitle
  33. {
  34. get
  35. {
  36. // Get all Title properties on this assembly
  37. object[] properties = assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
  38. // If there is at least one Title attribute
  39. if (properties.Length > 0)
  40. {
  41. // Select the first one
  42. AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)properties[0];
  43. // If it is not an empty string, return it
  44. if (titleAttribute.Title != "")
  45. return titleAttribute.Title;
  46. }
  47. // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name
  48. return System.IO.Path.GetFileNameWithoutExtension(assembly.CodeBase);
  49. }
  50. }
  51.  
  52. public string AssemblyVersion
  53. {
  54. get
  55. {
  56. return assembly.GetName().Version.ToString();
  57. }
  58. }
  59.  
  60. public string AssemblyDescription
  61. {
  62. get
  63. {
  64. // Get all Description properties on this assembly
  65. object[] properties = assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
  66. // If there aren't any Description properties, return an empty string
  67. if (properties.Length == 0)
  68. return "";
  69. // If there is a Description attribute, return its value
  70. return ((AssemblyDescriptionAttribute)properties[0]).Description;
  71. }
  72. }
  73.  
  74. public string AssemblyProduct
  75. {
  76. get
  77. {
  78. // Get all Product properties on this assembly
  79. object[] properties = assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
  80. // If there aren't any Product properties, return an empty string
  81. if (properties.Length == 0)
  82. return "";
  83. // If there is a Product attribute, return its value
  84. return ((AssemblyProductAttribute)properties[0]).Product;
  85. }
  86. }
  87.  
  88. public string AssemblyCopyright
  89. {
  90. get
  91. {
  92. // Get all Copyright properties on this assembly
  93. object[] properties = assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
  94. // If there aren't any Copyright properties, return an empty string
  95. if (properties.Length == 0)
  96. return "";
  97. // If there is a Copyright attribute, return its value
  98. return ((AssemblyCopyrightAttribute)properties[0]).Copyright;
  99. }
  100. }
  101.  
  102. public string AssemblyCompany
  103. {
  104. get
  105. {
  106. // Get all Company properties on this assembly
  107. object[] properties = assembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
  108. // If there aren't any Company properties, return an empty string
  109. if (properties.Length == 0)
  110. return "";
  111. // If there is a Company attribute, return its value
  112. return ((AssemblyCompanyAttribute)properties[0]).Company;
  113. }
  114. }
  115. #endregion
  116.  
  117. #region Custom properties
  118. [
  119. Description("Get or define the Image used as logo"),
  120. Category("Appearance"),
  121. Browsable(true)
  122. ]
  123. public Image Logo
  124. {
  125. get { return logoPB.Image; }
  126. set { logoPB.Image = value; }
  127. }
  128.  
  129. public string Plugins
  130. {
  131. get
  132. {
  133. StringBuilder str = new StringBuilder("Plugins :");
  134. if (PluginsManager.Count > 0)
  135. {
  136. foreach (Plugin plugin in PluginsManager.Plugins)
  137. {
  138. str.AppendFormat(
  139. "{0}{1} Version {2}",
  140. Environment.NewLine,
  141. plugin.Name,
  142. plugin.Version
  143. );
  144. }
  145. return str.ToString();
  146. }
  147. return "Aucun plugin installé.";
  148. }
  149. }
  150. public string Sources
  151. {
  152. get
  153. {
  154. StringBuilder str = new StringBuilder("Sources :");
  155. if (SourcesManager.Count > 0)
  156. {
  157. foreach (Source src in SourcesManager.Sources)
  158. {
  159. str.AppendFormat(
  160. "{0}{0}{1} : {2}",
  161. Environment.NewLine,
  162. src.Name,
  163. src.Url
  164. );
  165. if (!src.Info.Equals(String.Empty))
  166. str.AppendFormat(
  167. "[{0}]",
  168. src.Info
  169. );
  170. }
  171. return str.ToString();
  172. }
  173. return "Aucune source renseignée.";
  174. }
  175. }
  176. #endregion
  177.  
  178. private void AboutUserControl_Paint(object sender, PaintEventArgs e)
  179. {
  180. this.pluginsTB.Text = Plugins;
  181. this.sourcesTB.Text = Sources;
  182. }
  183. }
  184. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/controls/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1727140588 24/09/2024 03:16:28
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/controls/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csToolBarHomeControl.Designer.cs7.41 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csWizardUserControl.Designer.cs6.79 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csHeaderPanel.Designer.cs1.19 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csDGVLayoutOptionsControl.cs7.55 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csXPGroupBox.cs15.83 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csWizardXpUserControl.Designer.cs7.85 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csToolBarHomeControl.cs2.32 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csVersionControl.Designer.cs4.09 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csWizardUserControl.cs2.01 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .resx|.resxWizardXpUserControl.resx5.68 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csBrolBoxUserControl.Designer.cs5.92 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .resx|.resxChartControl.resx6.58 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csHeaderPanel.cs35.93 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csIWizardUC.cs2.35 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .resx|.resxAboutUserControl.resx5.68 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csTextBoxDragDrop.cs8.59 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csSystemInfoControl.cs5.46 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .resx|.resxXPGroupBox.resx17.7 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csHeaderPanelNativeMethods.cs21.09 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csToolBarManagerControl.cs6.99 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csTextBoxDragDrop.Designer.cs1.11 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .resx|.resxSystemInfoControl.resx6.22 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csSystemInfoControl.Designer.cs4.79 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .resx|.resxHeaderPanel.resx5.85 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csScrollablePictureBoxUserControl.cs5.55 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csBrolBoxUserControl.cs4.7 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .resx|.resxDGVLayoutOptionsControl.resx5.68 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .resx|.resxWizardUserControl.resx5.68 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csUpdateControl.cs7.55 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csIconList.cs2.68 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csVersionControl.cs463 octets31/10/2018 18:33:12-refusé-
Afficher le fichier .resx|.resxBrolBoxUserControl.resx5.68 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csAboutUserControl.cs6.75 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .resx|.resxToolBarManagerControl.resx5.88 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csToolBarManagerControl.Designer.cs10.66 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csIToolBarControl.cs1.07 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csWizardXpUserControl.cs8.11 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csImageCombo.cs15.49 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csAboutUserControl.Designer.cs12.31 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .resx|.resxScrollablePictureBoxUserControl.resx5.68 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csScrollablePictureBoxUserControl.Designer.cs5.64 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .resx|.resxVersionControl.resx5.68 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csChartControl.Designer.cs18.45 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csUpdateControl.Designer.cs3.92 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .resx|.resxUpdateControl.resx5.68 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csChartControl.cs15.11 Ko31/10/2018 18:33:10-refusé-
Afficher le fichier .cs|.csDGVLayoutOptionsControl.Designer.cs17.39 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .cs|.csToolStrip.cs1.06 Ko31/10/2018 18:33:12-refusé-
Afficher le fichier .cs|.csIconList.Designer.cs1.1 Ko31/10/2018 18:33:11-refusé-
Afficher le fichier .resx|.resxToolBarHomeControl.resx48.51 Ko31/10/2018 18:33:12-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-broldev-source-rf-view/controls//AboutUserControl.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.