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 PropertyNotification : BaseHandle
20 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
22 internal PropertyNotification(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyNotification_SWIGUpcast(cPtr), cMemoryOwn)
24 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
27 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotification 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_PropertyNotification(swigCPtr);
58 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
65 * @brief Event arguments that passed via Notify signal
68 public class NotifyEventArgs : EventArgs
70 private PropertyNotification _propertyNotification;
73 * @brief PropertyNotification - is the PropertyNotification handle that has the notification properties.
76 public PropertyNotification PropertyNotification
80 return _propertyNotification;
84 _propertyNotification = value;
89 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
90 private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification);
91 private DaliEventHandler<object, NotifyEventArgs> _propertyNotificationNotifyEventHandler;
92 private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
95 * @brief Event for Notified signal which can be used to subscribe/unsubscribe the event handler
96 * (in the type of NotifyEventHandler-DaliEventHandler<object,NotifyEventArgs>) provided by the user.
97 * Notified signal is emitted when the notification upon a condition of the property being met, has occurred.
99 public event DaliEventHandler<object, NotifyEventArgs> Notified
105 // Restricted to only one listener
106 if (_propertyNotificationNotifyEventHandler == null)
108 _propertyNotificationNotifyEventHandler += value;
110 _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
111 this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
120 if (_propertyNotificationNotifyEventHandler != null)
122 this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
125 _propertyNotificationNotifyEventHandler -= value;
130 // Callback for PropertyNotification NotifySignal
131 private void OnPropertyNotificationNotify(IntPtr propertyNotification)
133 NotifyEventArgs e = new NotifyEventArgs();
134 e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification);
136 if (_propertyNotificationNotifyEventHandler != null)
138 //here we send all data to user event handlers
139 _propertyNotificationNotifyEventHandler(this, e);
143 public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr)
145 PropertyNotification ret = new PropertyNotification(cPtr, false);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true)
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public static PropertyNotification DownCast(BaseHandle handle)
158 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public PropertyNotification Assign(PropertyNotification rhs)
170 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_Assign(swigCPtr, PropertyNotification.getCPtr(rhs)), false);
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 public PropertyCondition GetCondition()
177 PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyNotification_GetCondition__SWIG_0(swigCPtr), true);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 public Animatable GetTarget()
184 Animatable ret = new Animatable(NDalicPINVOKE.PropertyNotification_GetTarget(swigCPtr), true);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public int GetTargetProperty()
191 int ret = NDalicPINVOKE.PropertyNotification_GetTargetProperty(swigCPtr);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public void SetNotifyMode(PropertyNotification.NotifyMode mode)
198 NDalicPINVOKE.PropertyNotification_SetNotifyMode(swigCPtr, (int)mode);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public PropertyNotification.NotifyMode GetNotifyMode()
204 PropertyNotification.NotifyMode ret = (PropertyNotification.NotifyMode)NDalicPINVOKE.PropertyNotification_GetNotifyMode(swigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 public bool GetNotifyResult()
211 bool ret = NDalicPINVOKE.PropertyNotification_GetNotifyResult(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 public PropertyNotifySignal NotifySignal()
218 PropertyNotifySignal ret = new PropertyNotifySignal(NDalicPINVOKE.PropertyNotification_NotifySignal(swigCPtr), false);
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223 public enum NotifyMode