//futtatás private async void RunClick(object sender, RoutedEventArgs e) { runButton.IsEnabled = false; menu.Save(rtbhelper.GetString(commandLine)); turtle.Clean(); turtle.PenDown(); RoboPreter rp = new RoboPreter(); try { List <Robopreter.Command> com = rp.Run(menu.GetFullSource()); for (int i = 0; i < com.Count; i++) { Draw(com[i]); int time = GetTime(com[i]); await Task.Factory.StartNew(() => Wait(time)); } } catch (RPExeption rpe) { MessageBox.Show(rpe.NewMessage); } catch { MessageBox.Show(App.Current.TryFindResource("error").ToString()); } runButton.IsEnabled = true; }
private async void runbtButton_Click(object sender, RoutedEventArgs e) { runbtButton.IsEnabled = false; menu.Save(rtbhelper.GetString(commandLine)); RoboPreter rp = new RoboPreter(); try { List <Robopreter.Command> com = rp.Run(menu.GetFullSource()); await Task.Factory.StartNew(() => BTRun(com)); runbtButton.IsEnabled = true; } catch (RPExeption rpe) { MessageBox.Show(rpe.NewMessage); } catch { MessageBox.Show(App.Current.TryFindResource("error").ToString()); BTUpdate(); } }
private async void runbtButton_Click(object sender, RoutedEventArgs e) { runbtButton.IsEnabled = false; menu.Save(rtbhelper.GetString(commandLine)); RoboPreter rp = new RoboPreter(); try { List<Robopreter.Command> com = rp.Run(menu.GetFullSource()); await Task.Factory.StartNew(() => BTRun(com)); runbtButton.IsEnabled = true; } catch (RPExeption rpe) { MessageBox.Show(rpe.NewMessage); } catch { MessageBox.Show(App.Current.TryFindResource("error").ToString()); BTUpdate(); } }
//futtatás private async void RunClick(object sender, RoutedEventArgs e) { runButton.IsEnabled = false; menu.Save(rtbhelper.GetString(commandLine)); turtle.Clean(); turtle.PenDown(); RoboPreter rp = new RoboPreter(); try { List<Robopreter.Command> com = rp.Run(menu.GetFullSource()); for (int i = 0; i < com.Count; i++) { Draw(com[i]); int time = GetTime(com[i]); await Task.Factory.StartNew(() => Wait(time)); } } catch (RPExeption rpe) { MessageBox.Show(rpe.NewMessage); } catch { MessageBox.Show(App.Current.TryFindResource("error").ToString()); } runButton.IsEnabled = true; }