Exemplo n.º 1
0
 internal void CleanupSession(SessionHost sh)   //SessionHostからも呼ばれるのでinternal
 {
     foreach (ISessionListener listener in _sessionListeners)
     {
         listener.OnSessionEnd(sh.Session);
     }
     foreach (IPoderosaDocument doc in sh.ClonedDocuments)
     {
         CleanupDocument(FindDocumentHost(doc));
     }
     sh.Session.InternalTerminate();
     _sessionMap.Remove(sh.Session);
 }
Exemplo n.º 2
0
        public PrepareCloseResult TerminateSession(ISession session)
        {
            SessionHost        sh = FindSessionHost(session);
            PrepareCloseResult r  = sh.Session.PrepareCloseSession();

            Debug.Assert(r != PrepareCloseResult.ContinueSession, "sanity");
            if (r == PrepareCloseResult.Cancel)
            {
                return(r);
            }

            CleanupSession(sh);
            return(r);
        }
Exemplo n.º 3
0
        public void StartNewSession(ISession session, IPoderosaView firstView)
        {
            firstView = AdjustToOuterView(firstView);
            SessionHost host = new SessionHost(this, session);

            _sessionMap.Add(session, host);
            session.InternalStart(host);
            foreach (ISessionListener listener in _sessionListeners)
            {
                listener.OnSessionStart(session);
            }

            //この時点で、少なくとも一つドキュメントがないといけない。2つ以上は不可、でもいいかもしれない
            if (host.DocumentCount == 0)
            {
                throw new InvalidOperationException("session must register at least one document in InternalStart()");
            }
            AttachDocumentAndView(host.DocumentAt(0), firstView);
        }
Exemplo n.º 4
0
        //ISessionManagerの終了系 細かいのはドキュメントあり
        public PrepareCloseResult CloseDocument(IPoderosaDocument document)
        {
            DocumentHost dh = FindDocumentHost(document);

            Debug.Assert(dh != null);
            SessionHost        sh = dh.SessionHost;
            PrepareCloseResult r  = sh.Session.PrepareCloseDocument(document);

            if (r == PrepareCloseResult.Cancel)
            {
                return(r);
            }

            CleanupDocument(dh);
            if (r == PrepareCloseResult.TerminateSession || sh.DocumentCount == 0)
            {
                CleanupSession(sh);
            }
            return(r);
        }
Exemplo n.º 5
0
        public void StartNewSession(ISession session, IPoderosaView firstView) {
            firstView = AdjustToOuterView(firstView);
            SessionHost host = new SessionHost(this, session);
            _sessionMap.Add(session, host);
            session.InternalStart(host);
            foreach (ISessionListener listener in _sessionListeners)
                listener.OnSessionStart(session);

            //この時点で、少なくとも一つドキュメントがないといけない。2つ以上は不可、でもいいかもしれない
            if (host.DocumentCount == 0)
                throw new InvalidOperationException("session must register at least one document in InternalStart()");
            AttachDocumentAndView(host.DocumentAt(0), firstView);
        }
Exemplo n.º 6
0
 public void AddClosingSession(SessionHost sh) {
     Debug.Assert(_type == CloseType.OneWindow);
     _closingSessions.Add(sh);
 }
Exemplo n.º 7
0
 public DocumentHost(SessionManagerPlugin manager, SessionHost sessionHost, IPoderosaDocument document) {
     _manager = manager;
     _sessionHost = sessionHost;
     _document = document;
 }
Exemplo n.º 8
0
 //SessionHostから呼ばれる系列
 public void RegisterDocument(IPoderosaDocument document, SessionHost sessionHost) {
     _documentMap.Add(document, new DocumentHost(this, sessionHost, document));
 }
Exemplo n.º 9
0
 internal void CleanupSession(SessionHost sh) { //SessionHostからも呼ばれるのでinternal
     foreach (ISessionListener listener in _sessionListeners)
         listener.OnSessionEnd(sh.Session);
     foreach (IPoderosaDocument doc in sh.ClonedDocuments) {
         CleanupDocument(FindDocumentHost(doc));
     }
     sh.Session.InternalTerminate();
     _sessionMap.Remove(sh.Session);
 }
Exemplo n.º 10
0
 public void AddClosingSession(SessionHost sh)
 {
     Debug.Assert(_type == CloseType.OneWindow);
     _closingSessions.Add(sh);
 }
Exemplo n.º 11
0
 public DocumentHost(SessionManagerPlugin manager, SessionHost sessionHost, IPoderosaDocument document)
 {
     _manager     = manager;
     _sessionHost = sessionHost;
     _document    = document;
 }
Exemplo n.º 12
0
 //SessionHostから呼ばれる系列
 public void RegisterDocument(IPoderosaDocument document, SessionHost sessionHost)
 {
     _documentMap.Add(document, new DocumentHost(this, sessionHost, document));
 }
Exemplo n.º 13
0
        public void StartNewSession(ISession session, IPoderosaView firstView)
        {
            firstView = AdjustToOuterView(firstView);
            SessionHost host = new SessionHost(this, session);
            _sessionMap.Add(session, host);
            session.InternalStart(host);
            foreach (ISessionListener listener in _sessionListeners)
                listener.OnSessionStart(session);

            //���̎��_�ŁA���Ȃ��Ƃ��ƒh�L�������g���Ȃ��Ƃ����Ȃ��B�Q�ˆȏ�͕s�A�ł�����������Ȃ�
            if (host.DocumentCount == 0)
                throw new InvalidOperationException("session must register at least one document in InternalStart()");
            AttachDocumentAndView(host.DocumentAt(0), firstView);
        }