private static ExternalAnnotationsCache ScanForMemberExternalAnnotations() { var result = new ExternalAnnotationsMap(); var parser = new ExternalAnnotationDocumentParser(); var recorder = new HighestLastWriteTimeUtcRecorder(); foreach (string path in EnumerateAnnotationFiles()) { recorder.VisitFile(path); using (StreamReader reader = File.OpenText(path)) { parser.ProcessDocument(reader, result); } } Compact(result); if (!result.Any()) { throw GetErrorForMissingExternalAnnotations(); } return(new ExternalAnnotationsCache(recorder.HighestLastWriteTimeUtc, result)); }
public static ExternalAnnotationsMap ParseFile([NotNull] string externalAnnotationsPath) { Guard.NotNull(externalAnnotationsPath, "externalAnnotationsPath"); using (TextReader reader = File.OpenText(externalAnnotationsPath)) { var map = new ExternalAnnotationsMap(); var parser = new ExternalAnnotationDocumentParser(); parser.ProcessDocument(reader, map); return map; } }
public static ExternalAnnotationsMap ParseFile([NotNull] string externalAnnotationsPath) { Guard.NotNull(externalAnnotationsPath, "externalAnnotationsPath"); using (TextReader reader = File.OpenText(externalAnnotationsPath)) { var map = new ExternalAnnotationsMap(); var parser = new ExternalAnnotationDocumentParser(); parser.ProcessDocument(reader, map); return(map); } }
private static ExternalAnnotationsCache ScanForMemberExternalAnnotations() { var result = new ExternalAnnotationsMap(); var parser = new ExternalAnnotationDocumentParser(); var recorder = new HighestLastWriteTimeUtcRecorder(); foreach (string path in EnumerateAnnotationFiles()) { recorder.VisitFile(path); using (StreamReader reader = File.OpenText(path)) { parser.ProcessDocument(reader, result); } } Compact(result); return new ExternalAnnotationsCache(recorder.HighestLastWriteTimeUtc, result); }