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(); }
private void SetupViews() { int editorCode = editorCode = this.GetEditor().GetHashCode(); linesView = new LinesView(); foldingView = new FoldingView(); views.Add(linesView); views.Add(foldingView); Children.Add(linesView); Children.Add(foldingView); linesView.EditorCode = editorCode; linesView.Postbox = postbox; foldingView.EditorCode = editorCode; foldingView.Postbox = postbox; }