Пример #1
0
        ///<summary>Method to raise event DragAcceptEvt.</summary>
        public void On_DragAcceptEvt(Efl.Ui.IDndDragAcceptEvt_Args e)
        {
            EventHandler <Efl.Ui.IDndDragAcceptEvt_Args> evt;

            lock (eventLock) {
                evt = (EventHandler <Efl.Ui.IDndDragAcceptEvt_Args>)eventHandlers[DragAcceptEvtKey];
            }
            evt?.Invoke(this, e);
        }
Пример #2
0
 private void on_DragAcceptEvt_NativeCallback(System.IntPtr data, ref Efl.Event.NativeStruct evt)
 {
     Efl.Ui.IDndDragAcceptEvt_Args args = new Efl.Ui.IDndDragAcceptEvt_Args();
     args.arg = (bool)Marshal.PtrToStructure(evt.Info, typeof(bool));
     try {
         On_DragAcceptEvt(args);
     } catch (Exception e) {
         Eina.Log.Error(e.ToString());
         Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
     }
 }
Пример #3
0
            ///<summary>Method to raise event DragAcceptEvt.</summary>
            public void OnDragAcceptEvt(Efl.Ui.IDndDragAcceptEvt_Args e)
            {
                var    key  = "_EFL_UI_DND_EVENT_DRAG_ACCEPT";
                IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);

                if (desc == IntPtr.Zero)
                {
                    Eina.Log.Error($"Failed to get native event {key}");
                    return;
                }

                IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte)1 : (byte)0);

                try
                {
                    Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
                }
                finally
                {
                    Marshal.FreeHGlobal(info);
                }
            }