Returns an enumerator object.
Shows how to work with a document's collection of revisions.
auto doc = MakeObject<Document>(MyDir + u"Revisions.docx");
SharedPtr<RevisionCollection> revisions = doc->get_Revisions();
std::cout << revisions->get_Groups()->get_Count() << " revision groups:" << std::endl;
{
SharedPtr<System::Collections::Generic::IEnumerator<SharedPtr<RevisionGroup>>> e = revisions->get_Groups()->GetEnumerator();
while (e->MoveNext())
{
std::cout << (String::Format(u"\tGroup type \"{0}\", ", e->get_Current()->get_RevisionType()) +
String::Format(u"author: {0}, contents: [{1}]", e->get_Current()->get_Author(), e->get_Current()->get_Text().Trim()))
<< std::endl;
}
}
std::cout << "\n" << revisions->get_Count() << " revisions:" << std::endl;
{
SharedPtr<System::Collections::Generic::IEnumerator<SharedPtr<Revision>>> e = revisions->GetEnumerator();
while (e->MoveNext())
{
{
std::cout << (String::Format(u"\tRevision type \"{0}\", ", e->get_Current()->get_RevisionType()) +
String::Format(u"author: {0}, style: [{1}]", e->get_Current()->get_Author(), e->get_Current()->get_ParentStyle()->get_Name()))
<< std::endl;
}
else
{
std::cout << (String::Format(u"\tRevision type \"{0}\", ", e->get_Current()->get_RevisionType()) +
String::Format(u"author: {0}, contents: [{1}]", e->get_Current()->get_Author(),
e->get_Current()->get_ParentNode()->GetText().Trim()))
<< std::endl;
}
}
}
revisions->RejectAll();
ASSERT_EQ(0, revisions->get_Count());