8 #include <system/exceptions.h>
9 #include <system/details/pointer_collection_helpers.h>
10 #include <system/collections/list.h>
11 #include <system/collections/ilist.h>
12 #include <system/array.h>
21 class VbaProjectReader;
22 class VbaProjectReferencesReader;
24 class VbaModuleAttributeCollection;
25 class VbaModuleCollection;
26 class VbaReferenceCollection;
35 template <
typename>
class IEnumerator;
52 typedef System::Collections::Generic::IList<T> BaseType;
54 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
55 RTTI_INFO_TEMPLATE_CLASS(
ThisType, ThisTypeBaseTypesInfo);
58 friend class Aspose::Tasks::Vba::VbaProjectReferencesReader;
62 friend class Aspose::Tasks::Vba::VbaProjectReader;
71 return this->items->get_Count();
81 return this->items->idx_get(index);
89 void idx_set(int32_t index, T value)
override
93 throw System::NotSupportedException(u
"Collection is read-only.");
100 System::SharedPtr<System::Collections::Generic::IEnumerator<T>>
GetEnumerator()
override
102 return this->items->GetEnumerator();
109 void Add(
const T& item)
override
112 throw System::NotSupportedException(u
"Collection is read-only.");
119 System::SharedPtr<System::Collections::Generic::List<T>>
ToList()
121 return System::MakeObject<System::Collections::Generic::List<T>>(this->items);
124 void SetTemplateWeakPtr(uint32_t argument)
override
129 System::Details::CollectionHelpers::SetWeakPointer(0, items);
137 ReadOnlyCollectionBase() : items(System::MakeObject<System::Collections::Generic::List<T>>())
141 ReadOnlyCollectionBase(
const System::SharedPtr<System::Collections::Generic::IList<T>>& items)
142 : items(System::MakeObject<System::Collections::Generic::List<T>>())
147 void AddInternal(T attribute)
149 this->items->Add(attribute);
152 virtual ~ReadOnlyCollectionBase()
156 #ifdef ASPOSE_GET_SHARED_MEMBERS
157 void GetSharedMembers(System::Object::shared_members_type& result)
const override
159 System::Object::GetSharedMembers(result);
161 result.Add(
"Aspose::Tasks::ReadOnlyCollectionBase::items", this->items);
168 System::SharedPtr<System::Collections::Generic::IList<T>> items;
170 bool get_IsReadOnly()
const override
175 int32_t IndexOf(
const T& item)
const override
177 return this->items->IndexOf(item);
180 void CopyTo(System::ArrayPtr<T> array, int32_t arrayIndex)
override
182 this->items->CopyTo(array, arrayIndex);
185 bool Contains(
const T& item)
const override
187 return this->items->Contains(item);
190 void Insert(int32_t index,
const T& item)
override
192 ASPOSE_UNUSED(index);
194 throw System::NotSupportedException(u
"Collection is read-only.");
197 bool Remove(
const T& item)
override
200 throw System::NotSupportedException(u
"Collection is read-only.");
203 void RemoveAt(int32_t index)
override
205 ASPOSE_UNUSED(index);
206 throw System::NotSupportedException(u
"Collection is read-only.");
209 void Clear()
override
211 throw System::NotSupportedException(u
"Collection is read-only.");
Represents a read-only collection of objects.
Definition: ReadOnlyCollectionBase.h:50
int32_t get_Count() const override
Gets the number of objects contained in the object.
Definition: ReadOnlyCollectionBase.h:69
T idx_get(int32_t index) const override
Returns the element at the specified index.
Definition: ReadOnlyCollectionBase.h:79
System::SharedPtr< System::Collections::Generic::IEnumerator< T > > GetEnumerator() override
Returns an enumerator for this collection.
Definition: ReadOnlyCollectionBase.h:100
void Add(const T &item) override
This is the stub implementation of ICollection's Add method, that only throws NotSupportedException
Definition: ReadOnlyCollectionBase.h:109
void idx_set(int32_t index, T value) override
Returns the element at the specified index.
Definition: ReadOnlyCollectionBase.h:89
System::SharedPtr< System::Collections::Generic::List< T > > ToList()
Converts the collection object to a list of VbaModule objects.
Definition: ReadOnlyCollectionBase.h:119
Represents a collection of VbaModuleAttribute objects.
Definition: VbaModuleAttributeCollection.h:46
Represents a collection of VbaModule objects.
Definition: VbaModuleCollection.h:42
Represents a collection of VbaReference objects.
Definition: VbaReferenceCollection.h:42
Aspose.
Definition: Asn.h:13