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 //------------------------------------------------------------------------------
15 using System.Runtime.InteropServices;
18 internal class ObjectRegistry : BaseHandle
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ObjectRegistry_SWIGUpcast(cPtr), cMemoryOwn)
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ObjectRegistry obj)
29 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
32 protected override void Dispose(DisposeTypes type)
39 if (type == DisposeTypes.Explicit)
42 //Release your own managed resources here.
43 //You should release all of your own disposable objects here.
47 //Release your own unmanaged resources here.
48 //You should not access any managed member here except static instance.
49 //because the execution order of Finalizes is non-deterministic.
51 if (swigCPtr.Handle != global::System.IntPtr.Zero)
56 NDalicPINVOKE.delete_ObjectRegistry(swigCPtr);
58 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
65 public class ObjectCreatedEventArgs : EventArgs
67 private BaseHandle _baseHandle;
69 public BaseHandle BaseHandle
82 public class ObjectDestroyedEventArgs : EventArgs
84 private RefObject _refObject;
86 public RefObject RefObject
100 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
101 private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
102 private DaliEventHandler<object, ObjectCreatedEventArgs> _objectRegistryObjectCreatedEventHandler;
103 private ObjectCreatedEventCallbackDelegate _objectRegistryObjectCreatedEventCallbackDelegate;
105 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
106 private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
107 private DaliEventHandler<object, ObjectDestroyedEventArgs> _objectRegistryObjectDestroyedEventHandler;
108 private ObjectDestroyedEventCallbackDelegate _objectRegistryObjectDestroyedEventCallbackDelegate;
110 public event DaliEventHandler<object, ObjectCreatedEventArgs> ObjectCreated
116 // Restricted to only one listener
117 if (_objectRegistryObjectCreatedEventHandler == null)
119 _objectRegistryObjectCreatedEventHandler += value;
121 _objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
122 this.ObjectCreatedSignal().Connect(_objectRegistryObjectCreatedEventCallbackDelegate);
131 if (_objectRegistryObjectCreatedEventHandler != null)
133 this.ObjectCreatedSignal().Disconnect(_objectRegistryObjectCreatedEventCallbackDelegate);
136 _objectRegistryObjectCreatedEventHandler -= value;
141 // Callback for ObjectRegistry ObjectCreatedSignal
142 private void OnObjectCreated(IntPtr baseHandle)
144 ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
146 // Populate all members of "e" (ObjectCreatedEventArgs) with real data
147 //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
149 if (_objectRegistryObjectCreatedEventHandler != null)
151 //here we send all data to user event handlers
152 _objectRegistryObjectCreatedEventHandler(this, e);
156 public event DaliEventHandler<object, ObjectDestroyedEventArgs> ObjectDestroyed
162 // Restricted to only one listener
163 if (_objectRegistryObjectDestroyedEventHandler == null)
165 _objectRegistryObjectDestroyedEventHandler += value;
167 _objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
168 this.ObjectDestroyedSignal().Connect(_objectRegistryObjectDestroyedEventCallbackDelegate);
177 if (_objectRegistryObjectDestroyedEventHandler != null)
179 this.ObjectDestroyedSignal().Disconnect(_objectRegistryObjectDestroyedEventCallbackDelegate);
182 _objectRegistryObjectDestroyedEventHandler -= value;
187 // Callback for ObjectRegistry ObjectDestroyedSignal
188 private void OnObjectDestroyed(IntPtr refObject)
190 ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
192 // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
193 e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
195 if (_objectRegistryObjectDestroyedEventHandler != null)
197 //here we send all data to user event handlers
198 _objectRegistryObjectDestroyedEventHandler(this, e);
203 public ObjectRegistry() : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_0(), true)
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208 public ObjectRegistry(ObjectRegistry handle) : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_1(ObjectRegistry.getCPtr(handle)), true)
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 public ObjectRegistry Assign(ObjectRegistry rhs)
215 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.ObjectRegistry_Assign(swigCPtr, ObjectRegistry.getCPtr(rhs)), false);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public ObjectCreatedSignal ObjectCreatedSignal()
222 ObjectCreatedSignal ret = new ObjectCreatedSignal(NDalicPINVOKE.ObjectRegistry_ObjectCreatedSignal(swigCPtr), false);
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
227 public ObjectDestroyedSignal ObjectDestroyedSignal()
229 ObjectDestroyedSignal ret = new ObjectDestroyedSignal(NDalicPINVOKE.ObjectRegistry_ObjectDestroyedSignal(swigCPtr), false);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();