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 upload event. /// </summary> /// <param name="obj"></param> private async void Refresh(object obj) { RemotePrograms = new ObservableCollection <RemoteProgram>(new List <RemoteProgram>(await programService.ReadProgramInfo())); }
/// <summary> /// Occurs after user triggers refresh event. /// </summary> /// <param name="obj">The object.</param> private async void Refresh(object obj) { DialogHostIsOpen = true; DialogHost host; if (obj != null && obj is DialogHost) { host = obj as DialogHost; } else { host = CreateDialogHost(true, "Refreshing program list"); } RemotePrograms?.Clear(); RemotePrograms = new ObservableCollection <RemoteProgram>(new List <RemoteProgram>(await programService.ReadProgramInfo(host.CancellationToken))); DialogHostIsOpen = false; }