Esempio n. 1
0
        private List <object> GetExportDataForAnnotation(VerseAnnotation verseAnnotation, string bookId, int chapter, string verse)
        {
            var row = new List <object>();

            row.Add(null);
            if (IncludeVoiceActors)
            {
                row.Add(null);
            }
            row.Add(null);
            row.Add(bookId);
            row.Add(chapter);
            row.Add(verse);
            row.Add(null);
            if (LocalizationManager.UILanguageId != "en")
            {
                row.Add(null);
            }
            row.Add(null);
            row.Add(null);
            var annotationInfo = verseAnnotation.Annotation.ToDisplay(AnnotationElementSeparator);

            row.Add(annotationInfo);
            if (Project.ReferenceText.HasSecondaryReferenceText)
            {
                row.Add(annotationInfo);
            }
            row.Add(null);
            return(row);
        }
Esempio n. 2
0
        private int AddAnnotationData(List <List <object> > data, int relativeIndex, VerseAnnotation verseAnnotation)
        {
            Func <string, string, string> modify = (verseAnnotation.Annotation is Sound)
                                ? (Func <string, string, string>)PrependAnnotationInfo : (Func <string, string, string>)AppendAnnotationInfo;

            var col            = GetColumnIndex(ExportColumn.PrimaryReferenceText);
            var annotationInfo = verseAnnotation.Annotation.ToDisplay(AnnotationElementSeparator);

            List <object> rowToModify;
            string        text;
            int           rowIndex = relativeIndex + verseAnnotation.Offset;

            do
            {
                rowToModify = data[rowIndex];
                text        = (string)rowToModify[col];
            } while (text == null && --rowIndex >= 0);
            Debug.Assert(text != null, "We should have been able to find a preceding row with a non-empty reference text");

            rowToModify[col] = modify(text, annotationInfo);
            if (Project.ReferenceText.HasSecondaryReferenceText)
            {
                col = GetColumnIndex(ExportColumn.SecondaryReferenceText);
                rowToModify[col] = modify((string)rowToModify[col], annotationInfo);
            }

            return(rowIndex);
        }