Aspose::Words::Bibliography::ContributorCollection class
Contents
[
Hide
]ContributorCollection class
Represents bibliography source contributors.
class ContributorCollection : public System::Collections::Generic::IEnumerable<System::SharedPtr<Aspose::Words::Bibliography::Contributor>>
Methods
| Method | Description |
|---|---|
| get_Artist() | Gets or sets the artist of a source. |
| get_Author() | Gets or sets the author of a source. |
| get_BookAuthor() | Gets or sets the book author of a source. |
| get_Compiler() | Gets or sets the compiler of a source. |
| get_Composer() | Gets or sets the composer of a source. |
| get_Conductor() | Gets or sets the conductor of a source. |
| get_Counsel() | Gets or sets the counsel of a source. |
| get_Director() | Gets or sets the director of a source. |
| get_Editor() | Gets or sets the editor of a source. |
| get_Interviewee() | Gets or sets the interviewee of a source. |
| get_Interviewer() | Gets or sets the interviewer of a source. |
| get_Inventor() | Gets or sets the inventor of a source. |
| get_Performer() | Gets or sets the performer of a source. |
| get_Producer() | Gets or sets the producer of a source. |
| get_Translator() | Gets or sets the translator of a source. |
| get_Writer() | Gets or sets the writer of a source. |
| set_Artist(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the artist of a source. |
| set_Author(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the author of a source. |
| set_BookAuthor(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the book author of a source. |
| set_Compiler(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the compiler of a source. |
| set_Composer(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the composer of a source. |
| set_Conductor(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the conductor of a source. |
| set_Counsel(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the counsel of a source. |
| set_Director(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the director of a source. |
| set_Editor(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the editor of a source. |
| set_Interviewee(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the interviewee of a source. |
| set_Interviewer(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the interviewer of a source. |
| set_Inventor(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the inventor of a source. |
| set_Performer(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the performer of a source. |
| set_Producer(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the producer of a source. |
| set_Translator(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the translator of a source. |
| set_Writer(const System::SharedPtr<Aspose::Words::Bibliography::Contributor> &) | Sets the writer of a source. |
Examples
Shows how to get bibliography sources available in the document.
auto document = System::MakeObject<Aspose::Words::Document>(System::String(get_MyDir() + u"Bibliography sources.docx"));
System::SharedPtr<Aspose::Words::Bibliography::Bibliography> bibliography = document->get_Bibliography();
ASSERT_EQ(bibliography->get_Sources()->get_Count(), 12);
// Get default data from bibliography sources.
System::SharedPtr<Aspose::Words::Bibliography::Source> source = bibliography->get_Sources()->LINQ_FirstOrDefault();
ASSERT_EQ(source->get_Title(), u"Book 0 (No LCID)");
ASSERT_EQ(source->get_SourceType(), SourceType::Book);
ASSERT_EQ(source->get_Contributors()->LINQ_Count(), 3);
ASSERT_TRUE(System::TestTools::IsNull(source->get_AbbreviatedCaseNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_AlbumTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_BookTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Broadcaster()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_BroadcastTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_CaseNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_ChapterNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Comments()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_ConferenceName()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_CountryOrRegion()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Court()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Day()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_DayAccessed()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Department()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Distributor()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Doi()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Edition()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Guid()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Institution()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_InternetSiteTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Issue()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_JournalName()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Lcid()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Medium()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Month()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_MonthAccessed()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_NumberVolumes()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Pages()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_PatentNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_PeriodicalTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_ProductionCompany()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_PublicationTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Publisher()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_RecordingNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_RefOrder()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Reporter()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_ShortTitle()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_StandardNumber()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_StateOrProvince()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Station()));
ASSERT_EQ(source->get_Tag(), u"BookNoLCID");
ASSERT_TRUE(System::TestTools::IsNull(source->get_Theater()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_ThesisType()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Type()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Url()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Version()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Volume()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_Year()));
ASSERT_TRUE(System::TestTools::IsNull(source->get_YearAccessed()));
// Also, you can create a new source.
auto newSource = System::MakeObject<Aspose::Words::Bibliography::Source>(u"New source", SourceType::Misc);
System::SharedPtr<Aspose::Words::Bibliography::ContributorCollection> contributors = source->get_Contributors();
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Artist()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_BookAuthor()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Compiler()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Composer()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Conductor()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Counsel()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Director()));
ASSERT_FALSE(System::TestTools::IsNull(contributors->get_Editor()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Interviewee()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Interviewer()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Inventor()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Performer()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Producer()));
ASSERT_FALSE(System::TestTools::IsNull(contributors->get_Translator()));
ASSERT_TRUE(System::TestTools::IsNull(contributors->get_Writer()));
System::SharedPtr<Aspose::Words::Bibliography::Contributor> editor = contributors->get_Editor();
ASSERT_EQ((System::ExplicitCast<Aspose::Words::Bibliography::PersonCollection>(editor))->LINQ_Count(), 2);
auto authors = System::ExplicitCast<Aspose::Words::Bibliography::PersonCollection>(contributors->get_Author());
ASSERT_EQ(authors->LINQ_Count(), 2);
System::SharedPtr<Aspose::Words::Bibliography::Person> person = authors->idx_get(0);
ASSERT_EQ(person->get_First(), u"Roxanne");
ASSERT_EQ(person->get_Middle(), u"Brielle");
ASSERT_EQ(person->get_Last(), u"Tejeda");
See Also
- Namespace Aspose::Words::Bibliography
- Library Aspose.Words for C++