Aspose.Tasks for C++
CalendarExceptionCollection.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="CalendarExceptionCollection.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/date_time.h>
9 #include <system/collections/ilist.h>
10 #include <system/array.h>
11 #include <cstdint>
12 
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class Calendar;
20 class CalendarException;
21 class CalendarExceptionCollectionWithCache;
22 namespace IO
23 {
24 namespace MSProject
25 {
26 class Mpp12ExceptionReader;
27 class Mpp9ExceptionReader;
28 } // namespace MSProject
29 namespace Xml
30 {
31 class ExceptionNodeReader;
32 } // namespace Xml
33 } // namespace IO
34 } // namespace Tasks
35 } // namespace Aspose
36 namespace System
37 {
38 namespace Collections
39 {
40 namespace Generic
41 {
42 template <typename> class IEnumerable;
43 template <typename> class IEnumerator;
44 template <typename> class List;
45 } // namespace Generic
46 } // namespace Collections
47 } // namespace System
48 
49 namespace Aspose {
50 
51 namespace Tasks {
52 
53 /// <summary>
54 /// Represents a collection of <see cref="CalendarException"></see> objects.
55 /// </summary>
56 class ASPOSE_TASKS_SHARED_CLASS CalendarExceptionCollection : public System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::CalendarException>>
57 {
59  typedef System::Collections::Generic::IList<System::SharedPtr<Aspose::Tasks::CalendarException>> BaseType;
60 
61  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
62  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
63 
64  friend class Aspose::Tasks::CalendarExceptionCollectionWithCache;
65  friend class Aspose::Tasks::IO::MSProject::Mpp12ExceptionReader;
66  friend class Aspose::Tasks::IO::MSProject::Mpp9ExceptionReader;
67  friend class Aspose::Tasks::IO::Xml::ExceptionNodeReader;
68 
69 public:
70 
71  /// <summary>
72  /// Gets the parent calendar for this object.
73  /// </summary>
74  ASPOSE_TASKS_SHARED_API System::SharedPtr<Calendar> get_ParentCalendar() const;
75  /// <summary>
76  /// Gets the number of objects contained in this <see cref="CalendarExceptionCollection"></see> object.
77  /// </summary>
78  ASPOSE_TASKS_SHARED_API int32_t get_Count() const override;
79 
80  /// <summary>
81  /// Returns the element at the specified index.
82  /// </summary>
83  /// <param name="index">The zero-based index of the element to get.</param>
84  /// <returns>the element at the specified index.</returns>
85  ASPOSE_TASKS_SHARED_API System::SharedPtr<CalendarException> idx_get(int32_t index) const override;
86  /// <summary>
87  /// Returns the element at the specified index.
88  /// </summary>
89  /// <param name="index">The zero-based index of the element to get.</param>
90  /// <param name="value">the element at the specified index.</param>
91  ASPOSE_TASKS_SHARED_API void idx_set(int32_t index, System::SharedPtr<CalendarException> value) override;
92 
93  /// <summary>
94  /// Converts the CalendarExceptionCollection object to a list of <see cref="CalendarException"></see> objects.
95  /// </summary>
96  /// <returns>List of <see cref="CalendarException"></see> objects.</returns>
97  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<CalendarException>>> ToList();
98  /// <summary>
99  /// Returns an enumerator for this collection.
100  /// </summary>
101  /// <returns>an enumerator for this collection.</returns>
102  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<CalendarException>>> GetEnumerator() override;
103  /// <summary>
104  /// Adds CalendarException instance to this collection object.
105  /// </summary>
106  /// <param name="item">The item to add.</param>
107  ASPOSE_TASKS_SHARED_API void Add(const System::SharedPtr<CalendarException>& item) override;
108  /// <summary>
109  /// Adds range of exceptions to the internal list.
110  /// </summary>
111  /// <param name="exceptionList">
112  /// Range of exceptions to add.
113  /// </param>
114  ASPOSE_TASKS_SHARED_API void AddRange(const System::SharedPtr<System::Collections::Generic::IEnumerable<System::SharedPtr<CalendarException>>>& exceptionList);
115  /// <summary>
116  /// Removes <see cref="CalendarException"></see> instance from this collection.
117  /// </summary>
118  /// <param name="item">The item to remove.</param>
119  /// <returns>true if the specified exception was removed successfully.</returns>
120  ASPOSE_TASKS_SHARED_API bool Remove(const System::SharedPtr<CalendarException>& item) override;
121  /// <summary>
122  /// Removes all items from the <see cref="CalendarExceptionCollection"></see>.
123  /// </summary>
124  ASPOSE_TASKS_SHARED_API void Clear() override;
125 
126 protected:
127 
128  ASPOSE_TASKS_SHARED_API System::DateTime get_MinExceptionDate() const;
129  ASPOSE_TASKS_SHARED_API System::DateTime get_MaxExceptionDate() const;
130 
131  ASPOSE_TASKS_SHARED_API CalendarExceptionCollection(const System::SharedPtr<Calendar>& parentCalendar);
132 
133  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(CalendarExceptionCollection, CODEPORTING_ARGS(const System::SharedPtr<Calendar>& parentCalendar));
134 
135  ASPOSE_TASKS_SHARED_API CalendarExceptionCollection(const System::SharedPtr<Calendar>& parentCalendar, const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<CalendarException>>>& exceptions);
136 
137  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(CalendarExceptionCollection, CODEPORTING_ARGS(const System::SharedPtr<Calendar>& parentCalendar, const System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<CalendarException>>>& exceptions));
138  ASPOSE_TASKS_SHARED_API void AddInternal(const System::SharedPtr<CalendarException>& item, bool performValidation);
139 
140  virtual ASPOSE_TASKS_SHARED_API ~CalendarExceptionCollection();
141 
142  #ifdef ASPOSE_GET_SHARED_MEMBERS
143  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
144  #endif
145 
146 
147 private:
148 
149  System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<CalendarException>>> exceptions;
150  System::WeakPtr<Calendar> parentCalendar;
151 
152  bool get_IsReadOnly() const override;
153 
154  System::DateTime pr_MinExceptionDate;
155 
156  ASPOSE_TASKS_SHARED_API void set_MinExceptionDate(System::DateTime value);
157 
158  System::DateTime pr_MaxExceptionDate;
159 
160  ASPOSE_TASKS_SHARED_API void set_MaxExceptionDate(System::DateTime value);
161 
162  void RemoveAt(int32_t index) override;
163  bool Contains(const System::SharedPtr<CalendarException>& item) const override;
164  void CopyTo(System::ArrayPtr<System::SharedPtr<CalendarException>> array, int32_t arrayIndex) override;
165  int32_t IndexOf(const System::SharedPtr<CalendarException>& item) const override;
166  void Insert(int32_t index, const System::SharedPtr<CalendarException>& item) override;
167  static void ValidateCalendarException(const System::SharedPtr<CalendarException>& calendarException);
168  void CalculateMinMax();
169 
170 };
171 
172 } // namespace Tasks
173 } // namespace Aspose
174 
175 
Represents a collection of CalendarException objects.
Definition: CalendarExceptionCollection.h:57
void Clear() override
Removes all items from the CalendarExceptionCollection.
System::SharedPtr< CalendarException > idx_get(int32_t index) const override
Returns the element at the specified index.
void AddRange(const System::SharedPtr< System::Collections::Generic::IEnumerable< System::SharedPtr< CalendarException >>> &exceptionList)
Adds range of exceptions to the internal list.
System::SharedPtr< Calendar > get_ParentCalendar() const
Gets the parent calendar for this object.
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< CalendarException > > > GetEnumerator() override
Returns an enumerator for this collection.
void Add(const System::SharedPtr< CalendarException > &item) override
Adds CalendarException instance to this collection object.
bool Remove(const System::SharedPtr< CalendarException > &item) override
Removes CalendarException instance from this collection.
void idx_set(int32_t index, System::SharedPtr< CalendarException > value) override
Returns the element at the specified index.
System::SharedPtr< System::Collections::Generic::List< System::SharedPtr< CalendarException > > > ToList()
Converts the CalendarExceptionCollection object to a list of CalendarException objects.
int32_t get_Count() const override
Gets the number of objects contained in this CalendarExceptionCollection object.
Definition: Asn.h:13