Exemple #1
0
        public static TranscriptionSection DeserializeV2(XElement e, bool isStrict)
        {
            TranscriptionSection tsec = new TranscriptionSection();

            tsec.Name     = e.Attribute("name").Value;
            tsec.Elements = e.Attributes().ToDictionary(a => a.Name.ToString(), a => a.Value);
            tsec.Elements.Remove("name");
            foreach (var p in e.Elements(isStrict ? "paragraph" : "pa").Select(p => (TranscriptionElement)TranscriptionParagraph.DeserializeV2(p, isStrict)))
            {
                tsec.Add(p);
            }

            return(tsec);
        }
Exemple #2
0
 /// <summary>
 /// copy constructor
 /// </summary>
 /// <param name="toCopy"></param>
 public TranscriptionSection(TranscriptionSection toCopy)
     : this()
 {
     this.Begin = toCopy.Begin;
     this.End   = toCopy.End;
     this.Name  = toCopy.Name;
     if (toCopy.Paragraphs != null)
     {
         this.Paragraphs = new VirtualTypeList <TranscriptionParagraph>(this, this._children);
         for (int i = 0; i < toCopy.Paragraphs.Count; i++)
         {
             this.Paragraphs.Add(new TranscriptionParagraph(toCopy.Paragraphs[i]));
         }
     }
 }
Exemple #3
0
        public static TranscriptionChapter DeserializeV2(XElement c, bool isStrict)
        {
            TranscriptionChapter chap = new TranscriptionChapter();

            chap.Name     = c.Attribute("name").Value;
            chap.Elements = c.Attributes().ToDictionary(a => a.Name.ToString(), a => a.Value);
            chap.Elements.Remove("name");
            foreach (var s in c.Elements(isStrict ? "section" : "se").Select(s => (TranscriptionElement)TranscriptionSection.DeserializeV2(s, isStrict)))
            {
                chap.Add(s);
            }

            return(chap);
        }