如何在运行时启用/禁用任何DiagnosticAnalyzer

时间:2015-09-25 03:11:02

标签: c# visual-studio-2015 roslyn

我正在为Visual Studio 2015编写一些DiagnosticAnalyzer(public class Registrar { public string id { get; set; } public string name { get; set; } public object email { get; set; } public string url { get; set; } } public class Response { public string name { get; set; } public string idnName { get; set; } public List<string> status { get; set; } public List<string> nameserver { get; set; } public object ips { get; set; } public string created { get; set; } public string changed { get; set; } public string expires { get; set; } public bool registered { get; set; } public bool dnssec { get; set; } public string whoisserver { get; set; } public List<object> contacts { get; set; } public Registrar registrar { get; set; } public List<string> rawdata { get; set; } public object network { get; set; } public object exception { get; set; } public bool parsedContacts { get; set; } } public class RootObject { public int error { get; set; } public Response response { get; set; } } ... RootObject result = JsonConvert.DeserializeObject<RootObject>(html); var created = result.response.created; ),我想实现一个对话框选项,允许用户启用/禁用他们喜欢的任何Roslyn,我该怎么办?实现那个?

目前,正如我调查的那样,DiagnosticAnalyzer具有属性DiagnosticDescriptor,该属性仅在您安装扩展时受到影响。

例如:我有这样的课程isEnabledByDefault

DiagnosticAnalyzer

我希望实现这样的目标:

public class RedundantModifierAnalyzer : DiagnosticAnalyzer
{
    // class implementation
}

0 个答案:

没有答案