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 public class ViewContainer : global::System.IDisposable, global::System.Collections.IEnumerable
14 , global::System.Collections.Generic.IEnumerable<View>
16 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17 protected bool swigCMemOwn;
19 internal ViewContainer(global::System.IntPtr cPtr, bool cMemoryOwn) {
20 swigCMemOwn = cMemoryOwn;
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewContainer obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 DisposeQueue.Instance.Add(this);
32 public virtual void Dispose() {
33 if (!Window.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_ActorContainer(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
51 public ViewContainer(global::System.Collections.ICollection c) : this() {
53 throw new global::System.ArgumentNullException("c");
54 foreach (View element in c) {
59 public bool IsFixedSize {
65 public bool IsReadOnly {
71 public View this[int index] {
73 return getitem(index);
76 setitem(index, value);
82 return (int)capacity();
86 throw new global::System.ArgumentOutOfRangeException("Capacity");
97 public bool IsSynchronized {
103 public void CopyTo(View[] array)
105 CopyTo(0, array, 0, this.Count);
108 public void CopyTo(View[] array, int arrayIndex)
110 CopyTo(0, array, arrayIndex, this.Count);
113 public void CopyTo(int index, View[] array, int arrayIndex, int count)
116 throw new global::System.ArgumentNullException("array");
118 throw new global::System.ArgumentOutOfRangeException("index", "Value is less than zero");
120 throw new global::System.ArgumentOutOfRangeException("arrayIndex", "Value is less than zero");
122 throw new global::System.ArgumentOutOfRangeException("count", "Value is less than zero");
124 throw new global::System.ArgumentException("Multi dimensional array.", "array");
125 if (index+count > this.Count || arrayIndex+count > array.Length)
126 throw new global::System.ArgumentException("Number of elements to copy is too large.");
127 for (int i=0; i<count; i++)
128 array.SetValue(getitemcopy(index+i), arrayIndex+i);
131 global::System.Collections.Generic.IEnumerator<View> global::System.Collections.Generic.IEnumerable<View>.GetEnumerator() {
132 return new ViewContainerEnumerator(this);
135 global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() {
136 return new ViewContainerEnumerator(this);
139 public ViewContainerEnumerator GetEnumerator() {
140 return new ViewContainerEnumerator(this);
143 // Type-safe enumerator
144 /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown
145 /// whenever the collection is modified. This has been done for changes in the size of the
146 /// collection but not when one of the elements of the collection is modified as it is a bit
147 /// tricky to detect unmanaged code that modifies the collection under our feet.
148 public sealed class ViewContainerEnumerator : global::System.Collections.IEnumerator
149 , global::System.Collections.Generic.IEnumerator<View>
151 private ViewContainer collectionRef;
152 private int currentIndex;
153 private object currentObject;
154 private int currentSize;
156 public ViewContainerEnumerator(ViewContainer collection) {
157 collectionRef = collection;
159 currentObject = null;
160 currentSize = collectionRef.Count;
163 // Type-safe iterator Current
164 public View Current {
166 if (currentIndex == -1)
167 throw new global::System.InvalidOperationException("Enumeration not started.");
168 if (currentIndex > currentSize - 1)
169 throw new global::System.InvalidOperationException("Enumeration finished.");
170 if (currentObject == null)
171 throw new global::System.InvalidOperationException("Collection modified.");
172 return (View)currentObject;
176 // Type-unsafe IEnumerator.Current
177 object global::System.Collections.IEnumerator.Current {
183 public bool MoveNext() {
184 int size = collectionRef.Count;
185 bool moveOkay = (currentIndex+1 < size) && (size == currentSize);
188 currentObject = collectionRef[currentIndex];
190 currentObject = null;
195 public void Reset() {
197 currentObject = null;
198 if (collectionRef.Count != currentSize) {
199 throw new global::System.InvalidOperationException("Collection modified.");
203 public void Dispose() {
205 currentObject = null;
209 public void Clear() {
210 NDalicPINVOKE.ActorContainer_Clear(swigCPtr);
211 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public void Add(View x) {
215 NDalicPINVOKE.ActorContainer_Add(swigCPtr, View.getCPtr(x));
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
219 private uint size() {
220 uint ret = NDalicPINVOKE.ActorContainer_size(swigCPtr);
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 private uint capacity() {
226 uint ret = NDalicPINVOKE.ActorContainer_capacity(swigCPtr);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 private void reserve(uint n) {
232 NDalicPINVOKE.ActorContainer_reserve(swigCPtr, n);
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 public ViewContainer() : this(NDalicPINVOKE.new_ActorContainer__SWIG_0(), true) {
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 public ViewContainer(ViewContainer other) : this(NDalicPINVOKE.new_ActorContainer__SWIG_1(ViewContainer.getCPtr(other)), true) {
241 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
244 public ViewContainer(int capacity) : this(NDalicPINVOKE.new_ActorContainer__SWIG_2(capacity), true) {
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 private View getitemcopy(int index) {
249 View ret = new View(NDalicPINVOKE.ActorContainer_getitemcopy(swigCPtr, index), true);
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 private View getitem(int index) {
255 View ret = new View(NDalicPINVOKE.ActorContainer_getitem(swigCPtr, index), false);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 private void setitem(int index, View val) {
261 NDalicPINVOKE.ActorContainer_setitem(swigCPtr, index, View.getCPtr(val));
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public void AddRange(ViewContainer values) {
266 NDalicPINVOKE.ActorContainer_AddRange(swigCPtr, ViewContainer.getCPtr(values));
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 public ViewContainer GetRange(int index, int count) {
271 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_GetRange(swigCPtr, index, count);
272 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
273 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 public void Insert(int index, View x) {
278 NDalicPINVOKE.ActorContainer_Insert(swigCPtr, index, View.getCPtr(x));
279 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public void InsertRange(int index, ViewContainer values) {
283 NDalicPINVOKE.ActorContainer_InsertRange(swigCPtr, index, ViewContainer.getCPtr(values));
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void RemoveAt(int index) {
288 NDalicPINVOKE.ActorContainer_RemoveAt(swigCPtr, index);
289 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
292 public void RemoveRange(int index, int count) {
293 NDalicPINVOKE.ActorContainer_RemoveRange(swigCPtr, index, count);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 public static ViewContainer Repeat(View value, int count) {
298 global::System.IntPtr cPtr = NDalicPINVOKE.ActorContainer_Repeat(View.getCPtr(value), count);
299 ViewContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new ViewContainer(cPtr, true);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public void Reverse() {
305 NDalicPINVOKE.ActorContainer_Reverse__SWIG_0(swigCPtr);
306 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public void Reverse(int index, int count) {
310 NDalicPINVOKE.ActorContainer_Reverse__SWIG_1(swigCPtr, index, count);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
314 public void SetRange(int index, ViewContainer values) {
315 NDalicPINVOKE.ActorContainer_SetRange(swigCPtr, index, ViewContainer.getCPtr(values));
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();