private void LoadDiagnosticsFromPath(string folderPath, bool syncInServer)
{
var diagnostics = Directory.GetFiles(folderPath);
foreach (var diagnostic in diagnostics)
{
try
{
var fileName = Path.GetFileName(diagnostic);
if (this.ExtensionDiagnostics.ContainsKey(fileName))
{
continue;
}
var newdata = new VSSonarExtensionDiagnostic(fileName, diagnostic);
if (newdata.AvailableChecks.Count > 0)
{
this.ExtensionDiagnostics.Add(fileName, newdata);
if (syncInServer)
{
this.SyncDiagnosticInServer(newdata);
}
}
}
catch (Exception ex)
{
this.notificationManager.WriteMessage("Failed to load user diagnostics from: " + diagnostic + " : " + ex.Message);
}
}
}