public EditorContext() { Postbox = Postbox.InstanceFor(EditorCode); Configuration.ConfigManager.AddEditorConfig(EditorCode, new Configuration.Config { Language = SupportedLanguages.JS, FormattingType = FormattingType.BRACKETS }); TextsToEnter = new List<string>(); CaretView = new CaretView(); TextView = new TextView(CaretView); SelectionView = new SelectionView(TextView); LinesView = new LinesView(); FoldingView = new FoldingView(); EnterTextCommand = new EnterTextCommand(TextView, CaretView, SelectionView); RemoveTextCommand = new RemoveTextCommand(TextView, CaretView, SelectionView); CaretMoveCommand = new CaretMoveCommand(CaretView, TextView); SelectionCommand = new TextSelectionCommand(TextView, SelectionView, CaretView); CaretView.EditorCode = EditorCode; CaretView.Postbox = Postbox; TextView.EditorCode = EditorCode; TextView.Postbox = Postbox; SelectionView.EditorCode = EditorCode; SelectionView.Postbox = Postbox; LinesView.EditorCode = EditorCode; LinesView.Postbox = Postbox; FoldingView.EditorCode = EditorCode; FoldingView.Postbox = Postbox; InitEvents(); ForceDraw(); }
public void InitializeTest() { const int EditorCode = 1; Configuration.ConfigManager.AddEditorConfig(EditorCode, new Configuration.Config { Language = SupportedLanguages.JS, FormattingType = FormattingType.BRACKETS }); cv = new CaretView(); tv = new TextView(cv); cv.EditorCode = EditorCode; tv.EditorCode = EditorCode; }
public void InitializeTest() { cv = new CaretView(); tv = new TextView(cv); tv.EnterText("one"); tv.EnterText("\r"); tv.EnterText("two"); tv.EnterText("\r"); tv.EnterText("three"); tv.EnterText("\r"); tv.EnterText("four"); tv.EnterText("\r"); tv.EnterText("five"); tv.EnterText("\r"); tv.EnterText("six"); }
public void InitializeTest() { cv = new CaretView(); tv = new TextView(cv); }
public RemoveTextCommand(TextView textView, CaretView caretView, ISelectionViewReadonly selectionViewReader) : base(textView, caretView) { this.textView = textView; this.selectionViewReader = selectionViewReader; this.caretView = caretView; }
private void SetupViews() { var editorCode = this.GetEditor().GetHashCode(); caretView = new CaretView(); textView = new TextView(caretView); selectionView = new SelectionView(textView); foreach (var view in new LocalViewBase[] { selectionView, textView, caretView }) { view.Margin = new Thickness(2, 0, 0, 0); view.HorizontalAlignment = HorizontalAlignment.Left; view.VerticalAlignment = VerticalAlignment.Top; views.Add(view); Children.Add(view); view.EditorCode = editorCode; view.Postbox = postbox; } }