//------------------------------------------------------------------------- protected override CResultAErreur MyInitChamps() { CResultAErreur result = base.MyInitChamps(); if (!result) { return(result); } result = InitComboBoxCategorie(false); if (result) { result = InitComboBoxStructure(false); } if (!result) { return(result); } m_cmbCategorie.SelectedValue = Rapport.CategorieRapport; m_cmbModeleStructure.ElementSelectionne = Rapport.ModeleDonnees; AffecterTitre(I.T("Crystal Report|469") + " " + Rapport.Libelle); if (m_proxyReport != null) { m_proxyReport.Dispose(); m_proxyReport = null; } if (Rapport.DocumentGED != null) { m_proxyReport = new CProxyGED(Rapport.ContexteDonnee.IdSession, Rapport.DocumentGED.ReferenceDoc); } else { m_proxyReport = new CProxyGED(Rapport.ContexteDonnee.IdSession, null); m_proxyReport.CreateNewFichier(); } if (Rapport.MultiStructure != null) { m_panelMultiStructure.Init(Rapport.MultiStructure); } else { m_panelMultiStructure.Init(new CMultiStructureExport(Rapport.ContexteDonnee)); } UpdateDispoControles(); return(result); }
private void UpdateVisuel() { m_picDocument.Visible = !m_wndDocuments.HideHeader; this.SuspendDrawing(); bool bPreviewVisible = false; if (m_listeDocuments.Count == 1 && m_wndDocuments.DisplayDocuments) { CDocumentGED doc = m_listeDocuments[0]; if (m_proxyVisu != null) { m_proxyVisu.Dispose(); m_proxyVisu = null; } m_proxyVisu = new CProxyGED(doc.ContexteDonnee.IdSession, doc.ReferenceDoc); if (!m_proxyVisu.CopieFichierEnLocal()) { m_proxyVisu.Dispose(); m_proxyVisu = null; } else { if (m_visualiseurGed.ShowDocument(m_proxyVisu.NomFichierLocal)) { m_lblDocument.Visible = false; m_visualiseurGed.Dock = DockStyle.Fill; m_visualiseurGed.Visible = true; bPreviewVisible = true; } } } if (!bPreviewVisible) { m_visualiseurGed.Visible = false; m_lblDocument.Visible = true; bool bShowLabel = m_listeDocuments.Count == 1 && m_listeDocuments[0].Libelle.Length > 0; if (bShowLabel) { m_lblDocument.Text = m_listeDocuments[0].Libelle; } else { if (m_listeDocuments.Count == 0) { m_lblDocument.Text = I.T("No document|20758"); } else { m_lblDocument.Text = I.T("@1 document(s)|20759", m_listeDocuments.Count.ToString()); } } } this.ResumeDrawing(); }
//------------------------------------------------------------------------------------- public static void AfficheAlarmes(CMemoryDb database, CParametrageAffichageListeAlarmes paramConsultation, CFormNavigateur nav) { CFormConsultationAlarmesEnCours form = new CFormConsultationAlarmesEnCours(); form.Text = paramConsultation.Libelle; form.m_dataBase = database; form.m_navigateur = nav; form.TopMost = false; CParametreAffichageListeAlarmes parametre = paramConsultation.ParametreAffichageAlarmes; if (parametre == null) { parametre = CParametreAffichageListeAlarmes.ParametreParDefaut; } form.m_parametreAffichage = parametre; CDocumentGED docSonnerie = paramConsultation.DocumentFichierSon; if (docSonnerie != null && docSonnerie.ReferenceDoc != null) { CProxyGED proxySonnerie = new CProxyGED(paramConsultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc); if (proxySonnerie.CopieFichierEnLocal()) { form.m_proxySonnerie = proxySonnerie; } else { proxySonnerie.Dispose(); proxySonnerie = null; } } form.m_dicImages.Clear(); CListeObjetsDonnees listTypesAlarmes = new CListeObjetsDonnees(paramConsultation.ContexteDonnee, typeof(CTypeAlarme)); foreach (CTypeAlarme typeAlarme in listTypesAlarmes) { if (typeAlarme.Image != null) { form.m_dicImages.Add(typeAlarme.Id.ToString(), typeAlarme.Image); } } form.Show(); }
//---------------------------------------------------------------------- /// <summary> /// Nettoyage des ressources utilisées. /// </summary> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } if (m_fichierDonnees != null) { m_fichierDonnees.Dispose(); } m_fichierDonnees = null; } base.Dispose(disposing); if (m_proxyGED != null) { m_proxyGED.Dispose(); } }
public CFormListeAlarmeEnCours(CConsultationAlarmesEnCoursInDb consultation, CFormNavigateur navigateur) { c_nBaseControleRetombee = 15000 / c_nTimeClignote; List <string> strNomColonnes; string st; TimeSpan duree; DateTime start, stop; m_consultationEnCours = consultation; m_navigateur = navigateur; start = DateTime.Now; InitializeComponent(); this.Text = consultation.Libelle; m_timerVoyant.Enabled = true; stop = DateTime.Now; duree = stop - start; //test duree = 8 sec !!!!!!! m_recepteurNotifications = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmes)); m_recepteurNotifications.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAlarmEnCours); /* m_recepteurNotificationsStop = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesStop)); * m_recepteurNotificationsStop.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationStop); * * m_recepteurNotificationsMask = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesMask)); * m_recepteurNotificationsMask.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationMask); * * m_recepteurNotificationsAcknowledge = new CRecepteurNotification(CSc2iWin32DataClient.ContexteCourant.IdSession, typeof(CDonneeNotificationAlarmesAcknowledge)); * m_recepteurNotificationsAcknowledge.OnReceiveNotification += new NotificationEventHandler(OnReceiveNotificationAcknowledge);*/ List <CInfoAlarmeAffichee> lstEnCours = new List <CInfoAlarmeAffichee>(); List <CInfoAlarmeAffichee> lstRetombe = new List <CInfoAlarmeAffichee>(); m_lstViewEnCours.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetEnCours); m_lstViewRetombe.OnGetDonneesObjet += new GetDonneesLigneEventHandler(GetDonneesObjetRetombe); m_lstViewEnCours.DoubleClick += new EventHandler(OnLstViewEnCoursDoubleClick); m_lstViewRetombe.DoubleClick += new EventHandler(OnLstViewRetombeDoubleClick); lstEnCours = GetAlarmsInfoFromDB(); strNomColonnes = m_consultationEnCours.Parametres.GetColumnNames(); m_lstViewEnCours.Init(strNomColonnes.ToArray(), lstEnCours.ToArray()); st = I.T("End date|60023"); strNomColonnes.Add(st); st = I.T("Duration|60022"); strNomColonnes.Add(st); m_lstViewRetombe.Init((string[])strNomColonnes.ToArray(), lstRetombe.ToArray()); m_strMaskAdminButtonText = I.T("Alarms masked by Administrator|60016") + " : "; m_strMaskBrigButtonText = I.T("Alarms masked by Operating agent|60017") + " : "; m_strFrequentButtonText = I.T("Current frequent alarms|60018") + " : "; InitButtonsInfo(); MAJFrequentButtonText(); MAJAdminButtonText(); MAJBrigButtonText(); m_btnMaskedOnCreation.Text = I.T("Alarms masked on creation|60047") + " : " + m_NbMasqCreat.ToString(); label1.Text = I.T("Current alarms|60014"); label2.Text = I.T("Cleared alarms|60015"); CDocumentGED docSonnerie = consultation.DocumentGEDSoundFile; if (docSonnerie != null && docSonnerie.ReferenceDoc != null) { m_proxySonnerie = new CProxyGED(consultation.ContexteDonnee.IdSession, docSonnerie.ReferenceDoc); if (!m_proxySonnerie.CopieFichierEnLocal()) { m_proxySonnerie.Dispose(); m_proxySonnerie = null; } } //SetVoyantAlarme(); Type tpVar = GetType(); Type tpGeneric = typeof(List <>); tpGeneric = tpGeneric.MakeGenericType(tpVar); object liste = Activator.CreateInstance(tpGeneric); }