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 public override void Dispose() {
29 if (!Window.IsInstalled()) {
30 DisposeQueue.Instance.Add(this);
35 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
38 NDalicPINVOKE.delete_PropertyNotification(swigCPtr);
40 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
42 global::System.GC.SuppressFinalize(this);
50 * @brief Event arguments that passed via Notify signal
53 public class NotifyEventArgs : EventArgs
55 private PropertyNotification _propertyNotification;
58 * @brief PropertyNotification - is the PropertyNotification handle that has the notification properties.
61 public PropertyNotification PropertyNotification
65 return _propertyNotification;
69 _propertyNotification = value;
74 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
75 private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification);
76 private DaliEventHandler<object,NotifyEventArgs> _propertyNotificationNotifyEventHandler;
77 private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate;
80 * @brief Event for Notified signal which can be used to subscribe/unsubscribe the event handler
81 * (in the type of NotifyEventHandler-DaliEventHandler<object,NotifyEventArgs>) provided by the user.
82 * Notified signal is emitted when the notification upon a condition of the property being met, has occurred.
84 public event DaliEventHandler<object,NotifyEventArgs> Notified
90 // Restricted to only one listener
91 if (_propertyNotificationNotifyEventHandler == null)
93 _propertyNotificationNotifyEventHandler += value;
95 _propertyNotificationNotifyEventCallbackDelegate = new NotifyEventCallbackDelegate(OnPropertyNotificationNotify);
96 this.NotifySignal().Connect(_propertyNotificationNotifyEventCallbackDelegate);
105 if (_propertyNotificationNotifyEventHandler != null)
107 this.NotifySignal().Disconnect(_propertyNotificationNotifyEventCallbackDelegate);
110 _propertyNotificationNotifyEventHandler -= value;
115 // Callback for PropertyNotification NotifySignal
116 private void OnPropertyNotificationNotify(IntPtr propertyNotification)
118 NotifyEventArgs e = new NotifyEventArgs();
119 e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification);
121 if (_propertyNotificationNotifyEventHandler != null)
123 //here we send all data to user event handlers
124 _propertyNotificationNotifyEventHandler(this, e);
128 public static PropertyNotification GetPropertyNotificationFromPtr(global::System.IntPtr cPtr) {
129 PropertyNotification ret = new PropertyNotification(cPtr, false);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) {
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 public static PropertyNotification DownCast(BaseHandle handle) {
140 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) {
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public PropertyNotification Assign(PropertyNotification rhs) {
150 PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_Assign(swigCPtr, PropertyNotification.getCPtr(rhs)), false);
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public PropertyCondition GetCondition() {
156 PropertyCondition ret = new PropertyCondition(NDalicPINVOKE.PropertyNotification_GetCondition__SWIG_0(swigCPtr), true);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 public Animatable GetTarget() {
162 Animatable ret = new Animatable(NDalicPINVOKE.PropertyNotification_GetTarget(swigCPtr), true);
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 public int GetTargetProperty() {
168 int ret = NDalicPINVOKE.PropertyNotification_GetTargetProperty(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public void SetNotifyMode(PropertyNotification.NotifyMode mode) {
174 NDalicPINVOKE.PropertyNotification_SetNotifyMode(swigCPtr, (int)mode);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public PropertyNotification.NotifyMode GetNotifyMode() {
179 PropertyNotification.NotifyMode ret = (PropertyNotification.NotifyMode)NDalicPINVOKE.PropertyNotification_GetNotifyMode(swigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public bool GetNotifyResult() {
185 bool ret = NDalicPINVOKE.PropertyNotification_GetNotifyResult(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public PropertyNotifySignal NotifySignal() {
191 PropertyNotifySignal ret = new PropertyNotifySignal(NDalicPINVOKE.PropertyNotification_NotifySignal(swigCPtr), false);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public enum NotifyMode {