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;
32 public override void Dispose() {
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37 NDalicPINVOKE.delete_ObjectRegistry(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(this);
48 public class ObjectCreatedEventArgs : EventArgs
50 private BaseHandle _baseHandle;
52 public BaseHandle BaseHandle
65 public class ObjectDestroyedEventArgs : EventArgs
67 private RefObject _refObject;
69 public RefObject RefObject
83 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
84 private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
85 private DaliEventHandler<object,ObjectCreatedEventArgs> _objectRegistryObjectCreatedEventHandler;
86 private ObjectCreatedEventCallbackDelegate _objectRegistryObjectCreatedEventCallbackDelegate;
88 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
89 private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
90 private DaliEventHandler<object,ObjectDestroyedEventArgs> _objectRegistryObjectDestroyedEventHandler;
91 private ObjectDestroyedEventCallbackDelegate _objectRegistryObjectDestroyedEventCallbackDelegate;
93 public event DaliEventHandler<object,ObjectCreatedEventArgs> ObjectCreated
99 // Restricted to only one listener
100 if (_objectRegistryObjectCreatedEventHandler == null)
102 _objectRegistryObjectCreatedEventHandler += value;
104 _objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
105 this.ObjectCreatedSignal().Connect(_objectRegistryObjectCreatedEventCallbackDelegate);
114 if (_objectRegistryObjectCreatedEventHandler != null)
116 this.ObjectCreatedSignal().Disconnect(_objectRegistryObjectCreatedEventCallbackDelegate);
119 _objectRegistryObjectCreatedEventHandler -= value;
124 // Callback for ObjectRegistry ObjectCreatedSignal
125 private void OnObjectCreated(IntPtr baseHandle)
127 ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
129 // Populate all members of "e" (ObjectCreatedEventArgs) with real data
130 //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
132 if (_objectRegistryObjectCreatedEventHandler != null)
134 //here we send all data to user event handlers
135 _objectRegistryObjectCreatedEventHandler(this, e);
139 public event DaliEventHandler<object,ObjectDestroyedEventArgs> ObjectDestroyed
145 // Restricted to only one listener
146 if (_objectRegistryObjectDestroyedEventHandler == null)
148 _objectRegistryObjectDestroyedEventHandler += value;
150 _objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
151 this.ObjectDestroyedSignal().Connect(_objectRegistryObjectDestroyedEventCallbackDelegate);
160 if (_objectRegistryObjectDestroyedEventHandler != null)
162 this.ObjectDestroyedSignal().Disconnect(_objectRegistryObjectDestroyedEventCallbackDelegate);
165 _objectRegistryObjectDestroyedEventHandler -= value;
170 // Callback for ObjectRegistry ObjectDestroyedSignal
171 private void OnObjectDestroyed(IntPtr refObject)
173 ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
175 // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
176 e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
178 if (_objectRegistryObjectDestroyedEventHandler != null)
180 //here we send all data to user event handlers
181 _objectRegistryObjectDestroyedEventHandler(this, e);
186 public ObjectRegistry() : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_0(), true) {
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public ObjectRegistry(ObjectRegistry handle) : this(NDalicPINVOKE.new_ObjectRegistry__SWIG_1(ObjectRegistry.getCPtr(handle)), true) {
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public ObjectRegistry Assign(ObjectRegistry rhs) {
195 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.ObjectRegistry_Assign(swigCPtr, ObjectRegistry.getCPtr(rhs)), false);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public ObjectCreatedSignal ObjectCreatedSignal() {
201 ObjectCreatedSignal ret = new ObjectCreatedSignal(NDalicPINVOKE.ObjectRegistry_ObjectCreatedSignal(swigCPtr), false);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
206 public ObjectDestroyedSignal ObjectDestroyedSignal() {
207 ObjectDestroyedSignal ret = new ObjectDestroyedSignal(NDalicPINVOKE.ObjectRegistry_ObjectDestroyedSignal(swigCPtr), false);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();