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
Code c# (AboutUserControl.cs) (184 lignes)
using System; using System.ComponentModel; using System.Drawing; using System.Reflection; using System.Text; using System.Windows.Forms; using be.gaudry.model.config; namespace be.gaudry.view.controls { public partial class AboutUserControl : UserControl { private Assembly assembly; public AboutUserControl() { InitializeComponent(); assembly = Assembly.GetCallingAssembly(); // Initialize the AboutBox to display the product information from the assembly information. // Change assembly information settings for your application through either: // - Project->Properties->Application->Assembly Information // - AssemblyInfo.cs this.Text = String.Format("À propos de {0}", AssemblyTitle); this.productNameLbl.Text = AssemblyProduct; this.versionLbl.Text = String.Format("Version {0}", AssemblyVersion); this.copyrightLbl.Text = AssemblyCopyright; this.companyNameLbl.Text = AssemblyCompany; this.descriptionTB.Text = AssemblyDescription; } #region Assembly properties public string AssemblyTitle { get { // Get all Title properties on this assembly // If there is at least one Title attribute if (properties.Length > 0) { // Select the first one AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)properties[0]; // If it is not an empty string, return it if (titleAttribute.Title != "") return titleAttribute.Title; } // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name return System.IO.Path.GetFileNameWithoutExtension(assembly.CodeBase); } } public string AssemblyVersion { get { return assembly.GetName().Version.ToString(); } } public string AssemblyDescription { get { // Get all Description properties on this assembly // If there aren't any Description properties, return an empty string if (properties.Length == 0) return ""; // If there is a Description attribute, return its value return ((AssemblyDescriptionAttribute)properties[0]).Description; } } public string AssemblyProduct { get { // Get all Product properties on this assembly // If there aren't any Product properties, return an empty string if (properties.Length == 0) return ""; // If there is a Product attribute, return its value return ((AssemblyProductAttribute)properties[0]).Product; } } public string AssemblyCopyright { get { // Get all Copyright properties on this assembly // If there aren't any Copyright properties, return an empty string if (properties.Length == 0) return ""; // If there is a Copyright attribute, return its value return ((AssemblyCopyrightAttribute)properties[0]).Copyright; } } public string AssemblyCompany { get { // Get all Company properties on this assembly // If there aren't any Company properties, return an empty string if (properties.Length == 0) return ""; // If there is a Company attribute, return its value return ((AssemblyCompanyAttribute)properties[0]).Company; } } #endregion #region Custom properties [ Description("Get or define the Image used as logo"), Category("Appearance"), Browsable(true) ] public Image Logo { get { return logoPB.Image; } set { logoPB.Image = value; } } public string Plugins { get { if (PluginsManager.Count > 0) { foreach (Plugin plugin in PluginsManager.Plugins) { str.AppendFormat( "{0}{1} Version {2}", Environment.NewLine, plugin.Name, plugin.Version ); } return str.ToString(); } return "Aucun plugin installé."; } } public string Sources { get { if (SourcesManager.Count > 0) { foreach (Source src in SourcesManager.Sources) { str.AppendFormat( "{0}{0}{1} : {2}", Environment.NewLine, src.Name, src.Url ); if (!src.Info.Equals(String.Empty)) str.AppendFormat( "[{0}]", src.Info ); } return str.ToString(); } return "Aucune source renseignée."; } } #endregion private void AboutUserControl_Paint(object sender, PaintEventArgs e) { this.pluginsTB.Text = Plugins; this.sourcesTB.Text = Sources; } } }
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 | 1732283950 22/11/2024 14:59:10 |
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-broldev-source-rf-view/controls//AboutUserControl.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.