public SrmDocument ReadAllAnnotations(CancellationToken cancellationToken, DsvFileReader fileReader) { var document = Document; var columns = new Columns(fileReader.FieldNames, Document.Settings.DataSettings.AnnotationDefs); string[] row; while ((row = fileReader.ReadLine()) != null) { cancellationToken.ThrowIfCancellationRequested(); ElementLocator elementLocator = columns.GetElementLocator(row); var elementRef = ElementRefs.FromObjectReference(elementLocator); var annotations = GetAnnotations(document, elementRef); var newAnnotations = columns.ReadAnnotations(CultureInfo, elementRef, annotations, row); if (!Equals(newAnnotations, annotations)) { document = ChangeAnnotations(document, elementRef, newAnnotations); } } return(document); }
public DocumentAnnotations(SrmDocument document) { _elementRefs = new ElementRefs(document); Document = document; CultureInfo = CultureInfo.InvariantCulture; }