コード例 #1
0
ファイル: EvasObjectEvent.cs プロジェクト: yunmiha/TizenFX
 public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type, SmartEventInfoParser parser)
 {
     _sender = sender;
     _handle = handle;
     _type   = type;
     _parser = parser;
     sender.AddToEventLifeTracker(this);
 }
コード例 #2
0
ファイル: EvasCanvas.cs プロジェクト: prjung/TizenFX
        /// <summary>
        /// Adds or registers a event to a given canvas event.
        /// </summary>
        /// <param name="type">The type of event that triggers</param>
        /// <param name="action">The action to be called when the event is triggered</param>
        /// <since_tizen> preview </since_tizen>
        public void AddEventAction(EvasObjectCallbackType type, Action action)
        {
            if (action != null)
            {
                var eventData = new EventData(type, action);

                if (!_eventDatas.ContainsKey(eventData))
                {
                    var evasCallback = new Interop.Evas.EvasCallback((d, o, t) => action());
                    Interop.Evas.evas_event_callback_add(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback, IntPtr.Zero);
                    _eventDatas.Add(eventData, evasCallback);
                }
            }
        }
コード例 #3
0
ファイル: EvasCanvas.cs プロジェクト: prjung/TizenFX
        /// <summary>
        /// Deletes a event to a given canvas event.
        /// </summary>
        /// <param name="type">The type of event that triggers</param>
        /// <param name="action">The action to be called when the event is triggered</param>
        /// <since_tizen> preview </since_tizen>
        public void DeleteEventAction(EvasObjectCallbackType type, Action action)
        {
            if (action != null)
            {
                var eventData = new EventData(type, action);
                Interop.Evas.EvasCallback evasCallback = null;
                _eventDatas.TryGetValue(eventData, out evasCallback);

                if (evasCallback != null)
                {
                    Interop.Evas.evas_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback);
                    _eventDatas.Remove(eventData);
                }
            }
        }
コード例 #4
0
ファイル: EvasCanvas.cs プロジェクト: prjung/TizenFX
 public EventData(EvasObjectCallbackType type, Action action)
 {
     Type   = type;
     Action = action;
 }
コード例 #5
0
ファイル: EvasObjectEvent.cs プロジェクト: yunmiha/TizenFX
 /// <summary>
 /// Creates and initializes a new instance of the EvasObjectEvent.
 /// </summary>
 /// <param name="sender">EvasObject class belongs to.</param>
 /// <param name="type">SmartEventInfoParser</param>
 /// <since_tizen> preview </since_tizen>
 public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, type, null)
 {
 }
コード例 #6
0
ファイル: EvasObjectEvent.cs プロジェクト: yunmiha/TizenFX
 /// <summary>
 /// Creates and initializes a new instance of the EvasObjectEvent.
 /// </summary>
 /// <param name="sender">EvasObject class belongs to.</param>
 /// <param name="type">EvasObjectCallbackType</param>
 /// <param name="parser">SmartEventInfoParser</param>
 /// <since_tizen> preview </since_tizen>
 public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type, SmartEventInfoParser parser) : this(sender, sender.Handle, type, parser)
 {
 }