Esempio n. 1
0
        ///////////////////////////////////////////////
        public virtual void CloseSession()
        {
            if (!m_bIsOpen)
            {
                return;
            }
            DateTime dt = DateTime.Now;

            if (BeforeClosingSession != null)
            {
                BeforeClosingSession(this);
            }
            TimeSpan sp = DateTime.Now - dt;

            //Console.WriteLine("Closing " + m_nIdSession + " : 1-" + sp.TotalMilliseconds);
            CGestionnaireObjetsAttachesASession.OnCloseSession(IdSession);
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 2-" + sp.TotalMilliseconds);
            if (OnCloseSession != null)
            {
                OnCloseSession(this, new EventArgs());
            }
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 3-" + sp.TotalMilliseconds);
            m_tableSessionParId.Remove(IdSession);
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 4-" + sp.TotalMilliseconds);
            m_tableSessionsLocales.Remove(IdSession);
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 5-" + sp.TotalMilliseconds);
            if (m_sessionSurServeur != null)
            {
                m_sessionSurServeur.CloseSession();
            }
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 6-" + sp.TotalMilliseconds);
            m_sessionSurServeur = null;
            if (m_cacheInfosUtilisateur != null)
            {
                m_cacheInfosUtilisateur.Dispose();
            }
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 7-" + sp.TotalMilliseconds);
            m_cacheInfosUtilisateur = null;
            //Nettoie les recepteurs de notification
            m_tableRecepteursParType.Clear();
            GetDataThread(m_bUseSessionUtilisateurData).PopIdSession();
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 8-" + sp.TotalMilliseconds);
            m_bIsOpen = false;

            m_sponsor.Unregister(m_sessionSurServeur);
            sp = DateTime.Now - dt;
            //Console.WriteLine("Closing " + m_nIdSession + " : 9-" + sp.TotalMilliseconds);
            m_sessionSurServeur = null;
        }
Esempio n. 2
0
        //---------------------------------------------------------
        protected CSousSessionClient(int nIdSessionPrincipale)
            : base()
        {
            m_nIdSessionPrincipale = nIdSessionPrincipale;
            CGestionnaireObjetsAttachesASession.AttacheObjet(nIdSessionPrincipale, this);
            CSessionClient session = RootSession;

            //Copie les propriétés de la session principale
            foreach (string strProp in session.GetProprietes())
            {
                SetPropriete(strProp, session.GetPropriete(strProp));
            }
        }
Esempio n. 3
0
 //---------------------------------------------------------
 void IObjetAttacheASession.OnCloseSession()
 {
     CGestionnaireObjetsAttachesASession.DetacheObjet(m_nIdSessionPrincipale, this);
     CloseSession();
 }