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