public void AddNote(LexNote note) { if (!MultiTextBase.IsEmpty(note)) { Writer.WriteStartElement("note"); if (!string.IsNullOrEmpty(note.Type)) { Writer.WriteAttributeString("type", note.Type.Trim()); } AddMultitextForms(string.Empty, note); Writer.WriteEndElement(); } }
/// <summary> Adds <see cref="Note"/> of a word to be written out to lift </summary> private static void AddNote(LexEntry entry, Word wordEntry) { if (!wordEntry.Note.IsBlank()) { // This application only uses "basic" notes, which have no type. // To see the implementation of how notes are written to Lift XML: // https://github.com/sillsdev/libpalaso/blob/ // cd94d55185bbb65adaac0e2f1b0f1afc30cc8d13/SIL.DictionaryServices/Lift/LiftWriter.cs#L218 var note = new LexNote(); var forms = new[] { new LanguageForm(wordEntry.Note.Language, wordEntry.Note.Text, note) }; note.Forms = forms; entry.Notes.Add(note); } }