private void runButton_Click(object sender, EventArgs e) { var programService = new ProgramService(manipulator); var programs = programService.ReadProgramInfo(); var programa = programService.DownloadProgram(programs[0]); programService.RunProgram.programa; }
private async void SendProgram() { var programService = new ProgramService(manipulator); var program = new Driver.Program("test") { Content = richTextBoxRead.Text }; await programService.UploadProgram(program); var programs = await programService.ReadProgramInfo(); var programa = await programService.DownloadProgram(programs[0]); richTextBoxRead.Text = programa.Content; }
/// <summary> /// Occurs after user triggers download event. /// </summary> /// <param name="obj">The object.</param> private async void Download(object obj) { var dialog = new SaveFileDialog() { Filter = "Text file (.txt)|*.txt", FileName = SelectedRemoteProgram.Name }; if (dialog.ShowDialog().GetValueOrDefault(false)) { DialogHostIsOpen = true; var host = CreateDialogHost(true, $"Downloading {SelectedRemoteProgram.Name}"); var program = await programService.DownloadProgram(SelectedRemoteProgram, host.CancellationToken); var programWithoutLineNumbers = ProgramContentConverter.ToPC(program.Content); program.Content = programWithoutLineNumbers; File.WriteAllText(dialog.FileName, program.Content); } DialogHostIsOpen = false; }
/// <summary> /// Occurs after user triggers upload event. /// </summary> private async void Download(object obj) { await programService.DownloadProgram(SelectedRemoteProgram); }
/// <summary> /// Occurs after user triggers upload event. /// </summary> private void Upload(object obj) { programServce.DownloadProgram(); }