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 BaseHandle : global::System.IDisposable
16 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17 protected bool swigCMemOwn;
19 internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn)
21 swigCMemOwn = cMemoryOwn;
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseHandle obj)
27 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
30 //A Flag to check who called Dispose(). (By User or DisposeQueue)
31 private bool isDisposeQueued = false;
32 //A Flat to check if it is already disposed.
33 protected bool disposed = false;
39 isDisposeQueued = true;
40 DisposeQueue.Instance.Add(this);
46 //Throw excpetion if Dispose() is called in separate thread.
47 if (!Window.IsInstalled())
49 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
54 Dispose(DisposeTypes.Implicit);
58 Dispose(DisposeTypes.Explicit);
59 System.GC.SuppressFinalize(this);
63 protected virtual void Dispose(DisposeTypes type)
70 if (type == DisposeTypes.Explicit)
73 //Release your own managed resources here.
74 //You should release all of your own disposable objects here.
78 //Release your own unmanaged resources here.
79 //You should not access any managed member here except static instance.
80 //because the execution order of Finalizes is non-deterministic.
82 if (swigCPtr.Handle != global::System.IntPtr.Zero)
87 NDalicPINVOKE.delete_BaseHandle(swigCPtr);
89 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 // Returns the bool value true to indicate that an operand is true and returns false otherwise.
98 public static bool operator true(BaseHandle handle)
100 // if the C# object is null, return false
101 if (BaseHandle.ReferenceEquals(handle, null))
105 // returns true if the handle has a body, false otherwise
106 return handle.HasBody();
109 // Returns the bool false to indicate that an operand is false and returns true otherwise.
110 public static bool operator false(BaseHandle handle)
112 // if the C# object is null, return true
113 if (BaseHandle.ReferenceEquals(handle, null))
117 return !handle.HasBody();
120 // Explicit conversion from Handle to bool.
121 public static explicit operator bool(BaseHandle handle)
123 // if the C# object is null, return false
124 if (BaseHandle.ReferenceEquals(handle, null))
128 // returns true if the handle has a body, false otherwise
129 return handle.HasBody();
133 public static bool operator ==(BaseHandle x, BaseHandle y)
135 // if the C# objects are the same return true
136 if (BaseHandle.ReferenceEquals(x, y))
140 if (!BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null))
142 // drop into native code to see if both handles point to the same body
146 if (BaseHandle.ReferenceEquals(x, null) && !BaseHandle.ReferenceEquals(y, null))
148 if (y.HasBody()) return false;
151 if (!BaseHandle.ReferenceEquals(x, null) && BaseHandle.ReferenceEquals(y, null))
153 if (x.HasBody()) return false;
160 // Inequality operator. Returns Null if either operand is Null
161 public static bool operator !=(BaseHandle x, BaseHandle y)
166 // Logical AND operator for &&
167 // It's possible when doing a && this function (opBitwiseAnd) is never called due
168 // to short circuiting. E.g.
169 // If you perform x && y What actually is called is
170 // BaseHandle.op_False( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseAnd(x,y) )
172 public static BaseHandle operator &(BaseHandle x, BaseHandle y)
181 // Logical OR operator for ||
182 // It's possible when doing a || this function (opBitwiseOr) is never called due
183 // to short circuiting. E.g.
184 // If you perform x || y What actually is called is
185 // BaseHandle.op_True( x ) ? BaseHandle.op_True( x ) : BaseHandle.opTrue( BaseHandle.opBitwiseOr(x,y) )
186 public static BaseHandle operator |(BaseHandle x, BaseHandle y)
188 if (!BaseHandle.ReferenceEquals(x, null) || !BaseHandle.ReferenceEquals(y, null))
203 // Logical ! operator
204 public static bool operator !(BaseHandle x)
206 // if the C# object is null, return true
207 if (BaseHandle.ReferenceEquals(x, null))
219 internal BaseHandle(BaseObject handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_0(BaseObject.getCPtr(handle)), true)
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
224 public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1(), true)
226 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle)), true)
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 public BaseHandle Assign(BaseHandle rhs)
236 BaseHandle ret = new BaseHandle(NDalicPINVOKE.BaseHandle_Assign(swigCPtr, BaseHandle.getCPtr(rhs)), false);
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public bool DoAction(string actionName, PropertyMap attributes)
243 bool ret = NDalicPINVOKE.BaseHandle_DoAction(swigCPtr, actionName, PropertyMap.getCPtr(attributes));
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 public string GetTypeName()
250 string ret = NDalicPINVOKE.BaseHandle_GetTypeName(swigCPtr);
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
255 public bool GetTypeInfo(TypeInfo info)
257 bool ret = NDalicPINVOKE.BaseHandle_GetTypeInfo(swigCPtr, TypeInfo.getCPtr(info));
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 internal BaseObject GetBaseObject()
264 BaseObject ret = new BaseObject(NDalicPINVOKE.BaseHandle_GetBaseObject__SWIG_0(swigCPtr), false);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 NDalicPINVOKE.BaseHandle_Reset(swigCPtr);
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
275 public bool EqualTo(BaseHandle rhs)
277 bool ret = NDalicPINVOKE.BaseHandle_EqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
278 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
282 public bool NotEqualTo(BaseHandle rhs)
284 bool ret = NDalicPINVOKE.BaseHandle_NotEqualTo(swigCPtr, BaseHandle.getCPtr(rhs));
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 internal RefObject GetObjectPtr()
291 global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr);
292 RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false);
293 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
297 public bool HasBody()
299 bool ret = NDalicPINVOKE.BaseHandle_HasBody(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 public bool IsEqual(BaseHandle rhs)
306 bool ret = NDalicPINVOKE.BaseHandle_IsEqual(swigCPtr, BaseHandle.getCPtr(rhs));
307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();