Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public DocumentAnnotations(SrmDocument document)
 {
     _elementRefs = new ElementRefs(document);
     Document     = document;
     CultureInfo  = CultureInfo.InvariantCulture;
 }