AWSForm.cs
Description du code
AWSForm.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
Code c# (AWSForm.cs) (212 lignes)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using be.gaudry.bibliobrol.awsRef; using System.Collections; using be.gaudry.bibliobrol.model.aws; using be.gaudry.view; using be.gaudry.bibliobrol.model; using be.gaudry.bibliobrol.view.dialogs; using be.gaudry.bibliobrol.config; namespace be.gaudry.bibliobrol.view { public partial class AWSForm : MDIChildForm { #region declarations and constructor private AWSSearchIndices awsSearchIndices; private AWSSearchResult<AWSFilm> searchResults; private AWSHelper awsHelper; private BrolType filmsType, bdType, bookType, musicType, softwareType; public AWSForm() { InitializeComponent(); initSearchIndices(); proxyTB.Text = Config.ProxyAddress; } #endregion #region initializations private void initSearchIndices() { List<AWSSearchIndices.Indice> indices = awsSearchIndices.getIndices(AWSSearchIndices.CATEGORY.all); searchIndexCB.DisplayMember = "Display"; //searchIndexCB.ValueMember = "Value"; foreach (AWSSearchIndices.Indice indice in indices) { searchIndexCB.Items.Add(indice); } searchIndexCB.SelectedItem = awsSearchIndices.getDefaultIndice(); } #endregion #region search private void searchBtn_Click(object sender, EventArgs e) { performNewSearch(); } private void searchTB_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { performNewSearch(); } } private void performNewSearch() { if (!proxyTB.Text.Equals(Config.ProxyAddress)) Config.ProxyAddress = proxyTB.Text; AWSSearchIndices.Indice indice = searchIndexCB.SelectedItem as AWSSearchIndices.Indice; performSearch(); } private void performSearch() { resultsCountLbl.Text = "Recherche en cours..."; this.Cursor = Cursors.WaitCursor; try { awsHelper.searchFilms(searchResults, proxyTB.Text); aWSFilmBindingSource.DataSource = searchResults.getDataSource(); moreResultsBtn.Enabled = searchResults.Total - searchResults.Count > 0; resultsCountLbl.Text = String.Format("{0} résultats affichés sur {1}", searchResults.Count, searchResults.Total); } catch (System.Net.WebException we) { resultsCountLbl.Text = we.Message; } this.Cursor = Cursors.Default; } #endregion private void moreResultsBtn_Click(object sender, EventArgs e) { performSearch(); } #region actors private void actorsLB_SelectedIndexChanged(object sender, EventArgs e) { checkActorCMS(); } private void checkActorCMS() { Actor actor = actorsLB.SelectedItem as Actor; if (actor != null) { addPersonTsMi.Text = String.Format("Ajouter {0} dans BiblioBrol", actor.Display); addPersonTsMi.Enabled = true; } else addPersonTsMi.Enabled = false; } private void addPersonTsMi_Click(object sender, EventArgs e) { Actor actor = actorsLB.SelectedItem as Actor; actor.Id = ModelAdapter.insertPerson(actor); ActorRole role = ModelAdapter.loadRole(actor.Role.Name); if (role == null) { selectRoleForm.setRoles(ModelAdapter.loadRoles(actor.Role.Name)); if (selectRoleForm.ShowDialog() == DialogResult.OK) { role = selectRoleForm.getSelectedRole(); if (role != null) actor.Role = role; } } else { actor.Role = role; } ModelAdapter.setDefaultRole(actor, actor.Role); } private void actorsLB_DataSourceChanged(object sender, EventArgs e) { checkActorCMS(); } #endregion private void onSavePictureAs_Click(object sender, EventArgs e) { MessageBox.Show("Fonction en cours de développement..."); } private void onSaveBrol_Click(object sender, EventArgs e) { brol.Title = titleTB.Text; brol.Synopsis = descriptionRTB.Text; int year; Int32.TryParse(releaseDateTB.Text,out year); if (year > 0) foreach (Actor actor in actorsLB.Items) { actor.Status = STATUS.toAdd; brol.addActor(actor); } /* BrolPropertiesForm brolPropertiesForm = new BrolPropertiesForm(); brolPropertiesForm.Brol = brol; brolPropertiesForm.ShowDialog(this); * */ BrolType brolType; AWSSearchIndices.Indice indice = searchIndexCB.SelectedItem as AWSSearchIndices.Indice; //MessageBox.Show("indice : " + indice.Display); switch(indice.Display) { case "DVD": brolType = filmsType; break; case "Livres": brolType = bookType; break; case "Musique classique": brolType = musicType; break; case "Musique (Numérique)": brolType = musicType; break; case "Livres étrangers": brolType = bookType; break; case "Hobby": brolType = softwareType; break; case "Magazines": brolType = bookType; break; case "Divers": brolType = softwareType; break; case "Musique": brolType = musicType; break; case "Musique (Pistes audio)": brolType = musicType; break; case "Matériel PC": brolType = softwareType; break; case "Programmes": brolType = softwareType; break; case "Jeux": brolType = softwareType; break; case "VHS": brolType = filmsType; break; case "Tous les films": brolType = filmsType; break; case "Jeux (Video)": brolType = softwareType; break; default: brolType = softwareType; break; } brol.BrolType = brolType; form.InnerControl.setBrol(brol, brolType); form.InnerControl.setCover(coverPB.ImageLocation); form.MdiParent = this.MdiParent; form.WindowState = FormWindowState.Maximized; form.Show(); //form.ShowDialog(this); } } }
Structure et Fichiers du projet
Afficher/masquer...Icône | Nom | Taille | Modification |
Icône | Nom | Taille | Modification |
| _ | Répertoire parent | 0 octets | 1732487035 24/11/2024 23:23:55 |
| _ | wizards | 0 octets | 1541007184 31/10/2018 18:33:04 |
| _ | utils | 0 octets | 1541007184 31/10/2018 18:33:04 |
| _ | controls | 0 octets | 1541007178 31/10/2018 18:32:58 |
| _ | dialogs | 0 octets | 1541007183 31/10/2018 18:33:03 |
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//AWSForm.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.