Ejemplo n.º 1
0
        public bool ExecuteNext(FileSendSession client)
        {
            if (_commands.Count == 0)
            {
                LogService.Info(this, "Command buffer is empty!");
                return(false);
            }

            if (_currentCommand >= _commands.Count)
            {
                LogService.Info(this, "Command buffer finished executing!");
                if (OnDone != null)
                {
                    OnDone();
                }

                return(false);
            }

            Command cmd = _commands[_currentCommand];

            switch (cmd.type)
            {
            case CommandType.SETWORKINGDIR:
                client.SetWorkingDir(cmd.remote);
                break;

            case CommandType.CREATEDIR:
                client.CreateDirectory(cmd.remote);
                break;

            case CommandType.SENDFILE:
                client.SendFile(cmd.local, cmd.remote);
                break;

            default:
                break;
            }

            return(true);
        }
Ejemplo n.º 2
0
 public void Setup(IConnection connection)
 {
     _fileSendSession    = new FileSendSession(connection);
     _fileReceiveSession = new FileReceiveSession(connection);
 }