internal static void menu_will_show(IntPtr gcHandlePtr, IntPtr menu_model, out int menu_model_release)
        {
            var self = (CfxMenuModelDelegate)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                menu_model_release = 1;
                return;
            }
            var e = new CfxMenuWillShowEventArgs(menu_model);

            self.m_MenuWillShow?.Invoke(self, e);
            e.m_isInvalid      = true;
            menu_model_release = e.m_menu_model_wrapped == null? 1 : 0;
        }
示例#2
0
        internal static void menu_will_show(IntPtr gcHandlePtr, IntPtr menu_model)
        {
            var self = (CfxMenuModelDelegate)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                return;
            }
            var e            = new CfxMenuWillShowEventArgs(menu_model);
            var eventHandler = self.m_MenuWillShow;

            if (eventHandler != null)
            {
                eventHandler(self, e);
            }
            e.m_isInvalid = true;
            if (e.m_menu_model_wrapped == null)
            {
                CfxApi.cfx_release(e.m_menu_model);
            }
        }