コード例 #1
0
 internal static cef_context_menu_handler_t* Alloc()
 {
     var ptr = (cef_context_menu_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_context_menu_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
コード例 #2
0
        internal static cef_context_menu_handler_t *Alloc()
        {
            var ptr = (cef_context_menu_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_context_menu_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
コード例 #3
0
        private void on_context_menu_dismissed(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);

            OnContextMenuDismissed(mBrowser, mFrame);
        }
コード例 #4
0
 private int release(cef_context_menu_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
コード例 #5
0
 private int add_ref(cef_context_menu_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
コード例 #6
0
        private int on_context_menu_command(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, int command_id, CefEventFlags event_flags)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);

            var result = OnContextMenuCommand(mBrowser, mFrame, mState, command_id, event_flags);

            mState.Dispose();

            return result ? 1 : 0;
        }
コード例 #7
0
        private void on_before_context_menu(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* @params, cef_menu_model_t* model)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mFrame = CefFrame.FromNative(frame);
            var mState = CefContextMenuParams.FromNative(@params);
            var mModel = CefMenuModel.FromNative(model);

            OnBeforeContextMenu(mBrowser, mFrame, mState, mModel);

            mState.Dispose();
            mModel.Dispose();
        }
コード例 #8
0
 internal static void Free(cef_context_menu_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
コード例 #9
0
 private void CheckSelf(cef_context_menu_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
コード例 #10
0
 private int get_refct(cef_context_menu_handler_t* self)
 {
     return _refct;
 }