ThumbUserControl.cs
Description du code
ThumbUserControl.cs est un fichier du projet BrolExplorer.Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/brolexplorer/.
Projet BrolExplorer :
Explorateur de media en CSharp.
Code source ou contenu du fichier
Code c# (ThumbUserControl.cs) (172 lignes)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.IO; namespace be.gaudry.explorer.view.controls { public partial class ThumbUserControl : UserControl { private Color mouseOverBgColor, mouseOverForeColor, mouseOutBgColor, mouseOutForeColor; private String path; private int index; public delegate void OnThumbClickHandler(object sender, String path); public ThumbUserControl() { mouseOverBgColor = SystemColors.Highlight; mouseOverForeColor = SystemColors.HighlightText; mouseOutBgColor = SystemColors.Control; mouseOutForeColor = SystemColors.ControlText; InitializeComponent(); } public ThumbUserControl(int index) : this() { this.index = index; } [ //Category("MyEvents"), Browsable(true), Description("Event called on click on the thumb") ] public event OnThumbClickHandler thumbClick; [ Category("Appearance"), Browsable(true), Description("Path of the image file") ] public String ImageLocation { get { return this.path; } set { if (index != 0) { this.fileNameLbl.Text = String.Format("{0} : {1}", index, Path.GetFileNameWithoutExtension(value)); } else { this.fileNameLbl.Text = Path.GetFileNameWithoutExtension(value); } this.path = value; pictureBox1.ImageLocation = value; /*pictureBox1.Image = bmp.GetThumbnailImage( pictureBox1.Width, pictureBox1.Height, null, new IntPtr() ); pictureBox1.Image = getThumbnail( this.path, pictureBox1.Width, pictureBox1.Height ); */ } } [ Category("Appearance"), Browsable(true), Description("Background ColorAvgLum used on muse over") ] public Color MouseOverBackgroundColor { get { return mouseOverBgColor; } set { mouseOverBgColor = value; } } [ Category("Appearance"), Browsable(true), Description("Fore ColorAvgLum used on muse over") ] public Color MouseOverForeColor { get { return mouseOverForeColor; } set { mouseOverForeColor = value; } } [ Category("Appearance"), Browsable(true), Description("Background ColorAvgLum used on muse out (normal back color)") ] public Color MouseOutBackgroundColor { get { return mouseOutBgColor; } set { mouseOutBgColor = value; } } [ Category("Appearance"), Browsable(true), Description("Fore ColorAvgLum used on muse out (normal Fore color)") ] public Color MouseOutForeColor { get { return mouseOutForeColor; } set { mouseOutForeColor = value; } } private void MouseEnterAction(object sender, EventArgs e) { this.BackColor = mouseOverBgColor; this.ForeColor = mouseOverForeColor; } private void MouseLeaveAction(object sender, EventArgs e) { this.BackColor = mouseOutBgColor; this.ForeColor = mouseOutForeColor; } private void ClickAction(object sender, EventArgs e) { if (thumbClick != null) { thumbClick(sender, path); } } internal void setImage(Image img, string path) { this.fileNameLbl.Text = "thumb";// Path.GetFileNameWithoutExtension(path); this.path = path; pictureBox1.Image = img; } } }
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 | 1730418277 01/11/2024 00:44:37 |
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 30/10/2009, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/cs-brolexplorer-source-rf-view/controls//ThumbUserControl.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.