A collection of Field objects that represents the fields in the specified range.
An instance of this collection iterates fields which start fall within the specified range.
The FieldCollection collection does not own the fields it contains, rather, is just a selection of fields.
The FieldCollection collection is "live", i.e. changes to the children of the node object that it was created from are immediately reflected in the fields returned by the FieldCollection properties and methods.
Shows how to work with a collection of fields.
Shows how to remove fields from a field collection.
#include <Aspose.Words.Cpp/Fields/FieldCollection.h>
Public Member Functions | |
void | Clear () |
Removes all fields of this collection from the document and from this collection itself. More... | |
int32_t | get_Count () |
Returns the number of the fields in the collection. More... | |
SharedPtr< IEnumerator< SharedPtr< Field > > > | GetEnumerator () override |
Returns an enumerator object. More... | |
virtual const TypeInfo & | GetType () const override |
SharedPtr< Field > | idx_get (int32_t index) |
Returns a field at the specified index. More... | |
virtual bool | Is (const TypeInfo &target) const override |
void | Remove (SharedPtr< 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... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
void Aspose::Words::Fields::FieldCollection::Clear | ( | ) |
Removes all fields of this collection from the document and from this collection itself.
Shows how to remove fields from a field collection.
int32_t Aspose::Words::Fields::FieldCollection::get_Count | ( | ) |
Returns the number of the fields in the collection.
Shows how to work with a collection of fields.
Shows how to remove fields from a field collection.
|
override |
Returns an enumerator object.
Shows how to work with a collection of fields.
|
overridevirtual |
Reimplemented from System::Object.
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.
index | An index into the collection. |
Shows how to remove fields from a field collection.
|
overridevirtual |
Reimplemented from System::Object.
void Aspose::Words::Fields::FieldCollection::Remove | ( | System::SharedPtr< Aspose::Words::Fields::Field > | field | ) |
Removes the specified field from this collection and from the document.
field | A field to remove. |
Shows how to remove fields from a field collection.
void Aspose::Words::Fields::FieldCollection::RemoveAt | ( | int32_t | index | ) |
Removes a field at the specified index from this collection and from the document.
index | An index into the collection. |
Shows how to remove fields from a field collection.
|
static |