/// ////////////////////////////////////////////////////////////////// public CCacheInfoUtilisateurSurClient(int nIdSession, IInfoUtilisateur infoServeur) { m_nIdSession = nIdSession; m_infoUtilisateurSurServeur = infoServeur; m_sponsor.Register(m_infoUtilisateurSurServeur); InitFromInfoServeur(); m_recepteurNotificationChangementDroit = new CRecepteurNotification(m_nIdSession, typeof(CDonneeNotificationChangementDroitUtilisateur)); m_recepteurNotificationChangementDroit.OnReceiveNotification += new NotificationEventHandler(OnNotificationChangementDroit); }
/// ////////////////////////////////////////////////////////////////////////// public void UnregisterRecepteurNotification(CRecepteurNotification recepteur) { lock (typeof(CLockerListeRecepteurs)) { foreach (ArrayList lst in m_tableRecepteursParType.Values) { lst.Remove(recepteur); } } }
/// ////////////////////////////////////////////////////////////////// public void Dispose() { m_sponsor.Unregister(m_infoUtilisateurSurServeur); m_infoUtilisateurSurServeur = null; m_sponsor.Dispose(); m_sponsor = null; if (m_recepteurNotificationChangementDroit != null) { m_recepteurNotificationChangementDroit.Dispose(); } m_recepteurNotificationChangementDroit = null; }
/// ////////////////////////////////////////////////////////////////////////// public void RegisterRecepteurNotification(CRecepteurNotification recepteur, Type typeDeNotificationGeree) { lock (typeof(CLockerListeRecepteurs)) { recepteur.IdRecepteur = m_nProchainIdRecepteur; m_nProchainIdRecepteur++; ArrayList lst = (ArrayList)m_tableRecepteursParType[typeDeNotificationGeree]; if (lst == null) { lst = new ArrayList(); m_tableRecepteursParType[typeDeNotificationGeree] = lst; } if (!lst.Contains(recepteur)) { lst.Add(recepteur); } } }