public PullDialog ( DroidExplorer remoteFile, System destFile ) : DialogResult | ||
remoteFile | DroidExplorer | |
destFile | System | |
return | DialogResult |
public void Pull( Core.IO.FileInfo remoteFile, System.IO.FileInfo destFile ) { var transfer = new TransferDialog ( ); transfer.PullDialog ( remoteFile, destFile ); }
public void Pull( List<Core.IO.FileInfo> files, System.IO.DirectoryInfo destPath ) { var transfer = new TransferDialog ( ); transfer.PullDialog ( files, destPath ); }
private void copyToolStripMenuItem_Click( object sender, EventArgs e ) { List<string> lfiles = new List<string> ( ); List<DroidExplorer.Core.IO.FileInfo> rfiles = new List<DroidExplorer.Core.IO.FileInfo> ( ); foreach ( FileSystemInfoListViewItem item in itemsList.SelectedItems ) { if ( item.FileSystemInfo.IsLink ) { // links CAN NOT use ADB Pull/Push, the link needs to be resolved and then // ADB Pull/Push can be used if ( !item.FileSystemInfo.IsDirectory ) { DroidExplorer.Core.IO.SymbolicLinkInfo lnk = item.FileSystemInfo as DroidExplorer.Core.IO.SymbolicLinkInfo; string linkFullPath = System.IO.Path.Combine ( CurrentDirectory.FullName, lnk.Link ); this.LogDebug ( "Copying {0} link from {1}", lnk.Name, linkFullPath ); rfiles.Add ( DroidExplorer.Core.IO.FileInfo.Create ( item.FileSystemInfo.Name, item.FileSystemInfo.Size, item.FileSystemInfo.UserPermissions, item.FileSystemInfo.GroupPermissions, item.FileSystemInfo.OtherPermissions, item.FileSystemInfo.LastModificationDateTime,/* item.FileSystemInfo.IsExecutable */ false, linkFullPath ) ); lfiles.Add ( System.IO.Path.Combine ( FolderManagement.TempFolder, item.FileSystemInfo.Name ) ); } } else if ( item.FileSystemInfo.IsDirectory ) { TaskDialog.MessageBox ( "Not Yet Implemented", "Can not copy directory to clipboard", "This feature will be added soon.", TaskDialogButtons.OK, SysIcons.Information ); } else if ( item.FileSystemInfo.IsPipe ) { // do nothing as they are not yet visible } else if ( item.FileSystemInfo.IsSocket ) { // do nothing as they are not yet visible } else { // file rfiles.Add ( item.FileSystemInfo as DroidExplorer.Core.IO.FileInfo ); lfiles.Add ( System.IO.Path.Combine ( FolderManagement.TempFolder, item.FileSystemInfo.Name ) ); } } if ( rfiles.Count > 0 ) { var transfer = new TransferDialog ( ); if ( transfer.PullDialog ( rfiles, new System.IO.DirectoryInfo ( FolderManagement.TempFolder ) ) == DialogResult.OK ) { this.Cursor = Cursors.WaitCursor; Clipboard.SetData ( DataFormats.FileDrop, lfiles.ToArray ( ) ); this.Cursor = Cursors.Default; } else { if ( transfer.TransferException != null ) { TaskDialog.MessageBox ( "Copy error", transfer.TransferException.Message, string.Empty, TaskDialogButtons.OK, SysIcons.Error ); } } } }