private void NotifyAdd(IPoderosaForm form, IPoderosaDocument document) { IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { window.DocumentTabFeature.Add(document); } }
public void RefreshDocumentStatus(IPoderosaDocument document) { DocumentHost dh = FindDocumentHost(document); Debug.Assert(dh != null); IPoderosaForm f = ViewToForm(dh.LastAttachedView); //ちょっと汚い分岐 IPoderosaMainWindow mw = (IPoderosaMainWindow)f.GetAdapter(typeof(IPoderosaMainWindow)); if (mw != null) { mw.DocumentTabFeature.Update(document); } else { ((IPoderosaPopupWindow)f.GetAdapter(typeof(IPoderosaPopupWindow))).UpdateStatus(); } }
private IPoderosaDocument ViewToActiveDocument(IPoderosaView view) { IPoderosaForm form = view.ParentForm; IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { return(window.DocumentTabFeature.ActiveDocument); } else { return(view.Document); } }
private void NotifyRemove(IPoderosaForm form, IPoderosaDocument document) { IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { IPoderosaDocument former = window.DocumentTabFeature.ActiveDocument; window.DocumentTabFeature.Remove(document); //TODO アクティブなのを記憶する場所を変えることでタブへの通知を先にする制約から解放される if (former == document) { foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) { listener.OnDocumentDeactivated(window); } } } }
//ビューにフォーカスをセットした状態にする。ポップアップウィンドウの場合、まだウィンドウがロードされていないケースもあるのでそこに注意! private void SetFocusToView(IPoderosaView view) { IPoderosaForm form = view.ParentForm; IPoderosaPopupWindow popup = (IPoderosaPopupWindow)form.GetAdapter(typeof(IPoderosaPopupWindow)); if (popup != null) { if (!popup.AsForm().Visible) { popup.UpdateStatus(); popup.AsForm().Show(); } } if (!view.AsControl().Focused) { view.AsControl().Focus(); //既にウィンドウは見えている } }
private void NotifyActivation(IPoderosaForm form, IPoderosaDocument document, ActivateReason reason) { Debug.Assert(document != null); IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { //Tabへの通知。TabClickのときはTabが自前で処理してるのでOK if (reason != ActivateReason.TabClick) { window.DocumentTabFeature.Activate(document); } //listenerへの通知 foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) { listener.OnDocumentActivated(window, document); } } }
private void NotifyRemove(IPoderosaForm form, IPoderosaDocument document) { IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { IPoderosaDocument former = window.DocumentTabFeature.ActiveDocument; window.DocumentTabFeature.Remove(document); //TODO アクティブなのを記憶する場所を変えることでタブへの通知を先にする制約から解放される if (former == document) { foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) listener.OnDocumentDeactivated(window); } } }
private void NotifyAdd(IPoderosaForm form, IPoderosaDocument document) { IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) window.DocumentTabFeature.Add(document); }
private void NotifyActivation(IPoderosaForm form, IPoderosaDocument document, ActivateReason reason) { Debug.Assert(document != null); IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { //Tabへの通知。TabClickのときはTabが自前で処理してるのでOK if (reason != ActivateReason.TabClick) window.DocumentTabFeature.Activate(document); //listenerへの通知 foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) listener.OnDocumentActivated(window, document); } }
private void NotifyRemove(IPoderosaForm form, IPoderosaDocument document) { IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { IPoderosaDocument former = window.DocumentTabFeature.ActiveDocument; window.DocumentTabFeature.Remove(document); //TODO �A�N�e�B�u�Ȃ̂�L������ꏊ��ς��邱�ƂŃ^�u�ւ̒ʒm���ɂ��鐧��������� if (former == document) { foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) listener.OnDocumentDeactivated(window); } } }
private void NotifyActivation(IPoderosaForm form, IPoderosaDocument document, ActivateReason reason) { Debug.Assert(document != null); IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow)); if (window != null) { //Tab�ւ̒ʒm�BTabClick�̂Ƃ���Tab�����O�ŏ������Ă�̂�OK if (reason != ActivateReason.TabClick) window.DocumentTabFeature.Activate(document); //listener�ւ̒ʒm foreach (IActiveDocumentChangeListener listener in _activeDocumentChangeListeners) listener.OnDocumentActivated(window, document); } }