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 PropertyNotification : BaseHandle {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
20 internal PropertyNotification(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyNotification_SWIGUpcast(cPtr), cMemoryOwn) {
21 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
24 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotification obj) {
25 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
28 ~PropertyNotification() {
29 DisposeQueue.Instance.Add(this);
32 public override void Dispose() {
33 if (!Stage.IsInstalled()) {
34 DisposeQueue.Instance.Add(this);
39 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 NDalicPINVOKE.delete_PropertyNotification(swigCPtr);
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
46 global::System.GC.SuppressFinalize(this);
54 * @brief Event arguments that passed via Notify signal
57 public class NotifyEventArgs : EventArgs
59 private PropertyNotification _propertyNotification;
62 * @brief PropertyNotification - is the PropertyNotification handle that has the notification properties.
65 public PropertyNotification PropertyNotification
69 return _propertyNotification;
73 _propertyNotification = value;
78 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
79 private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification);
80 private DaliEventHandler<object,NotifyEventArgs> _propertyNotificationNotifyEventHandler;
81 private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
84 * @brief Event for Notified signal which can be used to subscribe/unsubscribe the event handler
85 * (in the type of NotifyEventHandler-DaliEventHandler<object,NotifyEventArgs>) provided by the user.
86 * Notified signal is emitted when the notification upon a condition of the property being met, has occurred.
88 public event DaliEventHandler<object,NotifyEventArgs> Notified
94 // Restricted to only one listener
95 if (_propertyNotificationNotifyEventHandler == null)
97 _propertyNotificationNotifyEventHandler += value;
99 _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
100 this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
109 if (_propertyNotificationNotifyEventHandler != null)
111 this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
114 _propertyNotificationNotifyEventHandler -= value;
119 // Callback for PropertyNotification NotifySignal
120 private void OnPropertyNotificationNotify(IntPtr propertyNotification)
122 NotifyEventArgs e = new NotifyEventArgs();
123 e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification);
125 if (_propertyNotificationNotifyEventHandler != null)
127 //here we send all data to user event handlers
128 _propertyNotificationNotifyEventHandler(this, e);
132 public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) {
133 PropertyNotification ret = new PropertyNotification(cPtr, false);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) {
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 public static PropertyNotification DownCast(BaseHandle handle) {
144 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) {
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 public PropertyNotification Assign(PropertyNotification rhs) {
154 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_Assign(swigCPtr, PropertyNotification.getCPtr(rhs)), false);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 public PropertyCondition GetCondition() {
160 PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyNotification_GetCondition__SWIG_0(swigCPtr), true);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public Handle GetTarget() {
166 Handle ret = new Handle(NDalicPINVOKE.PropertyNotification_GetTarget(swigCPtr), true);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public int GetTargetProperty() {
172 int ret = NDalicPINVOKE.PropertyNotification_GetTargetProperty(swigCPtr);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public void SetNotifyMode(PropertyNotification.NotifyMode mode) {
178 NDalicPINVOKE.PropertyNotification_SetNotifyMode(swigCPtr, (int)mode);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 public PropertyNotification.NotifyMode GetNotifyMode() {
183 PropertyNotification.NotifyMode ret = (PropertyNotification.NotifyMode)NDalicPINVOKE.PropertyNotification_GetNotifyMode(swigCPtr);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 public bool GetNotifyResult() {
189 bool ret = NDalicPINVOKE.PropertyNotification_GetNotifyResult(swigCPtr);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public PropertyNotifySignal NotifySignal() {
195 PropertyNotifySignal ret = new PropertyNotifySignal(NDalicPINVOKE.PropertyNotification_NotifySignal(swigCPtr), false);
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public enum NotifyMode {