Copy of MainForm.cs

Description du code

Copy of MainForm.cs est un fichier du projet BiblioBrol.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/src/.

Projet BiblioBrol :

Gestion de media en CSharp.

Pour plus d'infos, vous pouvez consulter la brève analyse.

Code source ou contenu du fichier

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using be.gaudry.view;
  9. using be.gaudry.explorer.view;
  10. using be.gaudry.model.config;
  11. using be.gaudry.observer;
  12. using be.gaudry.bibliobrol.view.dialogs;
  13. using be.gaudry.bibliobrol.view.wizards;
  14. using be.gaudry.exceptions;
  15. using be.gaudry.view.dialogs;
  16. using be.gaudry.view.docking;
  17.  
  18. namespace be.gaudry.bibliobrol.view
  19. {
  20. public partial class MainForm : DockParentForm
  21. {
  22. #region declarations and constructors
  23.  
  24. private String hideCons, dispCons;
  25. private ConsoleForm consoleForm;
  26.  
  27. private AboutBibliobrolDialog aboutBox;
  28.  
  29. private ToolStripMenuItem showHideQuickLaunchTsMi;
  30.  
  31. private ToolStripMenuItem personsTsMi,
  32. personsFormMenuItem,
  33. addUserTsMi;
  34.  
  35. private ToolStripMenuItem brolsTsMi,
  36. brolsFormTSMenuItem,
  37. openEditSeriesForm;
  38.  
  39. private ToolStripMenuItem mediabrolsTSMenuItem,
  40. mediabrolsFormTSMenuItem;
  41.  
  42. private ToolStripMenuItem findTsMi,
  43. searchOnDiscTsMi,
  44. findOnDiscTsMi,
  45. findAwsTsMi;
  46.  
  47. private ToolStripMenuItem openOldApplicationTsMi;
  48.  
  49. private ToolStripMenuItem statsTSMenuItem,
  50. brolExplorerTSMenuItem,
  51. tasksTsMi,
  52. consoleTSMenuItem,
  53. hideConsoleTSMenuItem,
  54. clearConsoleTSMenuItem,
  55. consoleOpacityTSMenuItem,
  56. consoleOpacity50TSMenuItem,
  57. consoleOpacity70TSMenuItem,
  58. consoleOpacity90TSMenuItem,
  59. consoleOpacity95TSMenuItem,
  60. consoleOpacity100TSMenuItem;
  61.  
  62.  
  63. private ToolStripMenuItem misesÀJourToolStripMenuItem,
  64. welcomeWizardTSMenuItem;
  65.  
  66.  
  67. public MainForm()
  68. {
  69. StaticObservable.hideErrors();
  70. InitializeComponent();
  71. Splasher.Status = "Initialisation des composants BiblioBrol";
  72. initMainFormFeatures();
  73. Splasher.Status = "Initialisation de la console";
  74. initConsoleForm();
  75.  
  76. Splasher.Status = "Initialisation de la config";
  77. testApplicationConfig();
  78. aboutBox = new AboutBibliobrolDialog();
  79. this.ResumeLayout(false);
  80. this.PerformLayout();
  81. StaticObservable.showErrors();
  82. }
  83.  
  84. private void initMainFormFeatures()
  85. {
  86.  
  87. personsTsMi = new ToolStripMenuItem();
  88. personsFormMenuItem = new ToolStripMenuItem();
  89. addUserTsMi = new ToolStripMenuItem();
  90.  
  91. showHideQuickLaunchTsMi = new ToolStripMenuItem();
  92.  
  93. brolsTsMi = new ToolStripMenuItem();
  94. brolsFormTSMenuItem = new ToolStripMenuItem();
  95. openEditSeriesForm = new ToolStripMenuItem();
  96.  
  97. mediabrolsTSMenuItem = new ToolStripMenuItem();
  98. mediabrolsFormTSMenuItem = new ToolStripMenuItem();
  99.  
  100. findTsMi = new ToolStripMenuItem();
  101. searchOnDiscTsMi = new ToolStripMenuItem();
  102. findOnDiscTsMi = new ToolStripMenuItem();
  103. findAwsTsMi = new ToolStripMenuItem();
  104.  
  105. openOldApplicationTsMi = new ToolStripMenuItem();
  106.  
  107. statsTSMenuItem = new ToolStripMenuItem();
  108. brolExplorerTSMenuItem = new ToolStripMenuItem();
  109. tasksTsMi = new ToolStripMenuItem();
  110. consoleTSMenuItem = new ToolStripMenuItem();
  111. hideConsoleTSMenuItem = new ToolStripMenuItem();
  112. clearConsoleTSMenuItem = new ToolStripMenuItem();
  113. consoleOpacityTSMenuItem = new ToolStripMenuItem();
  114. consoleOpacity50TSMenuItem = new ToolStripMenuItem();
  115. consoleOpacity70TSMenuItem = new ToolStripMenuItem();
  116. consoleOpacity90TSMenuItem = new ToolStripMenuItem();
  117. consoleOpacity95TSMenuItem = new ToolStripMenuItem();
  118. consoleOpacity100TSMenuItem = new ToolStripMenuItem();
  119.  
  120. misesÀJourToolStripMenuItem = new ToolStripMenuItem();
  121. welcomeWizardTSMenuItem = new ToolStripMenuItem();
  122. //
  123. // personsTsMi
  124. //
  125. personsTsMi.DropDownItems.AddRange(
  126. new ToolStripItem[]
  127. {
  128. personsFormMenuItem,
  129. addUserTsMi
  130. });
  131. personsTsMi.MergeAction = MergeAction.MatchOnly;
  132. personsTsMi.Name = "personsTsMi";
  133. personsTsMi.Size = new System.Drawing.Size(73, 20);
  134. personsTsMi.Text = "&Personnes";
  135. personsTsMi.ToolTipText = "Gestion des personnes (utilisateurs de l\'application, acteurs, dessinateurs, écrivains, etc.)";
  136. //
  137. // personsFormMenuItem
  138. //
  139. personsFormMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolUsrs;
  140. personsFormMenuItem.Name = "personsFormMenuItem";
  141. personsFormMenuItem.Size = new System.Drawing.Size(185, 22);
  142. personsFormMenuItem.Text = "&Gérer les personnes";
  143. personsFormMenuItem.Click += new System.EventHandler(personsTSB_Click);
  144. mainMenuStrip.Items.Insert(1, personsTsMi);
  145. //
  146. // addUserTsMi
  147. //
  148. addUserTsMi.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolUsrAddBtn;
  149. addUserTsMi.Name = "addUserTsMi";
  150. addUserTsMi.Size = new System.Drawing.Size(185, 22);
  151. addUserTsMi.Text = "Ajouter un utilisateur";
  152. //addUserTsMi.Click += new System.EventHandler(showUserFormAction);
  153.  
  154. //
  155. // displayMenuLeftTsB
  156. //
  157. displayMenuLeftTsB.Visible = true;
  158. displayMenuLeftTsB.Checked = true;
  159. displayMenuLeftTsB.Text = "Afficher ou masquer la barre de lancement rapide";
  160. displayMenuLeftTsB.AutoToolTip = true;
  161. displayMenuLeftTsB.Click += new System.EventHandler(showHideQuickLaunch_Click);
  162.  
  163. //
  164. // showHideQuickLaunchTsMi
  165. //
  166. showHideQuickLaunchTsMi.Image = global::be.gaudry.Properties.Resources.displayMenuLeft;
  167. showHideQuickLaunchTsMi.Name = "showHideQuickLaunchTsMi";
  168. showHideQuickLaunchTsMi.Size = new System.Drawing.Size(185, 22);
  169. showHideQuickLaunchTsMi.Text = "Lancement rapide";
  170. showHideQuickLaunchTsMi.Click += new System.EventHandler(showHideQuickLaunch_Click);
  171. displayToolBarTsMi.DropDownItems.Add(showHideQuickLaunchTsMi);
  172.  
  173.  
  174.  
  175. //
  176. // brolsTsMi
  177. //
  178. brolsTsMi.DropDownItems.AddRange(
  179. new ToolStripItem[]
  180. {
  181. brolsFormTSMenuItem,
  182. openEditSeriesForm
  183. });
  184. brolsTsMi.Name = "brolsTsMi";
  185. brolsTsMi.Size = new System.Drawing.Size(69, 20);
  186. brolsTsMi.Text = "&Ouvrages";
  187. brolsTsMi.ToolTipText = "Gestion des ouvrages. "+
  188. "(Rappel : un ouvrage est un type générique, ce que vous possédez, ce sont des exemplaires)";
  189. mainMenuStrip.Items.Insert(1, brolsTsMi);
  190. //
  191. // brolsFormTSMenuItem
  192. //
  193. brolsFormTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolSmall;
  194. brolsFormTSMenuItem.MergeAction = MergeAction.Insert;
  195. brolsFormTSMenuItem.Name = "brolsFormTSMenuItem";
  196. brolsFormTSMenuItem.Size = new System.Drawing.Size(170, 22);
  197. brolsFormTSMenuItem.Text = "&Gérer les ouvrages";
  198. brolsFormTSMenuItem.Click += new System.EventHandler(brolsTSB_Click);
  199. //
  200. // openEditSeriesForm
  201. //
  202. openEditSeriesForm.Name = "openEditSeriesForm";
  203. openEditSeriesForm.Size = new System.Drawing.Size(170, 22);
  204. openEditSeriesForm.Text = "Gérer les séries";
  205. openEditSeriesForm.Click += new System.EventHandler(openEditSeriesForm_Click);
  206.  
  207.  
  208. //
  209. // mediabrolsTSMenuItem
  210. //
  211. mediabrolsTSMenuItem.DropDownItems.Add(mediabrolsFormTSMenuItem);
  212. mediabrolsTSMenuItem.Name = "mediabrolsTSMenuItem";
  213. mediabrolsTSMenuItem.Size = new System.Drawing.Size(81, 20);
  214. mediabrolsTSMenuItem.Text = "E&xemplaires";
  215. mediabrolsTSMenuItem.ToolTipText = "Gérer les exemplaires (localisation, état, propriétaire, emprunts)";
  216. mainMenuStrip.Items.Insert(1, mediabrolsTSMenuItem);
  217. //
  218. // mediabrolsFormTSMenuItem
  219. //
  220. mediabrolsFormTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.mediabrolSmall;
  221. mediabrolsFormTSMenuItem.MergeAction = MergeAction.MatchOnly;
  222. mediabrolsFormTSMenuItem.Name = "mediabrolsFormTSMenuItem";
  223. mediabrolsFormTSMenuItem.Size = new System.Drawing.Size(184, 22);
  224. mediabrolsFormTSMenuItem.Text = "&Gérer les exemplaires";
  225. mediabrolsFormTSMenuItem.Click += new System.EventHandler(mediabrolsTSB_Click);
  226.  
  227.  
  228. //
  229. // findTsMi
  230. //
  231. findTsMi.DropDownItems.AddRange(
  232. new ToolStripItem[]
  233. {
  234. searchOnDiscTsMi,
  235. findOnDiscTsMi,
  236. findAwsTsMi
  237. });
  238. findTsMi.Name = "findTsMi";
  239. findTsMi.Size = new System.Drawing.Size(74, 20);
  240. findTsMi.Text = "&Recherche";
  241. mainMenuStrip.Items.Insert(1, findTsMi);
  242. //
  243. // searchOnDiscTsMi
  244. //
  245. searchOnDiscTsMi.Name = "searchOnDiscTsMi";
  246. searchOnDiscTsMi.Size = new System.Drawing.Size(222, 22);
  247. searchOnDiscTsMi.Text = "Sur le disque (Automatique)";
  248. searchOnDiscTsMi.Click += new System.EventHandler(brolXplorerTSB_Click);
  249. //
  250. // findOnDiscTsMi
  251. //
  252. findOnDiscTsMi.Name = "findOnDiscTsMi";
  253. findOnDiscTsMi.Size = new System.Drawing.Size(222, 22);
  254. findOnDiscTsMi.Text = "Sur le disque (Explorer)";
  255. findOnDiscTsMi.Click += new System.EventHandler(brolXplorerSearchTSB_Click);
  256. //
  257. // findAwsTsMi
  258. //
  259. findAwsTsMi.Name = "findAwsTsMi";
  260. findAwsTsMi.Size = new System.Drawing.Size(222, 22);
  261. findAwsTsMi.Text = "Bases de données Internet";
  262. findAwsTsMi.Click += new System.EventHandler(showAwsFormAction);
  263.  
  264. //
  265. // openOldApplicationTsMi
  266. //
  267. openOldApplicationTsMi.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolWindows;
  268. openOldApplicationTsMi.Name = "openOldApplicationTsMi";
  269. openOldApplicationTsMi.Size = new System.Drawing.Size(185, 22);
  270. openOldApplicationTsMi.Text = "Ancienne version";
  271. openOldApplicationTsMi.ToolTipText = "Fermer cette fenêtre et ouvrir l'ancienne version";
  272. openOldApplicationTsMi.Click += new System.EventHandler(openOldMainFormTsBtn_Click);
  273. windowTsMi.DropDownItems.Add(new ToolStripSeparator());
  274. windowTsMi.DropDownItems.Add(openOldApplicationTsMi);
  275.  
  276.  
  277. //
  278. // toolsTsMi
  279. //
  280. toolsTsMi.DropDownItems.AddRange(
  281. new ToolStripItem[]
  282. {
  283. new ToolStripSeparator(),
  284. statsTSMenuItem,
  285. brolExplorerTSMenuItem,
  286. tasksTsMi,
  287. new ToolStripSeparator(),
  288. consoleTSMenuItem
  289. });
  290. optionsTSMenuItem.Click += new EventHandler(openOptions_Click);
  291. //
  292. // statsTSMenuItem
  293. //
  294. statsTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.statsSmall;
  295. statsTSMenuItem.Name = "statsTSMenuItem";
  296. statsTSMenuItem.Size = new System.Drawing.Size(185, 22);
  297. statsTSMenuItem.Text = "Statistiques";
  298. statsTSMenuItem.ToolTipText = "Affichage de certaines informations sous forme de tartes";
  299. statsTSMenuItem.Click += new System.EventHandler(statsTSB_Click);
  300. //
  301. // brolExplorerTSMenuItem
  302. //
  303. brolExplorerTSMenuItem.Name = "brolExplorerTSMenuItem";
  304. brolExplorerTSMenuItem.Size = new System.Drawing.Size(185, 22);
  305. brolExplorerTSMenuItem.Text = "Explorateur de media";
  306. brolExplorerTSMenuItem.Click += new System.EventHandler(brolXplorerTSB_Click);
  307. //
  308. // tasksTsMi
  309. //
  310. tasksTsMi.Name = "tasksTsMi";
  311. tasksTsMi.Size = new System.Drawing.Size(185, 22);
  312. tasksTsMi.Text = "Tâches";
  313. tasksTsMi.Click += new System.EventHandler(showTasksFormAction);
  314. //
  315. // consoleTSMenuItem
  316. //
  317. consoleTSMenuItem.DropDownItems.AddRange(
  318. new ToolStripItem[]
  319. {
  320. hideConsoleTSMenuItem,
  321. clearConsoleTSMenuItem,
  322. consoleOpacityTSMenuItem
  323. });
  324. consoleTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsole;
  325. consoleTSMenuItem.Name = "consoleTSMenuItem";
  326. consoleTSMenuItem.Size = new System.Drawing.Size(185, 22);
  327. consoleTSMenuItem.Text = "&Console";
  328. consoleTSMenuItem.ToolTipText = "Gestion de la console locale";
  329. consoleTSMenuItem.Paint += new PaintEventHandler(consoleTSMenuItem_Paint);
  330. //
  331. // hideConsoleTSMenuItem
  332. //
  333. hideConsoleTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleHide;
  334. hideConsoleTSMenuItem.Name = "hideConsoleTSMenuItem";
  335. hideConsoleTSMenuItem.Size = new System.Drawing.Size(215, 22);
  336. hideConsoleTSMenuItem.Text = "Montrer/Cacher la console";
  337. hideConsoleTSMenuItem.ToolTipText = "Afficher ou masquer la console";
  338. hideConsoleTSMenuItem.Click += new System.EventHandler(hideConsoleTSMenuItem_Click);
  339. //
  340. // clearConsoleTSMenuItem
  341. //
  342. clearConsoleTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleClean;
  343. clearConsoleTSMenuItem.Name = "clearConsoleTSMenuItem";
  344. clearConsoleTSMenuItem.Size = new System.Drawing.Size(215, 22);
  345. clearConsoleTSMenuItem.Text = "Vider la console";
  346. clearConsoleTSMenuItem.ToolTipText = "Réinitialiser le contenu de la console";
  347. clearConsoleTSMenuItem.Click += new System.EventHandler(clearConsoleTSMenuItem_Click);
  348. //
  349. // consoleOpacityTSMenuItem
  350. //
  351. consoleOpacityTSMenuItem.DropDownItems.AddRange(
  352. new ToolStripItem[]
  353. {
  354. consoleOpacity50TSMenuItem,
  355. consoleOpacity70TSMenuItem,
  356. consoleOpacity90TSMenuItem,
  357. consoleOpacity95TSMenuItem,
  358. consoleOpacity100TSMenuItem
  359. });
  360. consoleOpacityTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp;
  361. consoleOpacityTSMenuItem.Name = "consoleOpacityTSMenuItem";
  362. consoleOpacityTSMenuItem.Size = new System.Drawing.Size(215, 22);
  363. consoleOpacityTSMenuItem.Text = "Opacité";
  364. consoleOpacityTSMenuItem.Paint += new PaintEventHandler(consoleOpacityTSMenuItem_Paint);
  365. //
  366. // consoleOpacity50TSMenuItem
  367. //
  368. consoleOpacity50TSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp50;
  369. consoleOpacity50TSMenuItem.Name = "consoleOpacity50TSMenuItem";
  370. consoleOpacity50TSMenuItem.Size = new System.Drawing.Size(105, 22);
  371. consoleOpacity50TSMenuItem.Text = "50 %";
  372. consoleOpacity50TSMenuItem.Click += new System.EventHandler(consoleOpacityValTSMenuItem_Click);
  373. //
  374. // consoleOpacity70TSMenuItem
  375. //
  376. consoleOpacity70TSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp70;
  377. consoleOpacity70TSMenuItem.Name = "consoleOpacity70TSMenuItem";
  378. consoleOpacity70TSMenuItem.Size = new System.Drawing.Size(105, 22);
  379. consoleOpacity70TSMenuItem.Text = "70 %";
  380. consoleOpacity70TSMenuItem.Click += new System.EventHandler(consoleOpacityValTSMenuItem_Click);
  381. //
  382. // consoleOpacity90TSMenuItem
  383. //
  384. consoleOpacity90TSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp90;
  385. consoleOpacity90TSMenuItem.Name = "consoleOpacity90TSMenuItem";
  386. consoleOpacity90TSMenuItem.Size = new System.Drawing.Size(105, 22);
  387. consoleOpacity90TSMenuItem.Text = "90 %";
  388. consoleOpacity90TSMenuItem.Click += new System.EventHandler(consoleOpacityValTSMenuItem_Click);
  389. //
  390. // consoleOpacity95TSMenuItem
  391. //
  392. consoleOpacity95TSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp95;
  393. consoleOpacity95TSMenuItem.Name = "consoleOpacity95TSMenuItem";
  394. consoleOpacity95TSMenuItem.Size = new System.Drawing.Size(105, 22);
  395. consoleOpacity95TSMenuItem.Text = "95 %";
  396. consoleOpacity95TSMenuItem.Click += new System.EventHandler(consoleOpacityValTSMenuItem_Click);
  397. //
  398. // consoleOpacity100TSMenuItem
  399. //
  400. consoleOpacity100TSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleOp;
  401. consoleOpacity100TSMenuItem.Name = "consoleOpacity100TSMenuItem";
  402. consoleOpacity100TSMenuItem.Size = new System.Drawing.Size(105, 22);
  403. consoleOpacity100TSMenuItem.Text = "100 %";
  404. consoleOpacity100TSMenuItem.Click += new System.EventHandler(consoleOpacityValTSMenuItem_Click);
  405.  
  406. //
  407. // helpTsMi
  408. //
  409. helpTsMi.DropDownItems.AddRange(
  410. new System.Windows.Forms.ToolStripItem[]
  411. {
  412. misesÀJourToolStripMenuItem,
  413. welcomeWizardTSMenuItem
  414. });
  415. //
  416. // misesÀJourToolStripMenuItem
  417. //
  418. misesÀJourToolStripMenuItem.Name = "misesÀJourToolStripMenuItem";
  419. misesÀJourToolStripMenuItem.Size = new System.Drawing.Size(201, 22);
  420. misesÀJourToolStripMenuItem.Text = "Mises à jour...";
  421. misesÀJourToolStripMenuItem.Click += new System.EventHandler(this.onShowUpdateForm_Click);
  422. //
  423. // welcomeWizardTSMenuItem
  424. //
  425. welcomeWizardTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.wizardSmall;
  426. welcomeWizardTSMenuItem.Name = "welcomeWizardTSMenuItem";
  427. welcomeWizardTSMenuItem.Size = new System.Drawing.Size(201, 22);
  428. welcomeWizardTSMenuItem.Text = "Assistant de démarrage";
  429. welcomeWizardTSMenuItem.ToolTipText = "Assistant pas à pas pour configurer l\'application (localisation des répertoires, " +
  430. "de la DB, etc.)";
  431. welcomeWizardTSMenuItem.Click += new System.EventHandler(this.showWelcomeWizardAction);
  432. //
  433. // contentsTSMenuItem
  434. //
  435. //contentsTSMenuItem.Click += new System.EventHandler(this.showWelcomeWizardAction);
  436. //
  437. // indexTSMenuItem
  438. //
  439. //indexTSMenuItem.Click += new System.EventHandler(this.showWelcomeWizardAction);
  440. //
  441. // searchToolStripMenuItem
  442. //
  443. //searchToolStripMenuItem.Click += new System.EventHandler(this.showWelcomeWizardAction);
  444. //
  445. // aboutTSMenuItem
  446. //
  447. aboutTSMenuItem.Text = "À &propos de Bibliobrol...";
  448. aboutTSMenuItem.Click += new System.EventHandler(this.openAbout_Click);
  449. }
  450. #endregion
  451.  
  452. #region open childs
  453. private void personsTSB_Click(object sender, EventArgs e)
  454. {
  455. StaticObservable.hideErrors();
  456. showMDIChild<ActorForm>("Chargement des personnes");
  457. StaticObservable.showErrors();
  458. }
  459.  
  460. private void brolsTSB_Click(object sender, EventArgs e)
  461. {
  462. showMDIChild<BrolForm>("Chargement des ouvrages");
  463. }
  464.  
  465. private void mediabrolsTSB_Click(object sender, EventArgs e)
  466. {
  467. showMDIChild<MediabrolForm>("Chargement des exemplaires");
  468. }
  469.  
  470. private void statsTSB_Click(object sender, EventArgs e)
  471. {
  472. showMDIChild<StatsForm>("Chargement des statistiques");
  473. }
  474.  
  475. private void openEditSeriesForm_Click(object sender, EventArgs e)
  476. {
  477. showMDIChild<EditSeriesForm>("Chargement des séries");
  478. }
  479.  
  480. private void showAwsFormAction(object sender, EventArgs e)
  481. {
  482. showMDIChild<AWSForm>("Chargement du service de recherche");
  483. }
  484.  
  485. private void showTasksFormAction(object sender, EventArgs e)
  486. {
  487. showMDIChild<TasksForm>("Chargement des tâches");
  488. }
  489.  
  490. private void brolXplorerTSB_Click(object sender, EventArgs e)
  491. {
  492. showBrolExplorerForm(true);
  493. }
  494.  
  495. private void brolXplorerSearchTSB_Click(object sender, EventArgs e)
  496. {
  497. showBrolExplorerForm(false);
  498. }
  499.  
  500. private void showBrolExplorerForm(bool explore)
  501. {
  502. //todo : ensure single instance of view
  503. ExplorerForm brolExplorerForm = createMDIChild<ExplorerForm>();
  504. if (explore)
  505. {
  506. brolExplorerForm.openExplorer();
  507. }
  508. else
  509. {
  510. brolExplorerForm.openMediaBrowser();
  511. }
  512. showMDIChild(brolExplorerForm);
  513.  
  514. }
  515.  
  516. private void showPhotobrolTSB_Click(object sender, EventArgs e)
  517. {
  518. if (PluginsManager.PhotoBrolPlugAvailable)
  519. {
  520. showMDIChild<be.gaudry.photobrol.view.PhotoBrolMainForm>("Chargement de l'éditeur d'images");
  521. }
  522. }
  523.  
  524. private void openOldMainFormTsBtn_Click(object sender, EventArgs e)
  525. {
  526. OldMainForm form = new OldMainForm();
  527. form.WindowState = this.WindowState;
  528. form.Location = this.Location;
  529. form.Width = this.Width;
  530. form.Height = this.Height;
  531. form.Show();
  532. }
  533. #endregion
  534.  
  535. #region Console
  536.  
  537. private void initConsoleForm()
  538. {
  539. hideCons = "Cacher la console";
  540. dispCons = "Afficher la console";
  541. consoleForm = new ConsoleForm();
  542. consoleForm.DockPanel = this.dockPanel;
  543. consoleForm.Pane = new DockPane(consoleForm, DockState.DockRightAutoHide, true);
  544.  
  545. setStatusMessage(String.Format("Bibliobrol utilisé par {0}, dans la session de {1}", Config.Owner, Environment.UserName));
  546. consoleForm.setStatusBar(toolStripStatusLabel);
  547. consoleForm.ClientSize = new System.Drawing.Size(this.Size.Width, 100);
  548. consoleForm.StartPosition = FormStartPosition.Manual;
  549. consoleForm.Location = new Point(this.Location.X, this.Location.Y + this.Size.Height);
  550. if (Config.ShowConsole)
  551. {
  552. //consoleForm.Show(this);
  553. consoleForm.Show(dockPanel);
  554. hideConsoleTSMenuItem.Text = hideCons;
  555. }
  556. else
  557. {
  558. hideConsoleTSMenuItem.Text = dispCons;
  559. }
  560. //consoleForm.MdiParent = this;
  561. consoleOpacity50TSMenuItem.Tag = 0.5;
  562. consoleOpacity70TSMenuItem.Tag = 0.7;
  563. consoleOpacity90TSMenuItem.Tag = 0.9;
  564. consoleOpacity95TSMenuItem.Tag = 0.95;
  565. consoleOpacity100TSMenuItem.Tag = 1.0;
  566. }
  567. private void dispConsTSB_Click(object sender, EventArgs e)
  568. {
  569. hideConsoleTSMenuItem_Click(sender, e);
  570. }
  571.  
  572. private void cleanConsoleTSB_Click(object sender, EventArgs e)
  573. {
  574. clearConsoleTSMenuItem_Click(sender, e);
  575. }
  576. private void consoleTSMenuItem_Paint(object sender, PaintEventArgs e)
  577. {
  578. bool disp = Config.ShowConsole;
  579. consoleOpacityTSMenuItem.Enabled = disp;
  580. //clearConsoleTSMenuItem.Enabled = disp;
  581. clearConsoleTSMenuItem.Enabled = consoleForm!=null && (consoleForm.ConsoleCount > 0);
  582. setConsoleButtonsState();
  583. }
  584.  
  585. /// <summary>
  586. /// Set buttons images, toolstrip text, and enabled or not
  587. /// </summary>
  588. private void setConsoleButtonsState()
  589. {
  590. if (Config.ShowConsole)
  591. {
  592. hideConsoleTSMenuItem.Text = hideCons;
  593. hideConsoleTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleHide;
  594. dispConsTSB.ToolTipText = hideCons;
  595. dispConsTSB.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsoleHide;
  596. }
  597. else
  598. {
  599. hideConsoleTSMenuItem.Text = dispCons;
  600. hideConsoleTSMenuItem.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsole;
  601. dispConsTSB.ToolTipText = dispCons;
  602. dispConsTSB.Image = global::be.gaudry.bibliobrol.Properties.Resources.brolConsole;
  603. }
  604. cleanConsoleTSB.Enabled = clearConsoleTSMenuItem.Enabled;
  605. }
  606.  
  607. private void clearConsoleTSMenuItem_Click(object sender, EventArgs e)
  608. {
  609. consoleForm.consoleClear();
  610. }
  611.  
  612. private void hideConsoleTSMenuItem_Click(object sender, EventArgs e)
  613. {
  614. Config.ShowConsole = !Config.ShowConsole;
  615. setConsoleButtonsState();
  616. }
  617. #region Console Opacity
  618. private void consoleOpacityValTSMenuItem_Click(object sender, EventArgs e)
  619. {
  620. consoleForm.Opacity = (double)((ToolStripItem)sender).Tag;
  621. }
  622.  
  623. private void consoleOpacityTSMenuItem_Paint(object sender, PaintEventArgs e)
  624. {
  625. foreach (ToolStripItem item in consoleOpacityTSMenuItem.DropDownItems)
  626. {
  627. item.Enabled = (!item.Tag.Equals(consoleForm.Opacity));
  628. }
  629. }
  630.  
  631. //Console Opacity
  632. #endregion
  633.  
  634. //Console
  635. #endregion
  636.  
  637. #region test application validity
  638. /// <summary>
  639. /// Try forms initializations.
  640. /// If no persistance available, a message is displayed, and the wizard is set as the first page.
  641. /// </summary>
  642. public void testApplicationConfig()
  643. {
  644. if (!System.IO.Directory.Exists(Config.DataDirPath))
  645. {
  646. /*StringBuilder str = new StringBuilder("Impossible de trouver le répertoire de données de l'application (");
  647.   str.Append(Config.DataDirPath);
  648.   str.Append(").\n\nIl est possible de modifier la configuration dans l'écran de configuration qui va s'afficher, ou dans le menu \"Outils/Options\"");
  649.   StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "Configuration Bibliobrol", str.ToString(), this));
  650.   */
  651. enableApplication(false);
  652. }
  653. else
  654. {
  655. try
  656. {
  657. model.ModelAdapter.isAvailablePersistance();
  658. enableApplication(true);
  659. }
  660. catch (PersistanceNotFoundException)
  661. {
  662. /*StringBuilder str = new StringBuilder(e.Message);
  663.   str.AppendLine("\n\nIl est possible de modifier la configuration dans le menu \"Outils/Options\", puis sélectionner \"Persistance\"...");
  664.   str.AppendLine("\nAucune fonctionnalité de l'application ne sera disponible tant que le système de persistance ne sera défini.");
  665.   str.AppendLine("Des messages d'erreur peuvent se présenter avant de configurer le système de persistance, ignorez les.");
  666.   StaticObservable.notify(new Notification(Notification.VERBOSE.opsResult, "Configuration Bibliobrol", str.ToString(), this));
  667.   */
  668. enableApplication(false);
  669. }
  670. }
  671. }
  672. /// <summary>
  673. /// Allow to use application buttons if data dir path and persistant are found
  674. /// </summary>
  675. /// <param name="enable"></param>
  676. private void enableApplication(bool enable)
  677. {
  678. //borrowsTSMenuItem.Visible = enable;
  679. brolsFormTSMenuItem.Visible = enable;
  680. personsFormMenuItem.Visible = enable;
  681. mediabrolsFormTSMenuItem.Visible = enable;
  682. statsTSMenuItem.Visible = enable;
  683. if (!enable)
  684. {
  685. WelcomeWizardForm wwf = new WelcomeWizardForm();
  686. wwf.MdiParent = this;
  687. wwf.WindowState = FormWindowState.Maximized;
  688. wwf.Show();
  689. }
  690. }
  691. #endregion
  692.  
  693.  
  694. private void showWelcomeWizardAction(object sender, EventArgs e)
  695. {
  696. showMDIChild<WelcomeWizardForm>("Chargement des données pour l'assistant de démarrage");
  697. }
  698. private void onShowUpdateForm_Click(object sender, EventArgs e)
  699. {
  700. new VersionForm().Show();
  701. }
  702.  
  703. private void showHideQuickLaunch_Click(object sender, EventArgs e)
  704. {
  705. leftTSP.Visible = !leftTSP.Visible;
  706. //showHideStatusBarTsMi.Checked = statusStrip.Visible;
  707. }
  708. private void openAbout_Click(object sender, EventArgs e)
  709. {
  710. aboutBox.ShowDialog(this);
  711. }
  712. private void openOptions_Click(object sender, EventArgs e)
  713. {
  714. OptionsForm optionForm = new OptionsForm();
  715. optionForm.Owner = this;
  716. optionForm.Show();
  717. }
  718.  
  719. #region form events
  720.  
  721. #endregion
  722. }
  723. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModification
IcôneNomTailleModification
| _ Répertoire parent0 octets1732495548 25/11/2024 01:45:48
| _wizards0 octets1541007184 31/10/2018 18:33:04
| _utils0 octets1541007184 31/10/2018 18:33:04
| _controls0 octets1541007178 31/10/2018 18:32:58
| _dialogs0 octets1541007183 31/10/2018 18:33:03
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/src/view/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .resx|.resxMediabrolForm.resx32.55 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxAWSForm.resx188.27 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxMainForm.resx6.07 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxConsoleForm.resx256.48 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csAWSForm.Designer.cs23.45 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csActorForm.cs9.09 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.Designer.cs11.22 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csAWSForm.cs7.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBorrowsForm.cs1.66 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csCopy of MainForm.Designer.cs16.91 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.Designer.cs2.71 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.cs6.34 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .resx|.resxOldMainForm.resx58.06 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csCopy of MainForm.cs30.81 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxActorForm.resx44.98 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .resx|.resxBorrowsForm.resx73.4 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMainForm.cs37.45 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxWebServiceForm.resx9.71 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMainForm.Designer.cs7.16 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csBorrowsForm.Designer.cs10.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csTasksForm.cs389 octets31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBiblioBrolAboutBox.resx5.68 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csBrolForm.cs25.87 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csWebServiceForm.Designer.cs13.12 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csMediabrolForm.Designer.cs142.05 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csConsoleForm.cs2.79 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csBrolForm.designer.cs41.73 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .cs|.csMediabrolForm.cs31.94 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .cs|.csStatsForm.Designer.cs11.59 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csActorForm.Designer.cs28.26 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.Designer.cs83.98 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csStatsForm.cs5 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .cs|.csBiblioBrolAboutBox.cs5.51 Ko31/10/2018 18:32:25-refusé-
Afficher le fichier .cs|.csOldMainForm.cs27.08 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxTasksForm.resx187.31 Ko31/10/2018 18:32:29-refusé-
Afficher le fichier .cs|.csTasksForm.Designer.cs2.26 Ko31/10/2018 18:32:28-refusé-
Afficher le fichier .resx|.resxBrolForm.resx45.52 Ko31/10/2018 18:32:26-refusé-
Afficher le fichier .resx|.resxCopy of MainForm.resx7.53 Ko31/10/2018 18:32:27-refusé-
Afficher le fichier .resx|.resxStatsForm.resx187.5 Ko31/10/2018 18:32:28-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-bibliobrol-source-rf-view//Copy%20of%20MainForm.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.