//-------------------------------------------------------------------------------- /// <summary> /// The method actually used to update the listview. /// </summary> /// <param name="eventName"></param> /// <param name="filterName"></param> /// <param name="fileName"></param> private void InvokedCreateVignette(int numPhoto, string fileName) { Log.Debug("Création de la vignette n° " + numPhoto.ToString() + " {FILE:" + fileName + "}"); LibLabo.Ctrls.PhotoControl.InfoVignette _infoPhoto; _infoPhoto.numPhoto = numPhoto; _infoPhoto.namePhoto = fileName; _infoPhoto.tagPhoto = fileName; LibLabo.Ctrls.PhotoControl _ctrlPhoto = new LibLabo.Ctrls.PhotoControl(_infoPhoto, p_applClass.ImgParam); _ctrlPhoto.ActiveMenu = false; //On ajoute le PictureBox dans le Panel tblImg.Controls.Add(_ctrlPhoto, currentColumn, currentRow); // On gère les colonnes, lignes currentColumn++; if (currentColumn >= 4) { currentColumn = 0; currentRow++; } if (numPhoto == 1) { _ctrlPhoto.SelectPhoto(); p_numPhotoSelected = 1; } // On contrôle des données EXIF if ((p_applClass.Param.CtrlAperture && (_ctrlPhoto.Aperture != "F/" + p_applClass.Param.ApertureValue)) || (p_applClass.Param.CtrlSpeed && (_ctrlPhoto.Speed != "1/" + p_applClass.Param.SpeedValue)) || (p_applClass.Param.CtrlImageSize && (_ctrlPhoto.ImageSize < p_applClass.Param.MinImageSize))) { _ctrlPhoto.InvalidEXIF(); } }
/// <summary> /// Affiche l'écran de sélection des photos /// </summary> private void openSelectView() { Log.Debug("Ouverture du Formulaire [Sélection Photographe]"); if (tblImg.Controls.Count > 0 && p_SessionBase.Content.ListElement.Count > 0) { IElement _element = p_SessionBase.Content.ListElement[p_numItemSelected]; ClassOutils.WaitCursor(); List<PhotoControl> p_listPhoto = new List<PhotoControl>(); foreach (Control _ctrl in tblImg.Controls) { PhotoControl _photoCtrl = (PhotoControl)_ctrl; p_listPhoto.Add(new PhotoControl(_photoCtrl.InfoPhoto, _photoCtrl.InfParam)); //p_listPhoto.Add(_photoCtrl); } this.clearAllVignette(); ClassOutils.DefaultCursor(); ManageEventHandlers(false); frmSelectView _frmSelectView = new frmSelectView(_element, p_numPhotoSelected, p_listPhoto, p_SessionBase, p_applClass); if (_frmSelectView.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { ClassOutils.WaitCursor(); currentColumn = 0; currentRow = 0; p_numPhotoSelected = _frmSelectView.NumPhotoSelected; if (_element.InfosPDV.NbExemplaires == 0) { _element.InfosPDV.NbExemplaires++; } if (_element.GetType() == typeof(Person)) { if ((_element as Person).Absent == Constantes.cstOui) { this.btnAbsent_Click(null, null); } } //p_SessionBase.Content.NbDone++; this.setStatusDisplay(lstPupils.Items[p_numItemSelected], _element); p_nbPhoto = 0; p_SessionBase.SaveSession(); p_applClass.updateSessionInfo(p_SessionBase); this.actualiseCompteurs(); this.reloadPhotos(); this.navigateNext(); _frmSelectView.Dispose(); } else { ClassOutils.WaitCursor(); // Quelque soit le résultat, en retour il faut mettre à jour la liste des photos currentColumn = 0; currentRow = 0; foreach (PhotoControl _photoCtrl in _frmSelectView.ListPhoto) { PhotoControl _localPhoto = new PhotoControl(_photoCtrl.InfoPhoto, _photoCtrl.InfParam); //On ajoute le PictureBox dans le Panel tblImg.Controls.Add(_localPhoto, currentColumn, currentRow); // On gère les colonnes, lignes currentColumn++; if (currentColumn >= 4) { currentColumn = 0; currentRow++; } // On contrôle des données EXIF if ((p_applClass.Param.CtrlAperture && (_localPhoto.Aperture != "F/" + p_applClass.Param.ApertureValue)) || (p_applClass.Param.CtrlSpeed && (_localPhoto.Speed != "1/" + p_applClass.Param.SpeedValue))) { _localPhoto.InvalidEXIF(); } } } ManageEventHandlers(true); ClassOutils.DefaultCursor(); } }