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; }
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); }
private void add_ref(cef_dialog_handler_t* self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
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; } }
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; }
private void CheckSelf(cef_dialog_handler_t* self) { if (_self != self) throw ExceptionBuilder.InvalidSelfReference(); }
private int has_one_ref(cef_dialog_handler_t* self) { lock (SyncRoot) { return _refct == 1 ? 1 : 0; } }
internal static void Free(cef_dialog_handler_t* ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private int get_refct(cef_dialog_handler_t* self) { return _refct; }