Ejemplo n.º 1
0
        /// <summary>
        /// Handles focusing on tabs/windows which host PuTTY
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e)
        {
            if (dockPanel1.ActiveDocument is ctlPuttyPanel)
            {
                ctlPuttyPanel p = (ctlPuttyPanel)dockPanel1.ActiveDocument;

                this.Text = p.ApplicationTitle.Replace(" - PuTTY", "") + " - PuttyWrap";
                p.Text    = p.ApplicationTitle.Replace(" - PuTTY", "");
                p.SetFocusToChildApplication();
            }
        }
Ejemplo n.º 2
0
        public void CreatePuttyPanel(SessionData sessionData)
        {
            ctlPuttyPanel sessionPanel = null;

            // This is the callback fired when the panel containing the terminal is closed
            // We use this to save the last docking location
            PuttyClosedCallback callback = delegate(bool closed)
            {
                if (sessionPanel != null)
                {
                    // save the last dockstate (if it has been changed)
                    if (sessionData.LastDockstate != sessionPanel.DockState &&
                        sessionPanel.DockState != DockState.Unknown &&
                        sessionPanel.DockState != DockState.Hidden)
                    {
                        sessionData.LastDockstate = sessionPanel.DockState;
                        sessionData.SaveToRegistry();
                    }

                    if (sessionPanel.InvokeRequired)
                    {
                        this.BeginInvoke((MethodInvoker) delegate()
                        {
                            sessionPanel.Close();
                        });
                    }
                    else
                    {
                        sessionPanel.Close();
                    }
                }
            };

            sessionPanel = new ctlPuttyPanel(this, sessionData, callback);
            sessionPanel.Show(dockPanel1, sessionData.LastDockstate);
        }
Ejemplo n.º 3
0
        public void CreatePuttyPanel(SessionData sessionData)
        {
            ctlPuttyPanel sessionPanel = null;

            // This is the callback fired when the panel containing the terminal is closed
            // We use this to save the last docking location
            PuttyClosedCallback callback = delegate(bool closed)
            {
                if (sessionPanel != null)
                {
                    // save the last dockstate (if it has been changed)
                    if (sessionData.LastDockstate != sessionPanel.DockState
                        && sessionPanel.DockState != DockState.Unknown
                        && sessionPanel.DockState != DockState.Hidden)
                    {
                        sessionData.LastDockstate = sessionPanel.DockState;
                        sessionData.SaveToRegistry();
                    }

                    if (sessionPanel.InvokeRequired)
                    {
                        this.BeginInvoke((MethodInvoker)delegate()
                        {
                            sessionPanel.Close();
                         });
                    }
                    else
                    {
                        sessionPanel.Close();
                    }
                }
            };

            sessionPanel = new ctlPuttyPanel(this, sessionData, callback);
            sessionPanel.Show(dockPanel1, sessionData.LastDockstate);
        }