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 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() {
32 public override void Dispose() {
34 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
37 NDalicPINVOKE.delete_PropertyNotification(swigCPtr);
39 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
41 global::System.GC.SuppressFinalize(this);
48 * @brief Event arguments that passed via Notify signal
51 public class NotifyEventArgs : EventArgs
53 private PropertyNotification _propertyNotification;
56 * @brief PropertyNotification - is the PropertyNotification handle that has the notification properties.
59 public PropertyNotification PropertyNotification
63 return _propertyNotification;
67 _propertyNotification = value;
72 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
73 private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification);
74 private DaliEventHandler<object,NotifyEventArgs> _propertyNotificationNotifyEventHandler;
75 private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
78 * @brief Event for Notified signal which can be used to subscribe/unsubscribe the event handler
79 * (in the type of NotifyEventHandler-DaliEventHandler<object,NotifyEventArgs>) provided by the user.
80 * Notified signal is emitted when the notification upon a condition of the property being met, has occurred.
82 public event DaliEventHandler<object,NotifyEventArgs> Notified
88 // Restricted to only one listener
89 if (_propertyNotificationNotifyEventHandler == null)
91 _propertyNotificationNotifyEventHandler += value;
93 _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
94 this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
103 if (_propertyNotificationNotifyEventHandler != null)
105 this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
108 _propertyNotificationNotifyEventHandler -= value;
113 // Callback for PropertyNotification NotifySignal
114 private void OnPropertyNotificationNotify(IntPtr propertyNotification)
116 NotifyEventArgs e = new NotifyEventArgs();
117 e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification);
119 if (_propertyNotificationNotifyEventHandler != null)
121 //here we send all data to user event handlers
122 _propertyNotificationNotifyEventHandler(this, e);
126 public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) {
127 PropertyNotification ret = new PropertyNotification(cPtr, false);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) {
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 public static PropertyNotification DownCast(BaseHandle handle) {
138 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) {
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 public PropertyNotification Assign(PropertyNotification rhs) {
148 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_Assign(swigCPtr, PropertyNotification.getCPtr(rhs)), false);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 public PropertyCondition GetCondition() {
154 PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyNotification_GetCondition__SWIG_0(swigCPtr), true);
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
159 public Handle GetTarget() {
160 Handle ret = new Handle(NDalicPINVOKE.PropertyNotification_GetTarget(swigCPtr), true);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 public int GetTargetProperty() {
166 int ret = NDalicPINVOKE.PropertyNotification_GetTargetProperty(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public void SetNotifyMode(PropertyNotification.NotifyMode mode) {
172 NDalicPINVOKE.PropertyNotification_SetNotifyMode(swigCPtr, (int)mode);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 public PropertyNotification.NotifyMode GetNotifyMode() {
177 PropertyNotification.NotifyMode ret = (PropertyNotification.NotifyMode)NDalicPINVOKE.PropertyNotification_GetNotifyMode(swigCPtr);
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 public bool GetNotifyResult() {
183 bool ret = NDalicPINVOKE.PropertyNotification_GetNotifyResult(swigCPtr);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 public PropertyNotifySignal NotifySignal() {
189 PropertyNotifySignal ret = new PropertyNotifySignal(NDalicPINVOKE.PropertyNotification_NotifySignal(swigCPtr), false);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
194 public enum NotifyMode {