PersonCollection

PersonCollection class

Represents a list of persons who are bibliography source contributors.

public sealed class PersonCollection : Contributor, IEnumerable<Person>

Properties

NameDescription
Count { get; }Gets the number of elements contained in the collection.
Item { get; }Returns a person at the specified index.

Examples

Shows how to get bibliography sources available in the document.

Document document = new Document(MyDir + "Bibliography sources.docx");

Bibliography bibliography = document.Bibliography;
Assert.AreEqual(12, bibliography.Sources.Count);

Source source = bibliography.Sources.FirstOrDefault();
Assert.AreEqual("Book 0 (No LCID)", source.Title);

ContributorCollection contributors = source.Contributors;
PersonCollection authors = (PersonCollection)contributors.Author;
Assert.AreEqual(2, authors.Count());

Person person = authors.FirstOrDefault();
Assert.AreEqual("Roxanne", person.First);
Assert.AreEqual("Brielle", person.Middle);
Assert.AreEqual("Tejeda", person.Last);

See Also