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 public 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;
29 DisposeQueue.Instance.Add(this);
32 public override void Dispose() {
33 if (!Window.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_ObjectRegistry(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
54 public class ObjectCreatedEventArgs : EventArgs
56 private BaseHandle _baseHandle;
58 public BaseHandle BaseHandle
71 public class ObjectDestroyedEventArgs : EventArgs
73 private RefObject _refObject;
75 public RefObject RefObject
89 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
90 private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
91 private DaliEventHandler<object,ObjectCreatedEventArgs> _objectRegistryObjectCreatedEventHandler;
92 private ObjectCreatedEventCallbackDelegate _objectRegistryObjectCreatedEventCallbackDelegate;
94 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
95 private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
96 private DaliEventHandler<object,ObjectDestroyedEventArgs> _objectRegistryObjectDestroyedEventHandler;
97 private ObjectDestroyedEventCallbackDelegate _objectRegistryObjectDestroyedEventCallbackDelegate;
99 public event DaliEventHandler<object,ObjectCreatedEventArgs> ObjectCreated
105 // Restricted to only one listener
106 if (_objectRegistryObjectCreatedEventHandler == null)
108 _objectRegistryObjectCreatedEventHandler += value;
110 _objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
111 this.ObjectCreatedSignal().Connect(_objectRegistryObjectCreatedEventCallbackDelegate);
120 if (_objectRegistryObjectCreatedEventHandler != null)
122 this.ObjectCreatedSignal().Disconnect(_objectRegistryObjectCreatedEventCallbackDelegate);
125 _objectRegistryObjectCreatedEventHandler -= value;
130 // Callback for ObjectRegistry ObjectCreatedSignal
131 private void OnObjectCreated(IntPtr baseHandle)
133 ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
135 // Populate all members of "e" (ObjectCreatedEventArgs) with real data
136 //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
138 if (_objectRegistryObjectCreatedEventHandler != null)
140 //here we send all data to user event handlers
141 _objectRegistryObjectCreatedEventHandler(this, e);
145 public event DaliEventHandler<object,ObjectDestroyedEventArgs> ObjectDestroyed
151 // Restricted to only one listener
152 if (_objectRegistryObjectDestroyedEventHandler == null)
154 _objectRegistryObjectDestroyedEventHandler += value;
156 _objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
157 this.ObjectDestroyedSignal().Connect(_objectRegistryObjectDestroyedEventCallbackDelegate);
166 if (_objectRegistryObjectDestroyedEventHandler != null)
168 this.ObjectDestroyedSignal().Disconnect(_objectRegistryObjectDestroyedEventCallbackDelegate);
171 _objectRegistryObjectDestroyedEventHandler -= value;
176 // Callback for ObjectRegistry ObjectDestroyedSignal
177 private void OnObjectDestroyed(IntPtr refObject)
179 ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
181 // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
182 e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
184 if (_objectRegistryObjectDestroyedEventHandler != null)
186 //here we send all data to user event handlers
187 _objectRegistryObjectDestroyedEventHandler(this, e);
192 public ObjectRegistry() : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_0(), true) {
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public ObjectRegistry(ObjectRegistry handle) : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_1(ObjectRegistry.getCPtr(handle)), true) {
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public ObjectRegistry Assign(ObjectRegistry rhs) {
201 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.ObjectRegistry_Assign(swigCPtr, ObjectRegistry.getCPtr(rhs)), false);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public ObjectCreatedSignal ObjectCreatedSignal() {
207 ObjectCreatedSignal ret = new ObjectCreatedSignal(NDalicPINVOKE.ObjectRegistry_ObjectCreatedSignal(swigCPtr), false);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
212 public ObjectDestroyedSignal ObjectDestroyedSignal() {
213 ObjectDestroyedSignal ret = new ObjectDestroyedSignal(NDalicPINVOKE.ObjectRegistry_ObjectDestroyedSignal(swigCPtr), false);
214 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();