private void DrawLineInTextEditor(int current_count) { UserControl_inputCode uc_input = FindVisualChildren <UserControl_inputCode>(this).ToArray()[0]; if (uc_input.textEditor.TextArea.TextView.LineTransformers.Count == 1) { uc_input.textEditor.TextArea.TextView.LineTransformers.RemoveAt(0); } uc_input.textEditor.TextArea.TextView.LineTransformers.Add(new LineColorizer(current_count)); }
private void MenuItemOpen_Click(object sender, RoutedEventArgs e) { UserControl_inputCode uc_input = FindVisualChildren <UserControl_inputCode>(this).ToArray()[0]; OpenFileDialog dlg = new OpenFileDialog(); dlg.CheckFileExists = true; if (dlg.ShowDialog() ?? false) { currentFileName = dlg.FileName; uc_input.textEditor.Load(currentFileName); uc_input.textEditor.SyntaxHighlighting = HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(currentFileName)); } }
private void run_Click(object sender, RoutedEventArgs e) { progressBar.Visibility = Visibility.Visible; UserControl_inputCode uc_input = FindVisualChildren <UserControl_inputCode>(this).ToArray()[0]; textedit = uc_input.textEditor.Text; run_total_count = uc_input.textEditor.LineCount; run_current_count = 0; current_step_index = 0; initAll(); backgroundWorker.RunWorkerAsync(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ucInput = ((BoyeoZoom.UserControl_inputCode)(target)); return; case 2: this.textBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.textEditor = ((ICSharpCode.AvalonEdit.TextEditor)(target)); return; } this._contentLoaded = true; }
private void save_Click(object sender, RoutedEventArgs e) { if (currentFileName == null) { SaveFileDialog dlg = new SaveFileDialog(); dlg.DefaultExt = ".c"; if (dlg.ShowDialog() ?? false) { currentFileName = dlg.FileName; } else { return; } } UserControl_inputCode uc_input = FindVisualChildren <UserControl_inputCode>(this).ToArray()[0]; uc_input.textEditor.Save(currentFileName); }
private void redo_Click(object sender, RoutedEventArgs e) { UserControl_inputCode uc_input = FindVisualChildren <UserControl_inputCode>(this).ToArray()[0]; uc_input.textEditor.Redo(); }