예제 #1
0
        //--------------------------------------------------------------------------------------
        public static void RegisterExecuteur(Type typeNotification, IExecuteurNotificationPopup executeur)
        {
            if (executeur == null)
            {
                return;
            }

            AssureRecepteur(typeNotification);
            m_dicTypeNotificationToExecuteur[typeNotification] = executeur;
        }
예제 #2
0
        //--------------------------------------------------------------------------------------
        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 { }
            }
        }
예제 #3
0
        //--------------------------------------------------------------------------------------
        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);
                }
            }
        }