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 using System.Runtime.InteropServices;
17 internal class ObjectRegistry : BaseHandle {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ObjectRegistry_SWIGUpcast(cPtr), cMemoryOwn) {
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ObjectRegistry obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28 public override void Dispose() {
29 if (!Window.IsInstalled()) {
30 DisposeQueue.Instance.Add(this);
35 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
38 NDalicPINVOKE.delete_ObjectRegistry(swigCPtr);
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
42 global::System.GC.SuppressFinalize(this);
50 public class ObjectCreatedEventArgs : EventArgs
52 private BaseHandle _baseHandle;
54 public BaseHandle BaseHandle
67 public class ObjectDestroyedEventArgs : EventArgs
69 private RefObject _refObject;
71 public RefObject RefObject
85 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
86 private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
87 private DaliEventHandler<object,ObjectCreatedEventArgs> _objectRegistryObjectCreatedEventHandler;
88 private ObjectCreatedEventCallbackDelegate _objectRegistryObjectCreatedEventCallbackDelegate;
90 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
91 private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
92 private DaliEventHandler<object,ObjectDestroyedEventArgs> _objectRegistryObjectDestroyedEventHandler;
93 private ObjectDestroyedEventCallbackDelegate _objectRegistryObjectDestroyedEventCallbackDelegate;
95 public event DaliEventHandler<object,ObjectCreatedEventArgs> ObjectCreated
101 // Restricted to only one listener
102 if (_objectRegistryObjectCreatedEventHandler == null)
104 _objectRegistryObjectCreatedEventHandler += value;
106 _objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
107 this.ObjectCreatedSignal().Connect(_objectRegistryObjectCreatedEventCallbackDelegate);
116 if (_objectRegistryObjectCreatedEventHandler != null)
118 this.ObjectCreatedSignal().Disconnect(_objectRegistryObjectCreatedEventCallbackDelegate);
121 _objectRegistryObjectCreatedEventHandler -= value;
126 // Callback for ObjectRegistry ObjectCreatedSignal
127 private void OnObjectCreated(IntPtr baseHandle)
129 ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
131 // Populate all members of "e" (ObjectCreatedEventArgs) with real data
132 //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
134 if (_objectRegistryObjectCreatedEventHandler != null)
136 //here we send all data to user event handlers
137 _objectRegistryObjectCreatedEventHandler(this, e);
141 public event DaliEventHandler<object,ObjectDestroyedEventArgs> ObjectDestroyed
147 // Restricted to only one listener
148 if (_objectRegistryObjectDestroyedEventHandler == null)
150 _objectRegistryObjectDestroyedEventHandler += value;
152 _objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
153 this.ObjectDestroyedSignal().Connect(_objectRegistryObjectDestroyedEventCallbackDelegate);
162 if (_objectRegistryObjectDestroyedEventHandler != null)
164 this.ObjectDestroyedSignal().Disconnect(_objectRegistryObjectDestroyedEventCallbackDelegate);
167 _objectRegistryObjectDestroyedEventHandler -= value;
172 // Callback for ObjectRegistry ObjectDestroyedSignal
173 private void OnObjectDestroyed(IntPtr refObject)
175 ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
177 // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
178 e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
180 if (_objectRegistryObjectDestroyedEventHandler != null)
182 //here we send all data to user event handlers
183 _objectRegistryObjectDestroyedEventHandler(this, e);
188 public ObjectRegistry() : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_0(), true) {
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 public ObjectRegistry(ObjectRegistry handle) : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_1(ObjectRegistry.getCPtr(handle)), true) {
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public ObjectRegistry Assign(ObjectRegistry rhs) {
197 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.ObjectRegistry_Assign(swigCPtr, ObjectRegistry.getCPtr(rhs)), false);
198 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public ObjectCreatedSignal ObjectCreatedSignal() {
203 ObjectCreatedSignal ret = new ObjectCreatedSignal(NDalicPINVOKE.ObjectRegistry_ObjectCreatedSignal(swigCPtr), false);
204 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public ObjectDestroyedSignal ObjectDestroyedSignal() {
209 ObjectDestroyedSignal ret = new ObjectDestroyedSignal(NDalicPINVOKE.ObjectRegistry_ObjectDestroyedSignal(swigCPtr), false);
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();