public void SendTextTo(Destinations destination, String text = null) { var f = Utilities.CreateTemporalFileFromText(text); var res = new SendResults(1, destination); if (f != null) { var fileSet = PrimeFileSet.Create(new[] { f }, new PrimeParameters(Settings.Default)); fileSet.Destination = destination; if (destination == Destinations.Custom) { var fs = new FolderSelectDialog { Title = "Select the destination folder" }; if (!fs.ShowDialog()) { return; // Conversion was cancel } fileSet.CustomDestination = fs.FileName; } else { fileSet.CustomDestination = _emulatorFolder; } SendDataTo(fileSet); res.Add(SendResult.Success); } else { res.Add(SendResult.ErrorInvalidInput); res.ShowMsg(false, this); } }
private void SendDataTo(Destinations destination) { StopReceiving(); if (openFilesDialogProgram.ShowDialog() == DialogResult.OK) { var fileSet = PrimeFileSet.Create(openFilesDialogProgram.FileNames, new PrimeParameters(Settings.Default)); fileSet.Destination = destination; if (destination == Destinations.Custom) { var fs = new FolderSelectDialog { Title = "Select the destination folder" }; if (!fs.ShowDialog()) { return; // Conversion was cancel } fileSet.CustomDestination = fs.FileName; } else { fileSet.CustomDestination = _emulatorFolder; } SendDataTo(fileSet); } }
public void SendDataTo(PrimeFileSet files) { if (!backgroundWorkerSend.IsBusy) { IsBusy = true; _sending = true; backgroundWorkerSend.RunWorkerAsync(files); } UpdateGui(); }