Exemplo n.º 1
0
        public CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
        {
            ISSHConnection sshConnection = GetSSHConnection(target);

            // Note: Currently, SCPClient supports only SSH2.
            if (sshConnection == null || sshConnection.SSHProtocol != SSHProtocol.SSH2)
            {
                return(CommandResult.Ignored);
            }

            string connectionName = GetTerminalName(target);

            if (connectionName == null)
            {
                connectionName = SFTPPlugin.Instance.StringResource.GetString("Common.UnknownPeer");
            }

            Form ownerForm = GetForm(target);

            if (!ConfirmToUse(ownerForm, "SCP"))
            {
                return(CommandResult.Cancelled);
            }

            SCPClient scp = new SCPClient(sshConnection);

            SCPForm form = new SCPForm(ownerForm, scp, connectionName);

            form.Show();    // Note: don't specify owner to avoid fixed z-order.

            return(CommandResult.Succeeded);
        }
Exemplo n.º 2
0
        public CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
        {
            ISSHConnection sshConnection = GetSSHConnection(target);

            // Note: Currently, SCPClient supports only SSH2.
            if (sshConnection == null || sshConnection.SSHProtocol != SSHProtocol.SSH2)
                return CommandResult.Ignored;

            string connectionName = GetTerminalName(target);
            if (connectionName == null)
                connectionName = SFTPPlugin.Instance.StringResource.GetString("Common.UnknownPeer");

            Form ownerForm = GetForm(target);

            SCPClient scp = new SCPClient(sshConnection);

            SCPForm form = new SCPForm(ownerForm, scp, connectionName);
            form.Show();    // Note: don't specify owner to avoid fixed z-order.

            return CommandResult.Succeeded;
        }