//-------------------------------------------------------------------------------------- public static void RegisterExecuteur(Type typeNotification, IExecuteurNotificationPopup executeur) { if (executeur == null) { return; } AssureRecepteur(typeNotification); m_dicTypeNotificationToExecuteur[typeNotification] = executeur; }
//-------------------------------------------------------------------------------------- public static void ExecuteNotification(IDonneeNotification d) { if (d == null) { return; } IExecuteurNotificationPopup executeur = null; if (m_dicTypeNotificationToExecuteur.TryGetValue(d.GetType(), out executeur)) { try { executeur.ExecuteNotification(d); } catch { } } }
//-------------------------------------------------------------------------------------- public static void recepteur_OnReceiveNotification(IDonneeNotification donnee) { if (donnee == null) { return; } IExecuteurNotificationPopup executeur = null; if (m_dicTypeNotificationToExecuteur.TryGetValue(donnee.GetType(), out executeur)) { bool bShouldDisplay = true; string strLibelle = ""; Image img = null; executeur.GetInfosPopup(donnee, ref bShouldDisplay, ref strLibelle, ref img); if (bShouldDisplay) { CFormNotificationPopup.Instance.ShowMessage( strLibelle, img, donnee); } } }