private void PrivatePull(List <string> files, System.IO.DirectoryInfo destPath) { List <DroidExplorer.Core.IO.FileInfo> tfiles = new List <DroidExplorer.Core.IO.FileInfo> ( ); foreach (string item in files) { DroidExplorer.Core.IO.FileInfo tf = DroidExplorer.Core.IO.FileInfo.Create(System.IO.Path.GetFileName(item), 0, null, null, null, DateTime.Now, false, item); tfiles.Add(tf); } PrivatePull(tfiles, destPath); }
private void PrivatePull(DroidExplorer.Core.IO.FileInfo remoteFile, System.IO.FileInfo destFile) { this.TotalItems = 1; this.TotalSize = remoteFile.Size; SetFromStatus(CommandRunner.Instance.DefaultDevice, remoteFile.FullPath, Environment.MachineName, destFile.Directory.Name); SpeedTest( ); SetItemsRemainingStatus(this.TotalItems.ToString( )); SetCopyInfoLabel( ); SetTitle( ); new Thread(delegate() { try { System.IO.FileInfo result = CommandRunner.Instance.PullFile(remoteFile.FullPath); if (!destFile.Directory.Exists) { destFile.Directory.Create( ); } if (string.Compare(destFile.FullName, result.FullName, true) != 0) { result.CopyTo(destFile.FullName, true); } this.DialogResult = DialogResult.OK; this.OnTransferComplete(EventArgs.Empty); } catch (Exception ex) { TransferException = ex; this.DialogResult = DialogResult.Abort; this.OnTransferError(EventArgs.Empty); } finally { try { if (!this.IsDisposed) { if (this.InvokeRequired) { this.Invoke(new GenericDelegate(this.Close)); } else { this.Close( ); } } } catch (Exception) { } } }).Start( ); }
/// <summary> /// Opens the specified file. /// </summary> /// <param name="file">The file.</param> public void Open(DroidExplorer.Core.IO.FileInfo file) { Execute(this.PluginHost, new DroidExplorer.Core.IO.LinuxDirectoryInfo(DroidExplorer.Core.IO.Path.GetPathWithoutFile(file.FullPath)), new string[] { string.Format(CultureInfo.InvariantCulture, "/file=sh {0}", file.FullPath) }); //CommandRunner.Instance.LaunchShellWindow ( CommandRunner.Instance.DefaultDevice, string.Format ( CultureInfo.InvariantCulture, "sh {0}", file.FullPath ) ); }
public DialogResult PullDialog(DroidExplorer.Core.IO.FileInfo remoteFile, System.IO.FileInfo destFile) { PrivatePull(remoteFile, destFile); return(this.ShowDialog( )); }
public void Pull(DroidExplorer.Core.IO.FileInfo remoteFile, System.IO.FileInfo destFile) { PrivatePull(remoteFile, destFile); this.Show( ); }
/// <summary> /// Opens the specified file. /// </summary> /// <param name="file">The file.</param> public void Open(DroidExplorer.Core.IO.FileInfo file) { Open(file.FullPath); }