Example #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);
 }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
Example #6
0
 public void AddClosingSession(SessionHost sh) {
     Debug.Assert(_type == CloseType.OneWindow);
     _closingSessions.Add(sh);
 }
Example #7
0
 public DocumentHost(SessionManagerPlugin manager, SessionHost sessionHost, IPoderosaDocument document) {
     _manager = manager;
     _sessionHost = sessionHost;
     _document = document;
 }
Example #8
0
 //SessionHostから呼ばれる系列
 public void RegisterDocument(IPoderosaDocument document, SessionHost sessionHost) {
     _documentMap.Add(document, new DocumentHost(this, sessionHost, document));
 }
Example #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);
 }
Example #10
0
 public void AddClosingSession(SessionHost sh)
 {
     Debug.Assert(_type == CloseType.OneWindow);
     _closingSessions.Add(sh);
 }
Example #11
0
 public DocumentHost(SessionManagerPlugin manager, SessionHost sessionHost, IPoderosaDocument document)
 {
     _manager     = manager;
     _sessionHost = sessionHost;
     _document    = document;
 }
Example #12
0
 //SessionHostから呼ばれる系列
 public void RegisterDocument(IPoderosaDocument document, SessionHost sessionHost)
 {
     _documentMap.Add(document, new DocumentHost(this, sessionHost, document));
 }
Example #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);
        }