Extended .NET SDK Documentation 2025 SP0
Loading...
Searching...
No Matches
ClassPtrArray.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (http://www.swig.org).
5// Version 4.0.2
6//
7// Do not make changes to this file unless you know what you are doing--modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
11namespace PCAD_DOT_NET {
12
13using System;
14using System.Runtime.InteropServices;
15using Teigha.Core;
16using Teigha.TD;
17
18public class ClassPtrArray : IDisposable, System.Collections.IEnumerable
19, System.Collections.Generic.IList<OdRxClass>
20 {
21 private Object locker = new Object();
22 private HandleRef swigCPtr;
23 protected bool swigCMemOwn;
24 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
25 public ClassPtrArray(IntPtr cPtr, bool cMemoryOwn) {
26 swigCMemOwn = cMemoryOwn;
27 swigCPtr = new HandleRef(this, cPtr);
28 }
29 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
30 public static HandleRef getCPtr(ClassPtrArray obj) {
31 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
32 }
33
35 Dispose(false);
36 }
37
38 public void Dispose() {
39 Dispose(true);
40 global::System.GC.SuppressFinalize(this);
41 }
42
43 protected virtual void Dispose(bool disposing) {
44 lock(this) {
45 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
49 }
50 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
51 }
52 }
53 }
54
55 public ClassPtrArray(System.Collections.ICollection c) : this() {
56 if (c == null)
57 throw new ArgumentNullException("c");
58 foreach (OdRxClass element in c) {
59 this.Add(element);
60 }
61 }
62
63 public ClassPtrArray(bool bGCMemory_Own = false)
64 : this(PCADGlobalsPINVOKE.new_ClassPtrArray__SWIG_0(), bGCMemory_Own || MemoryManager.GetMemoryManager().GetCurrentTransaction() == null)
65 {
66 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #9
67 if (!bGCMemory_Own && null != mTr)
68 {
69 mTr.AddObject(new ClassPtrArray(swigCPtr.Handle, true));
70 }
72 }
73
74 public ClassPtrArray(ClassPtrArray other, bool bGCMemory_Own = false) : this(PCADGlobalsPINVOKE.new_ClassPtrArray__SWIG_1(ClassPtrArray.getCPtr(other)), bGCMemory_Own || MemoryManager.GetMemoryManager().GetCurrentTransaction() == null) {
75 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #10
76 if (!bGCMemory_Own && null != mTr)
77 {
78 mTr.AddObject(new ClassPtrArray(swigCPtr.Handle, true));
79 }
81 }
82
83 public ClassPtrArray(int capacity, bool bGCMemory_Own = false) : this(PCADGlobalsPINVOKE.new_ClassPtrArray__SWIG_2(capacity), bGCMemory_Own || MemoryManager.GetMemoryManager().GetCurrentTransaction() == null) {
84 MemoryTransaction mTr = MemoryManager.GetMemoryManager().GetCurrentTransaction(); // MemoryTransaction #11
85 if (!bGCMemory_Own && null != mTr)
86 {
87 mTr.AddObject(new ClassPtrArray(swigCPtr.Handle, true));
88 }
90 }
91
92 public bool IsFixedSize {
93 get {
94 return false;
95 }
96 }
97
98 public bool IsReadOnly {
99 get {
100 return false;
101 }
102 }
103
104 public OdRxClass this[int index] {
105 get {
106 return getitem(index);
107 }
108 set {
109 setitem(index, value);
110 }
111 }
112
113 public int Capacity {
114 get {
115 return (int)capacity();
116 }
117 set {
118 if (value < size())
119 throw new ArgumentOutOfRangeException("Capacity");
120 reserve((uint)value);
121 }
122 }
123
124 public int Count {
125 get {
126 return (int)size();
127 }
128 }
129
130 public bool IsSynchronized {
131 get {
132 return false;
133 }
134 }
135
136 public void CopyTo(OdRxClass[] array)
137 {
138 CopyTo(0, array, 0, this.Count);
139 }
140
141 public void CopyTo(OdRxClass[] array, int arrayIndex)
142 {
143 CopyTo(0, array, arrayIndex, this.Count);
144 }
145
146 public void CopyTo(int index, OdRxClass[] array, int arrayIndex, int count)
147 {
148 if (array == null)
149 throw new ArgumentNullException("array");
150 if (index < 0)
151 throw new ArgumentOutOfRangeException("index", "Value is less than zero");
152 if (arrayIndex < 0)
153 throw new ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
154 if (count < 0)
155 throw new ArgumentOutOfRangeException("count", "Value is less than zero");
156 if (array.Rank > 1)
157 throw new ArgumentException("Multi dimensional array.", "array");
158 if (index+count > this.Count || arrayIndex+count > array.Length)
159 throw new ArgumentException("Number of elements to copy is too large.");
160 for (int i=0; i<count; i++)
161 array.SetValue(getitemcopy(index+i), arrayIndex+i);
162 }
163
164 System.Collections.Generic.IEnumerator<OdRxClass> System.Collections.Generic.IEnumerable<OdRxClass>.GetEnumerator() {
165 return new ClassPtrArrayEnumerator(this);
166 }
167
168 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
169 return new ClassPtrArrayEnumerator(this);
170 }
171
173 return new ClassPtrArrayEnumerator(this);
174 }
175
176 // Type-safe enumerator
181 public class ClassPtrArrayEnumerator : System.Collections.IEnumerator
182 , System.Collections.Generic.IEnumerator<OdRxClass>
183 {
184 private ClassPtrArray collectionRef;
185 private int currentIndex;
186 private object currentObject;
187 private int currentSize;
188
190 collectionRef = collection;
191 currentIndex = -1;
192 currentObject = null;
193 currentSize = collectionRef.Count;
194 }
195
196 // Type-safe iterator Current
198 get {
199 if (currentIndex == -1)
200 throw new InvalidOperationException("Enumeration not started.");
201 if (currentIndex > currentSize - 1)
202 throw new InvalidOperationException("Enumeration finished.");
203 if (currentObject == null)
204 throw new InvalidOperationException("Collection modified.");
205 return (OdRxClass)currentObject;
206 }
207 }
208
209 // Type-unsafe IEnumerator.Current
210 object System.Collections.IEnumerator.Current {
211 get {
212 return Current;
213 }
214 }
215
216 public bool MoveNext() {
217 int size = collectionRef.Count;
218 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
219 if (moveOkay) {
220 currentIndex++;
221 currentObject = collectionRef[currentIndex];
222 } else {
223 currentObject = null;
224 }
225 return moveOkay;
226 }
227
228 public void Reset() {
229 currentIndex = -1;
230 currentObject = null;
231 if (collectionRef.Count != currentSize) {
232 throw new InvalidOperationException("Collection modified.");
233 }
234 }
235
236 public void Dispose() {
237 currentIndex = -1;
238 currentObject = null;
239 }
240 }
241
246
251
252 private uint size() {
253 uint ret = PCADGlobalsPINVOKE.ClassPtrArray_size(swigCPtr);
255 return ret;
256 }
257
258 private uint capacity() {
259 uint ret = PCADGlobalsPINVOKE.ClassPtrArray_capacity(swigCPtr);
260 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending) throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
261 return ret;
262 }
263
264 private void reserve(uint n) {
265 PCADGlobalsPINVOKE.ClassPtrArray_reserve(swigCPtr, n);
266 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending) throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
267 }
268
269 public void resize(uint logicalLength) {
270 PCADGlobalsPINVOKE.ClassPtrArray_resize(swigCPtr, logicalLength);
272 }
273
274 private OdRxClass getitemcopy(int index) {
275 OdRxClass ret = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternalUniversal(typeof(OdRxClass),PCADGlobalsPINVOKE.ClassPtrArray_getitemcopy(swigCPtr, index),false); /*createInt 3_2*/
276
278 return ret;
279}
280
281 private OdRxClass getitem(int index) {
282 global::System.IntPtr cPtr = PCADGlobalsPINVOKE.ClassPtrArray_getitem(swigCPtr, index);
283 OdRxClass ret = (cPtr == global::System.IntPtr.Zero) ? null : new OdRxClass(cPtr, false);
284 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending) throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
285 return ret;
286 }
287
288 private void setitem(int index, OdRxClass val) {
289 PCADGlobalsPINVOKE.ClassPtrArray_setitem(swigCPtr, index, OdRxClass.getCPtr(val));
290 if (PCADGlobalsPINVOKE.SWIGPendingException.Pending) throw PCADGlobalsPINVOKE.SWIGPendingException.Retrieve();
291 }
292
297
298 public ClassPtrArray GetRange(int index, int count) {
299 global::System.IntPtr cPtr = PCADGlobalsPINVOKE.ClassPtrArray_GetRange(swigCPtr, index, count);
300 ClassPtrArray ret = (cPtr == global::System.IntPtr.Zero) ? null : new ClassPtrArray(cPtr, false);
302 return ret;
303 }
304
309
314
319
324
325 public static ClassPtrArray Repeat(OdRxClass value, int count) {
326 global::System.IntPtr cPtr = PCADGlobalsPINVOKE.ClassPtrArray_Repeat(OdRxClass.getCPtr(value), count);
327 ClassPtrArray ret = (cPtr == global::System.IntPtr.Zero) ? null : new ClassPtrArray(cPtr, true);
329 return ret;
330 }
331
336
341
346
352
358
364
370
371}
372
373}
static HandleRef getCPtr(ClassPtrArray obj)
void CopyTo(int index, OdRxClass[] array, int arrayIndex, int count)
void RemoveRange(int index, int count)
void Reverse(int index, int count)
ClassPtrArray(System.Collections.ICollection c)
ClassPtrArray(ClassPtrArray other, bool bGCMemory_Own=false)
void AddRange(ClassPtrArray values)
int IndexOf(OdRxClass value)
static ClassPtrArray Repeat(OdRxClass value, int count)
ClassPtrArray GetRange(int index, int count)
virtual void Dispose(bool disposing)
int LastIndexOf(OdRxClass value)
ClassPtrArray(int capacity, bool bGCMemory_Own=false)
bool Remove(OdRxClass value)
void CopyTo(OdRxClass[] array)
void InsertRange(int index, ClassPtrArray values)
ClassPtrArray(IntPtr cPtr, bool cMemoryOwn)
void Insert(int index, OdRxClass x)
void CopyTo(OdRxClass[] array, int arrayIndex)
void SetRange(int index, ClassPtrArray values)
ClassPtrArrayEnumerator GetEnumerator()
void resize(uint logicalLength)
bool Contains(OdRxClass value)
ClassPtrArray(bool bGCMemory_Own=false)
static void ClassPtrArray_Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int ClassPtrArray_LastIndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_Insert(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void delete_ClassPtrArray(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr ClassPtrArray_GetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool ClassPtrArray_Remove(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static int ClassPtrArray_IndexOf(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_RemoveAt(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr ClassPtrArray_Repeat(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ClassPtrArray_Reverse__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_Reverse__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static void ClassPtrArray_AddRange(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_RemoveRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3)
static bool ClassPtrArray_Contains(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void ClassPtrArray_SetRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static IntPtr ClassPtrArray_getitemcopy(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ClassPtrArray_resize(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2)
static uint ClassPtrArray_size(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ClassPtrArray_InsertRange(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static HandleRef getCPtr(OdRxClass obj)
Definition OdRxClass.cs:25