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 void add_ref(cef_run_file_dialog_callback_t* self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
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 1; } return 0; } }
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 == _pd) { d = _dd; } else { d = (run_file_dialog_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(run_file_dialog_delegate)); if (_pd == IntPtr.Zero) { _dd = d; _pd = p; } } d(self, mode, title, default_file_name, accept_types, callback); }
private int get_refct(cef_run_file_dialog_callback_t* self) { return _refct; }
private void CheckSelf(cef_run_file_dialog_callback_t* self) { if (_self != self) throw ExceptionBuilder.InvalidSelfReference(); }
private int has_one_ref(cef_run_file_dialog_callback_t* self) { lock (SyncRoot) { return _refct == 1 ? 1 : 0; } }
internal static void Free(cef_run_file_dialog_callback_t* ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }