Aspose::Words::Fields::FieldCollection Class Reference

A collection of Aspose::Words::Fields::Field objects that represents the fields in the specified range. More...

#include "Aspose.Words.Cpp/Model/Fields/FieldCollection.h"

Inherits IEnumerable< System::SharedPtr< Aspose::Words::Fields::Field > >.

Public Member Functions

int32_t get_Count ()
 Returns the number of the fields in the collection. More...
 
System::SharedPtr< Aspose::Words::Fields::Fieldidx_get (int32_t index)
 Returns a field at the specified index. More...
 
void Remove (System::SharedPtr< Aspose::Words::Fields::Field > field)
 Removes the specified field from this collection and from the document. More...
 
void RemoveAt (int32_t index)
 Removes a field at the specified index from this collection and from the document. More...
 
void Clear ()
 Removes all fields of this collection from the document and from this collection itself. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Aspose::Words::Fields::Field > > > GetEnumerator ()
 Returns an enumerator object. More...
 

Detailed Description

A collection of Aspose::Words::Fields::Field objects that represents the fields in the specified range.

An instance of this collection contains fields which starts fall within the specified range.

Member Function Documentation

◆ Clear()

void Aspose::Words::Fields::FieldCollection::Clear ( )

Removes all fields of this collection from the document and from this collection itself.

◆ get_Count()

int32_t Aspose::Words::Fields::FieldCollection::get_Count ( )

Returns the number of the fields in the collection.

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Aspose::Words::Fields::Field> > > Aspose::Words::Fields::FieldCollection::GetEnumerator ( )

Returns an enumerator object.

◆ idx_get()

System::SharedPtr<Aspose::Words::Fields::Field> Aspose::Words::Fields::FieldCollection::idx_get ( int32_t  index)

Returns a field at the specified index.

The index is zero-based.

Negative indexes are allowed and indicate access from the back of the collection. For example -1 means the last item, -2 means the second before last and so on.

If index is greater than or equal to the number of items in the list, this returns a null reference.

If index is negative and its absolute value is greater than the number of items in the list, this returns a null reference.

Parameters
indexAn index into the collection.

◆ Remove()

void Aspose::Words::Fields::FieldCollection::Remove ( System::SharedPtr< Aspose::Words::Fields::Field field)

Removes the specified field from this collection and from the document.

Parameters
fieldA field to remove.

◆ RemoveAt()

void Aspose::Words::Fields::FieldCollection::RemoveAt ( int32_t  index)

Removes a field at the specified index from this collection and from the document.

Parameters
indexAn index into the collection.