Skip to content

Instantly share code, notes, and snippets.

View sharwell's full-sized avatar
🏠
Working from home

Sam Harwell sharwell

🏠
Working from home
View GitHub Profile
@sharwell
sharwell / Services.cs
Created August 31, 2012 09:07
MEF support for the Output Window in Visual Studio 2010: Services
namespace JavaLanguageService
{
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Utilities;
using JavaLanguageService.Panes;
public static class Services
{
[Export]
[Name("ANTLR IntelliSense Engine")]
@sharwell
sharwell / gist:3550631
Created August 31, 2012 09:13
MEF support for the Output Window in Visual Studio 2010: Import IOutputWindowService
[Import]
internal IOutputWindowService OutputWindowService;
@sharwell
sharwell / gist:3550639
Created August 31, 2012 09:14
MEF support for the Output Window in Visual Studio 2010: Try to get existing pane
var outputWindow = OutputWindowService.TryGetPane("ANTLR IntelliSense Engine");
if (outputWindow != null)
outputWindow.WriteLine(message);
@sharwell
sharwell / PredefinedOutputWindowPanes.cs
Created August 31, 2012 09:16
MEF support for the Output Window in Visual Studio 2010: PredefinedOutputWindowPanes
public static class PredefinedOutputWindowPanes
{
public static readonly string General;
public static readonly string Debug;
public static readonly string Build;
}
@sharwell
sharwell / IOutputWindowPane.cs
Created August 31, 2012 09:17
MEF support for the Output Window in Visual Studio 2010: IOutputWindowPane
namespace JavaLanguageService.Panes
{
using System;
public interface IOutputWindowPane : IDisposable
{
string Name
{
get;
set;
@sharwell
sharwell / IOutputWindowService.cs
Created August 31, 2012 09:18
MEF support for the Output Window in Visual Studio 2010: IOutputWindowService
namespace JavaLanguageService.Panes
{
public interface IOutputWindowService
{
IOutputWindowPane TryGetPane(string name);
}
}
@sharwell
sharwell / OutputWindowDefinition.cs
Created August 31, 2012 09:19
MEF support for the Output Window in Visual Studio 2010: OutputWindowDefinition
namespace JavaLanguageService.Panes
{
public sealed class OutputWindowDefinition
{
}
}
@sharwell
sharwell / PredefinedOutputWindowPanes.cs
Created August 31, 2012 09:20
MEF support for the Output Window in Visual Studio 2010: PredefinedOutputWindowPanes.cs
namespace JavaLanguageService.Panes
{
public static class PredefinedOutputWindowPanes
{
public static readonly string General = "General";
public static readonly string Debug = "Debug";
public static readonly string Build = "Build";
}
}
@sharwell
sharwell / IOutputWindowDefinitionMetadata.cs
Created August 31, 2012 09:21
MEF support for the Output Window in Visual Studio 2010: IOutputWindowDefinitionMetadata
namespace JavaLanguageService.Panes
{
internal interface IOutputWindowDefinitionMetadata
{
string Name
{
get;
}
}
}
@sharwell
sharwell / OutputWindowService.cs
Created August 31, 2012 09:22
MEF support for the Output Window in Visual Studio 2010: OutputWindowService
namespace JavaLanguageService.Panes
{
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using JavaLanguageService.Extensions;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;