Example #1
0
 internal static cef_dialog_handler_t* Alloc()
 {
     var ptr = (cef_dialog_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_dialog_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
Example #2
0
        internal static cef_dialog_handler_t *Alloc()
        {
            var ptr = (cef_dialog_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_dialog_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
Example #3
0
 private void add_ref(cef_dialog_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Example #4
0
 private int release(cef_dialog_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
Example #5
0
        private int on_file_dialog(cef_dialog_handler_t* self, cef_browser_t* browser, CefFileDialogMode mode, cef_string_t* title, cef_string_t* default_file_name, cef_string_list* accept_types, cef_file_dialog_callback_t* callback)
        {
            CheckSelf(self);

            var mBrowser = CefBrowser.FromNative(browser);
            var mTitle = cef_string_t.ToString(title);
            var mDefaultFileName = cef_string_t.ToString(default_file_name);
            var mAcceptTypes = cef_string_list.ToArray(accept_types);
            var mCallback = CefFileDialogCallback.FromNative(callback);

            var result = OnFileDialog(mBrowser, mode, mTitle, mDefaultFileName, mAcceptTypes, mCallback);

            return result ? 1 : 0;
        }
Example #6
0
 private void CheckSelf(cef_dialog_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Example #7
0
 private int has_one_ref(cef_dialog_handler_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }
Example #8
0
 internal static void Free(cef_dialog_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
Example #9
0
 private int get_refct(cef_dialog_handler_t* self)
 {
     return _refct;
 }