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

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.IO;
  9.  
  10. namespace be.gaudry.explorer.view.controls
  11. {
  12. public partial class ThumbUserControl : UserControl
  13. {
  14. private Color mouseOverBgColor, mouseOverForeColor, mouseOutBgColor, mouseOutForeColor;
  15. private String path;
  16. private int index;
  17. public delegate void OnThumbClickHandler(object sender, String path);
  18. public ThumbUserControl()
  19. {
  20. mouseOverBgColor = SystemColors.Highlight;
  21. mouseOverForeColor = SystemColors.HighlightText;
  22. mouseOutBgColor = SystemColors.Control;
  23. mouseOutForeColor = SystemColors.ControlText;
  24. InitializeComponent();
  25. }
  26. public ThumbUserControl(int index)
  27. : this()
  28. {
  29. this.index = index;
  30. }
  31. [
  32. //Category("MyEvents"),
  33. Browsable(true),
  34. Description("Event called on click on the thumb")
  35. ]
  36. public event OnThumbClickHandler thumbClick;
  37.  
  38. [
  39. Category("Appearance"),
  40. Browsable(true),
  41. Description("Path of the image file")
  42. ]
  43. public String ImageLocation
  44. {
  45. get
  46. {
  47. return this.path;
  48. }
  49. set
  50. {
  51. if (index != 0)
  52. {
  53. this.fileNameLbl.Text = String.Format("{0} : {1}", index, Path.GetFileNameWithoutExtension(value));
  54. }
  55. else
  56. {
  57. this.fileNameLbl.Text = Path.GetFileNameWithoutExtension(value);
  58. }
  59. this.path = value;
  60. pictureBox1.ImageLocation = value;
  61. /*pictureBox1.Image = bmp.GetThumbnailImage(
  62.   pictureBox1.Width,
  63.   pictureBox1.Height,
  64.   null,
  65.   new IntPtr()
  66.   );
  67.  
  68.   pictureBox1.Image = getThumbnail(
  69.   this.path,
  70.   pictureBox1.Width,
  71.   pictureBox1.Height
  72.   );
  73.   */
  74. }
  75. }
  76.  
  77.  
  78.  
  79.  
  80. [
  81. Category("Appearance"),
  82. Browsable(true),
  83. Description("Background ColorAvgLum used on muse over")
  84. ]
  85. public Color MouseOverBackgroundColor
  86. {
  87. get
  88. {
  89. return mouseOverBgColor;
  90. }
  91. set
  92. {
  93. mouseOverBgColor = value;
  94. }
  95. }
  96. [
  97. Category("Appearance"),
  98. Browsable(true),
  99. Description("Fore ColorAvgLum used on muse over")
  100. ]
  101. public Color MouseOverForeColor
  102. {
  103. get
  104. {
  105. return mouseOverForeColor;
  106. }
  107. set
  108. {
  109. mouseOverForeColor = value;
  110. }
  111. }
  112. [
  113. Category("Appearance"),
  114. Browsable(true),
  115. Description("Background ColorAvgLum used on muse out (normal back color)")
  116. ]
  117. public Color MouseOutBackgroundColor
  118. {
  119. get
  120. {
  121. return mouseOutBgColor;
  122. }
  123. set
  124. {
  125. mouseOutBgColor = value;
  126. }
  127. }
  128. [
  129. Category("Appearance"),
  130. Browsable(true),
  131. Description("Fore ColorAvgLum used on muse out (normal Fore color)")
  132. ]
  133. public Color MouseOutForeColor
  134. {
  135. get
  136. {
  137. return mouseOutForeColor;
  138. }
  139. set
  140. {
  141. mouseOutForeColor = value;
  142. }
  143. }
  144.  
  145. private void MouseEnterAction(object sender, EventArgs e)
  146. {
  147. this.BackColor = mouseOverBgColor;
  148. this.ForeColor = mouseOverForeColor;
  149. }
  150.  
  151. private void MouseLeaveAction(object sender, EventArgs e)
  152. {
  153. this.BackColor = mouseOutBgColor;
  154. this.ForeColor = mouseOutForeColor;
  155. }
  156.  
  157. private void ClickAction(object sender, EventArgs e)
  158. {
  159. if (thumbClick != null)
  160. {
  161. thumbClick(sender, path);
  162. }
  163. }
  164.  
  165. internal void setImage(Image img, string path)
  166. {
  167. this.fileNameLbl.Text = "thumb";// Path.GetFileNameWithoutExtension(path);
  168. this.path = path;
  169. pictureBox1.Image = img;
  170. }
  171. }
  172. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/brolexplorer/view/controls/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1719835338 01/07/2024 14:02:18
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/brolexplorer/view/controls/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .resx|.resxThumbUserControl.resx5.68 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csSearchMediaUserControl.Designer.cs52.01 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csImagesBrowserUserControl.cs9.69 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csExplorerUserControl.cs38.67 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csExplorerUserControl.Designer.cs44.73 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .resx|.resxExplorerUserControl.resx15.83 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .resx|.resxImagesBrowserUserControl.resx6.06 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csImagesBrowserUserControl.Designer.cs10.53 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csThumbUserControl.Designer.cs3.29 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .resx|.resxSearchMediaUserControl.resx7.72 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csSearchMediaUserControl.cs25.76 Ko31/10/2018 18:32:50-refusé-
Afficher le fichier .cs|.csThumbUserControl.cs4.7 Ko31/10/2018 18:32:50-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 30/10/2009, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/cs-brolexplorer-source-rf-view/controls/ThumbUserControl.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.