Exemplo n.º 1
0
        private async Task Edit()
        {
            if (SelectedItems != null)
            {
                Ftp = new FTPclientModel(IoC.Get <AuthorizationControlVM>().AuthorizedCredentials.FirstOrDefault());

                var path = Path.GetTempPath();

                var item = SelectedItems.FirstOrDefault();

                if (item != null)
                {
                    if (item.Type == DirectoryItems.Folder)
                    {
                        IoC.Get <IAlertService>().Show("Cant edit a directory!");
                        return;
                    }

                    await Ftp.FtpDownloadFilesAsync(item.Path, $"{path}\\{item.Name}");

                    Process p = new Process();
                    p.Exited             += new EventHandler(ProcessEnded);
                    p.StartInfo.FileName  = $"{path}\\{item.Name}";
                    p.EnableRaisingEvents = true;
                    p.Start();
                }
            }
        }
Exemplo n.º 2
0
        private async Task Download()
        {
            var target = IoC.Get <LocalExplorerControlVM>().CurrentPath;

            if (SelectedItems != null && !String.IsNullOrEmpty(target))
            {
                Ftp = new FTPclientModel(IoC.Get <AuthorizationControlVM>().AuthorizedCredentials.FirstOrDefault());

                foreach (var item in SelectedItems)
                {
                    await Ftp.FtpDownloadFilesAsync(item.Path, $"{target}\\{item.Name}");

                    IoC.Get <LocalExplorerControlVM>().CurrentFolderItems.Add(item);
                    IoC.Get <TransferProgressControlVM>().TransferQueue.Remove(item);
                }
            }
        }