Esempio n. 1
0
 public void AssignTask(DeskData assignedDesk, GroupData assignedGroup)
 {
     AssignedDesk  = assignedDesk;
     AssignedGroup = assignedGroup;
     Game.Player.Charge(m_Price);
     m_UI = Game.Player.TaskManagementUI.AddTask(this);
 }
Esempio n. 2
0
        private async void DownloadRemoteFile(string remoteFileName, string localFileName)
        {
            if (connectionStatus != ConnectionStatus.Connected)
            {
                return;
            }
            var        fdi  = new FileDownloadingInfo(ftpService.Server, ftpService.CurrentRemotePath, remoteFileName, localService.CurrentLocalPath, localFileName);
            TaskInfoUI tiUI = new TaskInfoUI(fdi);

            fdi.Tag          = tiUI;
            tiUI.tokenSource = new CancellationTokenSource();
            taskInfoList.Add(tiUI);
            await ftpService.DownloadFile(fdi, tiUI.tokenSource.Token, DefaultFTPTaskErrorHandler);

            if (fdi.IsFinished)
            {
                Dispatcher.Invoke(new Action(() => { RefreshLocalInfo(); }));
            }
        }
Esempio n. 3
0
        private async void UploadLocalFile(string localFilePath, string localFileName, string remoteFilePath, string remoteFileName)
        {
            if (connectionStatus != ConnectionStatus.Connected)
            {
                return;
            }
            var        fui  = new FileUploadingInfo(ftpService.Server, localFilePath, localFileName, remoteFilePath, remoteFileName);
            TaskInfoUI tiUI = new TaskInfoUI(fui);

            fui.Tag          = tiUI;
            tiUI.tokenSource = new CancellationTokenSource();
            taskInfoList.Add(tiUI);
            await ftpService.UploadFile(fui, tiUI.tokenSource.Token, DefaultFTPTaskErrorHandler);

            if (fui.IsFinished)
            {
                RefreshRemoteInfo();
            }
        }