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(IIntellisenseControllerProvider))] | |
[ContentType("code")] | |
internal class ShimCompletionControllerFactory : IIntellisenseControllerProvider {...} |
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
/* TripleClickMouseProcessor.cs | |
* Copyright Noah Richards, licensed under the Ms-PL. | |
* Check out blogs.msdn.com/noahric for more information about the Visual Studio 2010 editor! | |
*/ | |
using System.ComponentModel.Composition; | |
using System.Windows; | |
using System.Windows.Input; | |
using Microsoft.VisualStudio.Text; | |
using Microsoft.VisualStudio.Text.Editor; | |
using Microsoft.VisualStudio.Utilities; |
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
/* Modified version of Thomas Restrepo's KeywordClassifier.cs. | |
* The original can be found here: | |
* http://github.com/tomasr/KeywordClassifier/blob/b2472cc2bbdd823a4d8a2ff5fdbfc82c4da1423e/KeywordClassifier.cs | |
* This has been updated for Beta 2, and switched from using a classifier to a view-specific | |
* tagger, to avoid issues around self-consumption. | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.Composition; |
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
// On a background thread, perform our typing work. | |
ThreadPool.QueueUserWorkItem((state) => | |
{ | |
Random random = new Random(); | |
for (int i = 0; i < _textToType.Length; i++) | |
{ | |
// Dispatch back to the UI thread to make the edit on the buffer | |
_dispatcher.Invoke(new Action(() => | |
{ |
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
void SetGradientBrush(IEditorFormatMap formatMap) | |
{ | |
Color highlight = SystemColors.HighlightColor; | |
Color darkColor = Color.FromArgb(96, highlight.R, highlight.G, highlight.B); | |
Color lightColor = Color.FromArgb(48, highlight.R, highlight.G, highlight.B); | |
// Change the selected text properties to use a gradient brush and an outline pen | |
var properties = formatMap.GetProperties("Selected Text"); | |
properties[EditorFormatDefinition.BackgroundBrushId] = new LinearGradientBrush( | |
new GradientStopCollection() { new GradientStop(darkColor, 0.0), new GradientStop(lightColor, 0.5), new GradientStop(darkColor, 1.0) }, 90.0); |
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(EditorFormatDefinition))] | |
[Name("mymarker")] | |
internal sealed class MyMarkerDefinition : MarkerFormatDefinition | |
{ | |
public MyMarkerDefinition() | |
{ | |
this.ZOrder = 1; | |
this.Fill = Brushes.Blue; | |
this.Border = new Pen(Brushes.DarkGray, 0.5); | |
this.Fill.Freeze(); |
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
// CtrlMouseWheelHandler - Handle Ctrl+mouse wheel events to scroll by pages instead of lines | |
using System; | |
using System.ComponentModel.Composition; | |
using System.Windows.Input; | |
using Microsoft.VisualStudio.Text.Editor; | |
using Microsoft.VisualStudio.Utilities; | |
namespace CtrlMouseWheel | |
{ |
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
using System.ComponentModel.Composition; | |
using Microsoft.VisualStudio.Utilities; | |
namespace MarkdownMode | |
{ | |
static class ContentType | |
{ | |
[Export] | |
[Name("markdown")] | |
[DisplayName("Markdown")] |
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
void ReparseFile(object sender, EventArgs args) | |
{ | |
ITextSnapshot snapshot = _buffer.CurrentSnapshot; | |
List<MarkdownSection> newSections = new List<MarkdownSection>( | |
MarkdownParser.ParseMarkdownSections(snapshot) | |
.Select(t => new MarkdownSection() | |
{ | |
TokenType = t.TokenType, | |
Span = snapshot.CreateTrackingSpan(t.Span, SpanTrackingMode.EdgeExclusive) |
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
void ReparseFile(object sender, EventArgs args) | |
{ | |
ITextSnapshot snapshot = _buffer.CurrentSnapshot; | |
List<MarkdownSection> newSections = new List<MarkdownSection>( | |
MarkdownParser.ParseMarkdownSections(snapshot) | |
.Select(t => new MarkdownSection() | |
{ | |
TokenType = t.TokenType, | |
Span = snapshot.CreateTrackingSpan(t.Span, SpanTrackingMode.EdgeExclusive) |
OlderNewer