public AsmCodeEditor()
        {
            InitializeComponent();

            TextView textView = textEditor.TextArea.TextView;

            // Line numbers
            textEditor.ShowLineNumbers = true;

            // Line addresses
            LineAddressMargin lineAddresses = new LineAddressMargin(this);
            lineAddresses.SetValue(Control.ForegroundProperty, System.Windows.Media.Brushes.LightBlue);
            textEditor.TextArea.LeftMargins.Add(lineAddresses);
            Line verticalSeparator = (Line)DottedLineMargin.Create();
            verticalSeparator.Stroke = System.Windows.Media.Brushes.LightBlue;
            textEditor.TextArea.LeftMargins.Add(verticalSeparator);

            // Assembly syntax highlighting
            textView.LineTransformers.Add(new AsmSyntaxHighlighting());

            // Search box
            textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new SearchInputHandler(textEditor.TextArea));

            // Compilation errors
            textMarkerService = new TextMarkerService(textEditor);
            textView.BackgroundRenderers.Add(textMarkerService);
            textView.LineTransformers.Add(textMarkerService);
            textView.MouseHover += MouseHover;
            textView.MouseHoverStopped += TextEditorMouseHoverStopped;
            textView.VisualLinesChanged += VisualLinesChanged;

            // Incremental compilation
            textEditor.Document.Changed += Document_Changed;
        }
Пример #2
0
        public AsmCodeEditor()
        {
            InitializeComponent();

            TextView textView = textEditor.TextArea.TextView;

            // Line numbers
            textEditor.ShowLineNumbers = true;

            // Line addresses
            LineAddressMargin lineAddresses = new LineAddressMargin(this);

            lineAddresses.SetValue(Control.ForegroundProperty, System.Windows.Media.Brushes.LightBlue);
            textEditor.TextArea.LeftMargins.Add(lineAddresses);
            Line verticalSeparator = (Line)DottedLineMargin.Create();

            verticalSeparator.Stroke = System.Windows.Media.Brushes.LightBlue;
            textEditor.TextArea.LeftMargins.Add(verticalSeparator);

            // Assembly syntax highlighting
            textView.LineTransformers.Add(new AsmSyntaxHighlighting());

            // Search box
            textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new SearchInputHandler(textEditor.TextArea));

            // Compilation errors
            textMarkerService = new TextMarkerService(textEditor);
            textView.BackgroundRenderers.Add(textMarkerService);
            textView.LineTransformers.Add(textMarkerService);
            textView.MouseHover         += MouseHover;
            textView.MouseHoverStopped  += TextEditorMouseHoverStopped;
            textView.VisualLinesChanged += VisualLinesChanged;

            // Incremental compilation
            textEditor.Document.Changed += Document_Changed;
        }