Created
September 1, 2010 02:36
-
-
Save jfromaniello/560140 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 interface IErrorList | |
{ | |
void AddError(string message); | |
} | |
[Export(typeof(IErrorList)), PartCreationPolicy(CreationPolicy.Shared)] | |
public class ErrorList : IErrorList | |
{ | |
private static readonly Guid ProviderGuid = new Guid("A97E9FD2-1974-4889-8B3C-D4410164A229"); | |
private ErrorListProvider backProvider; | |
[Import(typeof(SVsServiceProvider))] | |
public IServiceProvider ServiceProvider { get; set; } | |
public ErrorListProvider GetErrorListProvider() | |
{ | |
return backProvider ?? (backProvider = new ErrorListProvider(ServiceProvider) | |
{ | |
ProviderName = "HqlErrorProvider", | |
ProviderGuid = ProviderGuid | |
}); | |
} | |
public void AddError(string message) | |
{ | |
var provider = GetErrorListProvider(); | |
provider.Tasks.Add(new Task | |
{ | |
Text = message, | |
Category = TaskCategory.BuildCompile, | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment