private void step_Click(object sender, RoutedEventArgs e) { if (!visual.IsError()) { if (run_current_count < run_total_count && current_step_index < visual.Trace.Count) { current_step_index++; run_current_count = visual.Trace[current_step_index].Line; } // Draw MemoryFlow Part UserControl_visualize uc_visual = FindVisualChildren <UserControl_visualize>(this).ToArray()[0]; //Trace step = uc_visual.Draw_All(visual, current_step_index); Trace step = visual.Trace[current_step_index]; uc_visual.Draw_All(step); if (step != null) { Draw_Print(step.Stdout); // Draw FlowChart Part UserControl_diagrammatic uc_d = FindVisualChildren <UserControl_diagrammatic>(this).ToArray()[0]; uc_d.draw_flowchart(items, step.Line); } // Draw Current Line in TextEditor DrawLineInTextEditor(run_current_count); } }
private void BackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { progressBar.Visibility = Visibility.Hidden; if (json == null || items.Count == 0) { MessageBox.Show("Internet Connection Error"); } else { prestep.IsEnabled = true; step.IsEnabled = true; visual = JsonConvert.DeserializeObject <Visual>(json, new VisualConverter()); // Draw Time And Memory Usage Part DrawTimeAndMemory(visual.Time, visual.MemUsage); if (visual.IsError()) { // Draw_Print(visual.getAllErrors()); MessageBox.Show("" + visual.getAllErrors(), "Error Message", MessageBoxButton.OK, MessageBoxImage.Error); DrawLineInTextEditor(visual.getErrorLine()); } else { // Draw MemoryFlow Part UserControl_visualize uc_visual = FindVisualChildren <UserControl_visualize>(this).ToArray()[0]; //uc_visual.Draw_All(visual, run_current_count); Trace step = visual.Trace[current_step_index]; uc_visual.Draw_All(step); // Draw FlowChart Part UserControl_diagrammatic uc_d = FindVisualChildren <UserControl_diagrammatic>(this).ToArray()[0]; uc_d.draw_flowchart(items); Draw_Print(visual.getAllStdout()); } } }