Ejemplo n.º 1
0
        //Update remote shell with output
        public void UpdateRemoteShell(int ConnectionId, string Output)
        {
            foreach (RemoteShell RS in Application.OpenForms.OfType <RemoteShell>())
            {
                if (RS.Visible && RS.ConnectionID == ConnectionId && RS.Update)
                {
                    if (string.IsNullOrWhiteSpace(RS.txtConsole.Text))
                    {
                        RS.txtConsole.Text = Output;
                    }
                    else
                    {
                        RS.txtConsole.AppendText(Environment.NewLine + Output);
                    }
                    return;
                }
            }

            RS = new RemoteShell();
            RS.ConnectionID = ConnectionId;
            RS.Text         = "Remote Shell - " + ConnectionId;
            RS.Show();
            if (RS.ConnectionID == ConnectionId)
            {
                if (string.IsNullOrWhiteSpace(RS.txtConsole.Text))
                {
                    RS.txtConsole.Text = Output;
                }
                else
                {
                    RS.txtConsole.AppendText(Environment.NewLine + Output);
                }
            }
        }
Ejemplo n.º 2
0
        private void RemoteShellMenuItem_Click(object sender, EventArgs e)
        {
            var Form = new RemoteShell();

            Form.Show(this);
            Form.Activate();
        }