-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to highlight current line.
- Loading branch information
Max DR
committed
Aug 3, 2020
1 parent
716761d
commit 82677ed
Showing
19 changed files
with
340 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using ModernNotepad.CustomControls; | ||
using ModernNotepadLibrary.Core; | ||
using ModernNotepadLibrary.Services; | ||
using System.Windows.Documents; | ||
|
||
namespace ModernNotepad.Services | ||
{ | ||
class AdornerService : IAdornerService | ||
{ | ||
public void AddAdorner(ITextArea textArea) | ||
{ | ||
var adornedTextArea = textArea as TextArea; | ||
var adornerLayer = AdornerLayer.GetAdornerLayer(adornedTextArea); | ||
|
||
if (adornerLayer.GetAdorners(adornedTextArea) != null) // Workaround | ||
{ | ||
adornerLayer.Remove(adornedTextArea.HighlightCurrentLineAdorner); | ||
} | ||
adornerLayer.Add(adornedTextArea.HighlightCurrentLineAdorner); | ||
} | ||
|
||
public void RemoveAdorner(ITextArea textArea) | ||
{ | ||
var adornedTextArea = textArea as TextArea; | ||
var adornerLayer = AdornerLayer.GetAdornerLayer(adornedTextArea); | ||
adornerLayer.Remove(adornedTextArea.HighlightCurrentLineAdorner); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.