コード例 #1
0
ファイル: BusyOverlay.cs プロジェクト: windygu/AnkhSVN
        void OnToolWindowVisibleChanged(object sender, EventArgs e)
        {
            IAnkhToolWindowControl tw = _top as IAnkhToolWindowControl;

            if (tw == null)
            {
                return;
            }

            if (_pb != null && !tw.ToolWindowVisible)
            {
                _pb.Dispose();
                _pb = null;
            }
        }
コード例 #2
0
ファイル: TheVSTextEditor.cs プロジェクト: necora/ank_git
 void InitializeToolWindow(IAnkhToolWindowControl toolWindow)
 {
     _inToolWindow = true;
     Init(toolWindow.ToolWindowHost, false);
     toolWindow.ToolWindowHost.AddCommandTarget(_nativeWindow);
 }
コード例 #3
0
ファイル: VSCommandInstaller.cs プロジェクト: windygu/AnkhSVN
        public void Install(Control control, System.ComponentModel.Design.CommandID command, EventHandler <Ankh.Commands.CommandEventArgs> handler, EventHandler <Ankh.Commands.CommandUpdateEventArgs> updateHandler)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            IAnkhCommandHookAccessor acc = null;
            Control ctrl = control;

            while (ctrl != null)
            {
                acc = ctrl as IAnkhCommandHookAccessor;

                if (acc != null)
                {
                    break;
                }

                ctrl = ctrl.Parent;
            }
            if (acc == null)
            {
                return; // Can't install hook
            }
            if (acc.CommandHook != null)
            {
                acc.CommandHook.Install(control, command, handler, updateHandler);
                return;
            }

            Control topParent = control.TopLevelControl;

            if (topParent == null)
            {
                Control p = control;
                while (p != null)
                {
                    topParent = p;
                    p         = p.Parent;
                }
            }

            IAnkhVSContainerForm ct = topParent as IAnkhVSContainerForm;

            if (ct != null)
            {
                ContextCommandHandler cx = new ContextCommandHandler(this, topParent);
                acc.CommandHook = cx;
                cx.Install(control, command, handler, updateHandler);
                ct.AddCommandTarget(cx);
                return;
            }

            IAnkhToolWindowControl toolWindow = topParent as IAnkhToolWindowControl;

            if (toolWindow != null && toolWindow.ToolWindowHost != null)
            {
                ContextCommandHandler cx = new ContextCommandHandler(this, topParent);
                acc.CommandHook = cx;
                cx.Install(control, command, handler, updateHandler);
                toolWindow.ToolWindowHost.AddCommandTarget(cx);
                return;
            }
        }