/// <summary> /// Handle LIFT's "note" entity /// </summary> /// <remarks>The difficult thing here is we don't handle anything but a default note. /// Any other kind, we put in the xml residue for round-tripping.</remarks> public void MergeInNote(PalasoDataObject extensible, string type, LiftMultiText contents, string rawXml) { var noteProperty = extensible.GetProperty <MultiText>(PalasoDataObject.WellKnownProperties.Note); bool alreadyHaveAOne = !MultiText.IsEmpty(noteProperty); bool weCanHandleThisType = string.IsNullOrEmpty(type) || type == "general"; if (!alreadyHaveAOne && weCanHandleThisType) { List <String> writingSystemAlternatives = new List <string>(contents.Count); foreach (KeyValuePair <string, string> pair in contents.AsSimpleStrings) { writingSystemAlternatives.Add(pair.Key); } noteProperty = extensible.GetOrCreateProperty <MultiText>(PalasoDataObject.WellKnownProperties.Note); MergeIn(noteProperty, contents); } else //residue { var residue = extensible.GetOrCreateProperty <EmbeddedXmlCollection>(PalasoDataObject.GetEmbeddedXmlNameForProperty(PalasoDataObject.WellKnownProperties.Note)); residue.Values.Add(rawXml); // var r = extensible.GetProperty<EmbeddedXmlCollection>(PalasoDataObject.GetEmbeddedXmlNameForProperty(PalasoDataObject.WellKnownProperties.Note)); // Debug.Assert(r != null); } }