public static void ExecutePull(object parameter) { FiveTextCommandParameters parameters = (FiveTextCommandParameters)parameter; Context = parameters.Context; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += async(sender, args) => { await Context.Dispatcher.InvokeAsync(async() => { _adb = new AdbTools(Context); String[] paths = new string[4]; if (!string.IsNullOrEmpty(parameters.Text2)) { paths[0] = parameters.Text2; } if (!string.IsNullOrEmpty(parameters.Text3)) { paths[1] = parameters.Text3; } if (!string.IsNullOrEmpty(parameters.Text4)) { paths[2] = parameters.Text4; } if (!string.IsNullOrEmpty(parameters.Text5)) { paths[3] = parameters.Text5; } await _adb.Pull(parameters.Text, parameters.Bool, paths, parameters.Target); }); }; worker.RunWorkerCompleted += (sender, args) => worker.Dispose(); worker.RunWorkerAsync(); }
public AdbViewModel() { ThreeTextCommandParameters = new ThreeTextCommandParameters(); FiveTextCommandParameters = new FiveTextCommandParameters(); InstallTwoCommandParameters = new TwoCommandParameters(); UninstallTwoCommandParameters = new TwoCommandParameters(); UiParameters = new UIParameters(); ExecuteSingleCommandParameters = new TwoCommandParameters(); CopyCommandParameters = new ThreeTextCommandParameters(); MoveCommandParameters = new ThreeTextCommandParameters(); DeleteCommandParameters = new TwoCommandParameters(); SideloadParameters = new TwoCommandParameters(); ExecuteCommandsParameters = new ExecuteCommandParameters(); BackupParameters = new BackupParameters(); RestoreParameters = new TwoCommandParameters(); RemoteConnectParameters = new ThreeTextCommandParameters(); RemoteDisconnectParameters = new SingleCommandParameters(); RemoteSaveParameters = new ThreeTextCommandParameters(); _remoteInfoRepository = ((ViewModelLocator)Application.Current.Resources["Locator"]).RemoteInfoRepository; }