Пример #1
0
 public void SetWorkingDir(string dir)
 {
     if (_fileSendSession != null)
     {
         _fileSendSession.SetWorkingDir(dir);
     }
 }
Пример #2
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);
        }