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.

CustomOpenResultFileDialog.cs

Description du code

CustomOpenResultFileDialog.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.IO;
  3. using System.Windows.Forms;
  4. using be.gaudry.model.config;
  5. using be.gaudry.model.enums;
  6. using be.gaudry.model.file;
  7.  
  8. namespace be.gaudry.view.dialogs
  9. {
  10. public partial class CustomOpenResultFileDialog : Form
  11. {
  12. #region declarations, constructor ans singleton
  13. private string fileName;
  14. private const string exportActionSettingString = "display/actionOpen";
  15. private Settings settings = new Settings();
  16. protected static CustomOpenResultFileDialog instance = null;
  17. static readonly object padlock = new object();
  18. private OPEN_FILE_ACTION action;
  19. protected CustomOpenResultFileDialog()
  20. {
  21.  
  22. InitializeComponent();
  23. }
  24.  
  25. public static CustomOpenResultFileDialog Instance
  26. {
  27. get
  28. {
  29. lock(padlock)
  30. {
  31. if(instance==null)
  32. {
  33. instance = new CustomOpenResultFileDialog();
  34. }
  35. return instance;
  36. }
  37. }
  38. }
  39. #endregion
  40.  
  41. #region public methods
  42. /*
  43.   public CustomOpenResultFileDialog()
  44.   {
  45.   InitializeComponent();
  46.   }
  47.  
  48.   public void setInfoText(string infoText)
  49.   {
  50.   infosLbl.Text = infoText;
  51.   }
  52.  
  53.   public void setTitle(string title)
  54.   {
  55.   Text = title;
  56.   }
  57.  
  58.   public void setFileName(string fileName)
  59.   {
  60.   this.fileName = fileName;
  61.   }
  62.   */
  63. #endregion
  64.  
  65. #region persistance of prefered action
  66. private void loadPreferedAction()
  67. {
  68. try
  69. {
  70. string actionStr = settings.getSetting(
  71. exportActionSettingString,
  72. Enum.GetName(typeof(OPEN_FILE_ACTION), OPEN_FILE_ACTION.Nothing)
  73. );
  74. action = (OPEN_FILE_ACTION)Enum.Parse(
  75. typeof(OPEN_FILE_ACTION),
  76. actionStr,
  77. false
  78. );
  79. }
  80. catch
  81. {
  82. action = OPEN_FILE_ACTION.Nothing;
  83. }
  84. }
  85. private void savePreferedAction()
  86. {
  87. settings.putSetting(
  88. exportActionSettingString,
  89. Enum.GetName(typeof(OPEN_FILE_ACTION), action),
  90. true
  91. );
  92. }
  93. #endregion
  94.  
  95. #region private methods
  96. private void CustomOpenResultFile_Load(object sender, EventArgs e)
  97. {
  98. this.Width = infosLbl.Width + 80;
  99. this.Height = infosLbl.Height + 250;
  100.  
  101. switch (action)
  102. {
  103. case OPEN_FILE_ACTION.Nothing: closeRB.Checked = true; break;
  104. case OPEN_FILE_ACTION.Open: openRB.Checked = true; break;
  105. case OPEN_FILE_ACTION.OpenWith: openWithRB.Checked = true; break;
  106. case OPEN_FILE_ACTION.OpenFolder: openFolderRB.Checked = true; break;
  107. }
  108. }
  109.  
  110. private void CustomOpenResultFileDialog_FormClosing(object sender, FormClosingEventArgs e)
  111. {
  112. savePreferedAction();
  113. }
  114.  
  115. private void okBtn_Click(object sender, EventArgs e)
  116. {
  117. if (!string.Empty.Equals(fileName))
  118. {
  119.  
  120. if (openRB.Checked)
  121. {
  122. FileHelper.open(fileName);
  123. if (action != OPEN_FILE_ACTION.Open) action = OPEN_FILE_ACTION.Open;
  124. }
  125. else if (openWithRB.Checked)
  126. {
  127. FileHelper.openWith(fileName);
  128. if (action != OPEN_FILE_ACTION.OpenWith) action = OPEN_FILE_ACTION.OpenWith;
  129. }
  130. else if (openFolderRB.Checked)
  131. {
  132. string dirName = Path.GetDirectoryName(fileName);
  133. //todo : open the explorer...
  134. if (action != OPEN_FILE_ACTION.OpenFolder) action = OPEN_FILE_ACTION.OpenFolder;
  135. }
  136. else
  137. {
  138. if (action != OPEN_FILE_ACTION.Nothing) action = OPEN_FILE_ACTION.Nothing;
  139. }
  140. }
  141. this.Close();
  142. }
  143. #endregion
  144.  
  145. #region static methods
  146.  
  147. public static void Show(IWin32Window owner, string filePath, string text, string caption, MessageBoxIcon icon)
  148. {
  149. CustomOpenResultFileDialog instance = Instance;
  150. instance.fileName = filePath;
  151. instance.Text = caption;
  152. instance.infosLbl.Text = text;
  153. instance.ShowDialog(owner);
  154. }
  155.  
  156. #endregion
  157. }
  158. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/dialogs/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1716210266 20/05/2024 15:04:26
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/dialogs/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csTrackIntParameterDialog.cs4.2 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csHSLDialog.cs8.25 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csExceptionDialog.cs3.58 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csVersionForm.Designer.cs6.72 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .resx|.resxCriticalExceptionDialog.resx5.68 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .resx|.resxTrackFloatParameterDialog.resx5.68 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csDGVLayoutOptionsDialog.designer.cs5.12 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csExceptionDialog.Designer.cs6.2 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .resx|.resxCustomOpenResultFileDialog.resx6.06 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .resx|.resxVersionForm.resx42.91 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csAboutBrolDevlDialog.Designer.cs2.24 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .resx|.resxDGVLayoutOptionsDialog.resx5.68 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .resx|.resxInfobrolForm.resx40.95 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csTrackFloatParameterDialog.cs2.41 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .resx|.resxUpdateDialog.resx5.68 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csCustomOpenResultFileDialog.Designer.cs7.44 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csCriticalExceptionDialog.Designer.cs8.88 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csTrackIntParameterDialog.Designer.cs8.02 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csDGVLayoutOptionsDialog.cs1.05 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csUpdateDialog.Designer.cs2.02 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csUpdateDialog.cs360 octets31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csAboutBrolDevlDialog.cs230 octets31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csCustomOpenResultFileDialog.cs4.84 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .resx|.resxExceptionDialog.resx5.68 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .resx|.resxHSLDialog.resx5.68 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .resx|.resxAboutBrolDevlDialog.resx5.68 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csTrackFloatParameterDialog.Designer.cs6.31 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .resx|.resxResizeDialog.resx5.68 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csHSLDialog.Designer.cs14.28 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csResizeDialog.cs1.09 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csCriticalExceptionDialog.cs1.87 Ko31/10/2018 18:33:13-refusé-
Afficher le fichier .cs|.csVersionForm.cs1.16 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .resx|.resxTrackIntParameterDialog.resx5.68 Ko31/10/2018 18:33:15-refusé-
Afficher le fichier .cs|.csInfobrolForm.cs198 octets31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csInfobrolForm.Designer.cs2.45 Ko31/10/2018 18:33:14-refusé-
Afficher le fichier .cs|.csResizeDialog.Designer.cs5.3 Ko31/10/2018 18:33:14-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-broldev-source-rf-view/dialogs//CustomOpenResultFileDialog.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.