internal static cef_run_file_dialog_callback_t* Alloc()
 {
     var ptr = (cef_run_file_dialog_callback_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_run_file_dialog_callback_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
        internal static cef_run_file_dialog_callback_t *Alloc()
        {
            var ptr = (cef_run_file_dialog_callback_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_run_file_dialog_callback_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
        private void cont(cef_run_file_dialog_callback_t* self, cef_browser_host_t* browser_host, cef_string_list* file_paths)
        {
            CheckSelf(self);

            var mBrowserHost = CefBrowserHost.FromNative(browser_host);
            var mFilePaths = cef_string_list.ToArray(file_paths);

            OnFileDialogDismissed(mBrowserHost, mFilePaths);
        }
 private int release(cef_run_file_dialog_callback_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
 private int add_ref(cef_run_file_dialog_callback_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
 internal static void Free(cef_run_file_dialog_callback_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 private void CheckSelf(cef_run_file_dialog_callback_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
 private int get_refct(cef_run_file_dialog_callback_t* self)
 {
     return _refct;
 }
 public static void run_file_dialog(cef_browser_host_t* self, CefFileDialogMode mode, cef_string_t* title, cef_string_t* default_file_name, cef_string_list* accept_types, cef_run_file_dialog_callback_t* callback)
 {
     run_file_dialog_delegate d;
     var p = self->_run_file_dialog;
     if (p == _pe) { d = _de; }
     else
     {
         d = (run_file_dialog_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(run_file_dialog_delegate));
         if (_pe == IntPtr.Zero) { _de = d; _pe = p; }
     }
     d(self, mode, title, default_file_name, accept_types, callback);
 }