Esempio n. 1
0
        private void NotifyAdd(IPoderosaForm form, IPoderosaDocument document)
        {
            IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow));

            if (window != null)
            {
                window.DocumentTabFeature.Add(document);
            }
        }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
                    }
                }
            }
        }
Esempio n. 5
0
        //ビューにフォーカスをセットした状態にする。ポップアップウィンドウの場合、まだウィンドウがロードされていないケースもあるのでそこに注意!
        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(); //既にウィンドウは見えている
            }
        }
Esempio n. 6
0
        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);
                }
            }
        }
Esempio n. 7
0
 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);
         }
     }
 }
Esempio n. 8
0
 private void NotifyAdd(IPoderosaForm form, IPoderosaDocument document) {
     IPoderosaMainWindow window = (IPoderosaMainWindow)form.GetAdapter(typeof(IPoderosaMainWindow));
     if (window != null)
         window.DocumentTabFeature.Add(document);
 }
Esempio n. 9
0
        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);
            }
        }
Esempio n. 10
0
 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);
         }
     }
 }
Esempio n. 11
0
        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);
            }
        }