Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<ResourceDictionary | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | |
... | |
<Thickness x:Key="MediumLeftRightMargin">24,0,24,0</Thickness> | |
... | |
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
double AddTwentyPercent(double price) { | |
return price * 1.2; | |
} |
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
internal class FestiveImageTag : ITag | |
{ | |
public FestiveImageTag(string term) | |
{ | |
this.Term = term; | |
} | |
public string Term { get; } | |
} |
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
internal sealed class FestiveImageTagger : RegexTagger<FestiveImageTag> | |
{ | |
internal FestiveImageTagger(ITextBuffer buffer) | |
: base( | |
buffer, | |
new[] { new Regex(@"\W(\w{3,7})\W", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase) }) | |
{ | |
} | |
protected override FestiveImageTag TryCreateTagForMatch(Match match) |
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
[Export(typeof(ITaggerProvider))] | |
[ContentType("text")] | |
[TagType(typeof(FestiveImageTag))] | |
internal sealed class FestiveImageTaggerProvider : ITaggerProvider | |
{ | |
public ITagger<T> CreateTagger<T>(ITextBuffer buffer) | |
where T : ITag | |
{ | |
if (buffer == null) | |
{ |
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
internal sealed class FestiveImageAdornment : System.Windows.Controls.Image | |
{ | |
internal FestiveImageAdornment(FestiveImageTag tag) | |
{ | |
this.FestiveImageTag = tag; | |
this.SetSource(this.FestiveImageTag.Term); | |
this.Height = 20; | |
this.Width = 20; | |
} |
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
internal sealed class FestiveImageAdornmentTagger | |
: IntraTextAdornmentTagger<FestiveImageTag, FestiveImageAdornment> | |
{ | |
private readonly ITagAggregator<FestiveImageTag> tagger; | |
private FestiveImageAdornmentTagger(IWpfTextView view, ITagAggregator<FestiveImageTag> tagger) | |
: base(view) | |
{ | |
this.tagger = tagger; | |
} |
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
[Export(typeof(IViewTaggerProvider))] | |
[ContentType("text")] | |
[ContentType("projection")] | |
[TextViewRole(PredefinedTextViewRoles.Document)] | |
[TagType(typeof(IntraTextAdornmentTag))] | |
internal sealed class FestiveImageAdornmentTaggerProvider : IViewTaggerProvider | |
{ | |
[Import] | |
internal IBufferTagAggregatorFactoryService BufferTagAggregatorFactoryService; |
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
public void TextViewCreated(IWpfTextView textView) | |
{ | |
// The adorments will get wired to the text view events | |
new MistletoeAdornment(textView); | |
new TopLeftHollyAdornment(textView); | |
new TopRightHollyAdornment(textView); | |
new BottomLeftHollyAdornment(textView); | |
new BottomRightHollyAdornment(textView); | |
} |
NewerOlder