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 //------------------------------------------------------------------------------
13 using Tizen.NUI.BaseComponents;
15 public class ViewContainer : global::System.IDisposable, global::System.Collections.IEnumerable
16 , global::System.Collections.Generic.IEnumerable<View>
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 protected bool swigCMemOwn;
21 internal ViewContainer(global::System.IntPtr cPtr, bool cMemoryOwn)
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewContainer obj)
29 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32 //A Flag to check who called Dispose(). (By User or DisposeQueue)
33 private bool isDisposeQueued = false;
34 //A Flat to check if it is already disposed.
35 protected bool disposed = false;
42 isDisposeQueued = true;
43 DisposeQueue.Instance.Add(this);
49 //Throw excpetion if Dispose() is called in separate thread.
50 if (!Window.IsInstalled())
52 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
57 Dispose(DisposeTypes.Implicit);
61 Dispose(DisposeTypes.Explicit);
62 System.GC.SuppressFinalize(this);
66 protected virtual void Dispose(DisposeTypes type)
73 if (type == DisposeTypes.Explicit)
76 //Release your own managed resources here.
77 //You should release all of your own disposable objects here.
81 //Release your own unmanaged resources here.
82 //You should not access any managed member here except static instance.
83 //because the execution order of Finalizes is non-deterministic.
85 if (swigCPtr.Handle != global::System.IntPtr.Zero)
90 NDalicPINVOKE.delete_ActorContainer(swigCPtr);
92 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
100 public ViewContainer(global::System.Collections.ICollection c) : this()
103 throw new global::System.ArgumentNullException("c");
104 foreach (View element in c)
110 public bool IsFixedSize
118 public bool IsReadOnly
126 public View this[int index]
130 return getitem(index);
134 setitem(index, value);
142 return (int)capacity();
147 throw new global::System.ArgumentOutOfRangeException("Capacity");
148 reserve((uint)value);
160 public bool IsSynchronized
168 public void CopyTo(View[] array)
170 CopyTo(0, array, 0, this.Count);
173 public void CopyTo(View[] array, int arrayIndex)
175 CopyTo(0, array, arrayIndex, this.Count);
178 public void CopyTo(int index, View[] array, int arrayIndex, int count)
181 throw new global::System.ArgumentNullException("array");
183 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
185 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
187 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
189 throw new global::System.ArgumentException("Multi dimensional array.", "array");
190 if (index + count > this.Count || arrayIndex + count > array.Length)
191 throw new global::System.ArgumentException("Number of elements to copy is too large.");
192 for (int i = 0; i < count; i++)
193 array.SetValue(getitemcopy(index + i), arrayIndex + i);
196 global::System.Collections.Generic.IEnumerator<View> global::System.Collections.Generic.IEnumerable<View>.GetEnumerator()
198 return new ViewContainerEnumerator(this);
201 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
203 return new ViewContainerEnumerator(this);
206 public ViewContainerEnumerator GetEnumerator()
208 return new ViewContainerEnumerator(this);
211 // Type-safe enumerator
212 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
213 /// whenever the collection is modified. This has been done for changes in the size of the
214 /// collection but not when one of the elements of the collection is modified as it is a bit
215 /// tricky to detect unmanaged code that modifies the collection under our feet.
216 public sealed class ViewContainerEnumerator : global::System.Collections.IEnumerator
217 , global::System.Collections.Generic.IEnumerator<View>
219 private ViewContainer collectionRef;
220 private int currentIndex;
221 private object currentObject;
222 private int currentSize;
224 public ViewContainerEnumerator(ViewContainer collection)
226 collectionRef = collection;
228 currentObject = null;
229 currentSize = collectionRef.Count;
232 // Type-safe iterator Current
237 if (currentIndex == -1)
238 throw new global::System.InvalidOperationException("Enumeration not started.");
239 if (currentIndex > currentSize - 1)
240 throw new global::System.InvalidOperationException("Enumeration finished.");
241 if (currentObject == null)
242 throw new global::System.InvalidOperationException("Collection modified.");
243 return (View)currentObject;
247 // Type-unsafe IEnumerator.Current
248 object global::System.Collections.IEnumerator.Current
256 public bool MoveNext()
258 int size = collectionRef.Count;
259 bool moveOkay = (currentIndex + 1 < size) && (size == currentSize);
263 currentObject = collectionRef[currentIndex];
267 currentObject = null;
275 currentObject = null;
276 if (collectionRef.Count != currentSize)
278 throw new global::System.InvalidOperationException("Collection modified.");
282 public void Dispose()
285 currentObject = null;
291 NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
292 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 public void Add(View x)
297 NDalicPINVOKE.ActorContainer_Add(swigCPtr, View.getCPtr(x));
298 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
303 uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 private uint capacity()
310 uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 private void reserve(uint n)
317 NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
318 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 public ViewContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true)
323 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 public ViewContainer(ViewContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ViewContainer.getCPtr(other)), true)
328 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 public ViewContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true)
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 private View getitemcopy(int index)
338 View ret = new View(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
343 private View getitem(int index)
345 View ret = new View(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
346 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
350 private void setitem(int index, View val)
352 NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, View.getCPtr(val));
353 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 public void AddRange(ViewContainer values)
358 NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ViewContainer.getCPtr(values));
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
362 public ViewContainer GetRange(int index, int count)
364 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
365 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 public void Insert(int index, View x)
372 NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, View.getCPtr(x));
373 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
376 public void InsertRange(int index, ViewContainer values)
378 NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ViewContainer.getCPtr(values));
379 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
382 public void RemoveAt(int index)
384 NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
385 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
388 public void RemoveRange(int index, int count)
390 NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
391 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
394 public static ViewContainer Repeat(View value, int count)
396 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(View.getCPtr(value), count);
397 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
402 public void Reverse()
404 NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 public void Reverse(int index, int count)
410 NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
411 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
414 public void SetRange(int index, ViewContainer values)
416 NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ViewContainer.getCPtr(values));
417 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();