1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
14 public class ItemIdContainer : global::System.IDisposable, global::System.Collections.IEnumerable
15 , global::System.Collections.Generic.IList<uint>
17 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18 protected bool swigCMemOwn;
20 internal ItemIdContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemIdContainer obj)
28 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31 //A Flag to check who called Dispose(). (By User or DisposeQueue)
32 private bool isDisposeQueued = false;
33 //A Flat to check if it is already disposed.
34 protected bool disposed = false;
41 isDisposeQueued = true;
42 DisposeQueue.Instance.Add(this);
48 //Throw excpetion if Dispose() is called in separate thread.
49 if (!Window.IsInstalled())
51 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
56 Dispose(DisposeTypes.Implicit);
60 Dispose(DisposeTypes.Explicit);
61 System.GC.SuppressFinalize(this);
65 protected virtual void Dispose(DisposeTypes type)
72 if (type == DisposeTypes.Explicit)
75 //Release your own managed resources here.
76 //You should release all of your own disposable objects here.
80 //Release your own unmanaged resources here.
81 //You should not access any managed member here except static instance.
82 //because the execution order of Finalizes is non-deterministic.
84 if (swigCPtr.Handle != global::System.IntPtr.Zero)
89 NDalicPINVOKE.delete_ItemIdContainer(swigCPtr);
91 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 public ItemIdContainer(global::System.Collections.ICollection c) : this()
100 throw new global::System.ArgumentNullException("c");
101 foreach (uint element in c)
107 public bool IsFixedSize
115 public bool IsReadOnly
123 public uint this[int index]
127 return getitem(index);
131 setitem(index, value);
139 return (int)capacity();
144 throw new global::System.ArgumentOutOfRangeException("Capacity");
145 reserve((uint)value);
157 public bool IsSynchronized
165 public void CopyTo(uint[] array)
167 CopyTo(0, array, 0, this.Count);
170 public void CopyTo(uint[] array, int arrayIndex)
172 CopyTo(0, array, arrayIndex, this.Count);
175 public void CopyTo(int index, uint[] array, int arrayIndex, int count)
178 throw new global::System.ArgumentNullException("array");
180 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
182 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
184 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
186 throw new global::System.ArgumentException("Multi dimensional array.", "array");
187 if (index + count > this.Count || arrayIndex + count > array.Length)
188 throw new global::System.ArgumentException("Number of elements to copy is too large.");
189 for (int i = 0; i < count; i++)
190 array.SetValue(getitemcopy(index + i), arrayIndex + i);
193 global::System.Collections.Generic.IEnumerator<uint> global::System.Collections.Generic.IEnumerable<uint>.GetEnumerator()
195 return new ItemIdContainerEnumerator(this);
198 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
200 return new ItemIdContainerEnumerator(this);
203 public ItemIdContainerEnumerator GetEnumerator()
205 return new ItemIdContainerEnumerator(this);
208 // Type-safe enumerator
209 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
210 /// whenever the collection is modified. This has been done for changes in the size of the
211 /// collection but not when one of the elements of the collection is modified as it is a bit
212 /// tricky to detect unmanaged code that modifies the collection under our feet.
213 public sealed class ItemIdContainerEnumerator : global::System.Collections.IEnumerator
214 , global::System.Collections.Generic.IEnumerator<uint>
216 private ItemIdContainer collectionRef;
217 private int currentIndex;
218 private object currentObject;
219 private int currentSize;
221 public ItemIdContainerEnumerator(ItemIdContainer collection)
223 collectionRef = collection;
225 currentObject = null;
226 currentSize = collectionRef.Count;
229 // Type-safe iterator Current
234 if (currentIndex == -1)
235 throw new global::System.InvalidOperationException("Enumeration not started.");
236 if (currentIndex > currentSize - 1)
237 throw new global::System.InvalidOperationException("Enumeration finished.");
238 if (currentObject == null)
239 throw new global::System.InvalidOperationException("Collection modified.");
240 return (uint)currentObject;
244 // Type-unsafe IEnumerator.Current
245 object global::System.Collections.IEnumerator.Current
253 public bool MoveNext()
255 int size = collectionRef.Count;
256 bool moveOkay = (currentIndex + 1 < size) && (size == currentSize);
260 currentObject = collectionRef[currentIndex];
264 currentObject = null;
272 currentObject = null;
273 if (collectionRef.Count != currentSize)
275 throw new global::System.InvalidOperationException("Collection modified.");
279 public void Dispose()
282 currentObject = null;
288 NDalicPINVOKE.ItemIdContainer_Clear(swigCPtr);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 public void Add(uint x)
294 NDalicPINVOKE.ItemIdContainer_Add(swigCPtr, x);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 uint ret = NDalicPINVOKE.ItemIdContainer_size(swigCPtr);
301 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 private uint capacity()
307 uint ret = NDalicPINVOKE.ItemIdContainer_capacity(swigCPtr);
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312 private void reserve(uint n)
314 NDalicPINVOKE.ItemIdContainer_reserve(swigCPtr, n);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318 public ItemIdContainer() : this(NDalicPINVOKE.new_ItemIdContainer__SWIG_0(), true)
320 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 public ItemIdContainer(ItemIdContainer other) : this(NDalicPINVOKE.new_ItemIdContainer__SWIG_1(ItemIdContainer.getCPtr(other)), true)
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328 public ItemIdContainer(int capacity) : this(NDalicPINVOKE.new_ItemIdContainer__SWIG_2(capacity), true)
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
333 private uint getitemcopy(int index)
335 uint ret = NDalicPINVOKE.ItemIdContainer_getitemcopy(swigCPtr, index);
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 private uint getitem(int index)
342 uint ret = NDalicPINVOKE.ItemIdContainer_getitem(swigCPtr, index);
343 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 private void setitem(int index, uint val)
349 NDalicPINVOKE.ItemIdContainer_setitem(swigCPtr, index, val);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
353 public void AddRange(ItemIdContainer values)
355 NDalicPINVOKE.ItemIdContainer_AddRange(swigCPtr, ItemIdContainer.getCPtr(values));
356 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
359 public ItemIdContainer GetRange(int index, int count)
361 global::System.IntPtr cPtr = NDalicPINVOKE.ItemIdContainer_GetRange(swigCPtr, index, count);
362 ItemIdContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemIdContainer(cPtr, true);
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 public void Insert(int index, uint x)
369 NDalicPINVOKE.ItemIdContainer_Insert(swigCPtr, index, x);
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
373 public void InsertRange(int index, ItemIdContainer values)
375 NDalicPINVOKE.ItemIdContainer_InsertRange(swigCPtr, index, ItemIdContainer.getCPtr(values));
376 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 public void RemoveAt(int index)
381 NDalicPINVOKE.ItemIdContainer_RemoveAt(swigCPtr, index);
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
385 public void RemoveRange(int index, int count)
387 NDalicPINVOKE.ItemIdContainer_RemoveRange(swigCPtr, index, count);
388 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
391 public static ItemIdContainer Repeat(uint value, int count)
393 global::System.IntPtr cPtr = NDalicPINVOKE.ItemIdContainer_Repeat(value, count);
394 ItemIdContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ItemIdContainer(cPtr, true);
395 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 public void Reverse()
401 NDalicPINVOKE.ItemIdContainer_Reverse__SWIG_0(swigCPtr);
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 public void Reverse(int index, int count)
407 NDalicPINVOKE.ItemIdContainer_Reverse__SWIG_1(swigCPtr, index, count);
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 public void SetRange(int index, ItemIdContainer values)
413 NDalicPINVOKE.ItemIdContainer_SetRange(swigCPtr, index, ItemIdContainer.getCPtr(values));
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417 public bool Contains(uint value)
419 bool ret = NDalicPINVOKE.ItemIdContainer_Contains(swigCPtr, value);
420 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
424 public int IndexOf(uint value)
426 int ret = NDalicPINVOKE.ItemIdContainer_IndexOf(swigCPtr, value);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 public int LastIndexOf(uint value)
433 int ret = NDalicPINVOKE.ItemIdContainer_LastIndexOf(swigCPtr, value);
434 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
438 public bool Remove(uint value)
440 bool ret = NDalicPINVOKE.ItemIdContainer_Remove(swigCPtr, value);
441 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();