Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
VladD2 committed May 12, 2015
1 parent b4b0d71 commit 2183d57
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Nitra.Visualizer/MainWindow.xaml.cs
Expand Up @@ -75,7 +75,8 @@ public partial class MainWindow
private readonly PropertyGrid _propertyGrid;
private readonly MatchBracketsWalker _matchBracketsWalker = new MatchBracketsWalker();
private List<ITextMarker> _matchedBracketsMarkers = new List<ITextMarker>();
private List<MatchBracketsWalker.MatchBrackets> _matchedBrackets;
private List<MatchBracketsWalker.MatchBrackets> _matchedBrackets;
private const string ErrorMarkerTag = "Error";

public MainWindow()
{
Expand Down Expand Up @@ -228,21 +229,15 @@ private void TryHighlightBraces(int caretPos)
{
var marker1 = _textMarkerService.Create(bracket.OpenBracket.StartPos, bracket.OpenBracket.Length);
marker1.BackgroundColor = Colors.LightGray;
marker1.Deleted += marker1_Deleted;
_matchedBracketsMarkers.Add(marker1);

var marker2 = _textMarkerService.Create(bracket.CloseBracket.StartPos, bracket.CloseBracket.Length);
marker2.BackgroundColor = Colors.LightGray;
marker2.Deleted += marker1_Deleted;
_matchedBracketsMarkers.Add(marker2);
}
}
}

void marker1_Deleted(object sender, EventArgs e)
{
}

private void ShowNodeForCaret()
{
if (_doTreeOperation)
Expand Down Expand Up @@ -364,7 +359,7 @@ private void TryReportError()
_errorsTreeView.Items.Add(errorNode);

var marker = _textMarkerService.Create(0, _text.Text.Length);
marker.Tag = "Error";
marker.Tag = ErrorMarkerTag;
marker.MarkerType = TextMarkerType.SquigglyUnderline;
marker.MarkerColor = Colors.Purple;
marker.ToolTip = msg;
Expand Down Expand Up @@ -654,7 +649,7 @@ private void DoParse()

private void ClearMarkers()
{
_textMarkerService.RemoveAll(marker => marker.Tag == (object)"Error");
_textMarkerService.RemoveAll(marker => marker.Tag == (object)ErrorMarkerTag);
}

private void textBox1_HighlightLine(object sender, HighlightLineEventArgs e)
Expand Down

0 comments on commit 2183d57

Please sign in to comment.