protected virtual void Dispose(bool disposing) { if (_self != null) { cef_run_file_dialog_callback_t.Free(_self); _self = null; } }
public CefRunFileDialogCallback() { cef_run_file_dialog_callback_t *self = this.NativeInstance; #if NET_LESS_5_0 self->on_file_dialog_dismissed = (void *)Marshal.GetFunctionPointerForDelegate(fnOnFileDialogDismissed); #else self->on_file_dialog_dismissed = (delegate * unmanaged[Stdcall] < cef_run_file_dialog_callback_t *, int, cef_string_list_t, void >) & OnFileDialogDismissedImpl; #endif }
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(result); } }
protected CefRunFileDialogCallback() { _self = cef_run_file_dialog_callback_t.Alloc(); _ds0 = new cef_run_file_dialog_callback_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_run_file_dialog_callback_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_run_file_dialog_callback_t.has_one_ref_delegate(has_one_ref); _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_run_file_dialog_callback_t.on_file_dialog_dismissed_delegate(on_file_dialog_dismissed); _self->_on_file_dialog_dismissed = Marshal.GetFunctionPointerForDelegate(_ds3); }
protected CefRunFileDialogCallback() { _self = cef_run_file_dialog_callback_t.Alloc(); _ds0 = new cef_run_file_dialog_callback_t.add_ref_delegate(add_ref); _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0); _ds1 = new cef_run_file_dialog_callback_t.release_delegate(release); _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1); _ds2 = new cef_run_file_dialog_callback_t.get_refct_delegate(get_refct); _self->_base._get_refct = Marshal.GetFunctionPointerForDelegate(_ds2); _ds3 = new cef_run_file_dialog_callback_t.cont_delegate(cont); _self->_cont = Marshal.GetFunctionPointerForDelegate(_ds3); }
internal static void Free(cef_run_file_dialog_callback_t *ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
public CefRunFileDialogCallback(cef_run_file_dialog_callback_t *instance) : base((cef_base_ref_counted_t *)instance) { }
private int has_one_ref(cef_run_file_dialog_callback_t *self) { lock (SyncRoot) { return(_refct == 1 ? 1 : 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); }
public CefRunFileDialogCallback() { cef_run_file_dialog_callback_t *self = this.NativeInstance; self->on_file_dialog_dismissed = (void *)Marshal.GetFunctionPointerForDelegate(fnOnFileDialogDismissed); }
private void on_file_dialog_dismissed(cef_run_file_dialog_callback_t *self, int selected_accept_filter, cef_string_list *file_paths) { CheckSelf(self); throw new NotImplementedException(); // TODO: CefRunFileDialogCallback.OnFileDialogDismissed }
public unsafe extern void RunFileDialog(CefFileDialogMode mode, [Immutable] cef_string_t *title, [Immutable] cef_string_t *default_file_path, cef_string_list_t accept_filters, int selected_accept_filter, cef_run_file_dialog_callback_t *callback);
private int get_refct(cef_run_file_dialog_callback_t *self) { return(_refct); }
/// <summary> /// Call to run a file chooser dialog. Only a single file chooser dialog may be /// pending at any given time. |mode| represents the type of dialog to display. /// |title| to the title to be used for the dialog and may be empty to show the /// default title ("Open" or "Save" depending on the mode). |default_file_path| /// is the path with optional directory and/or file name component that will be /// initially selected in the dialog. |accept_filters| are used to restrict the /// selectable file types and may any combination of (a) valid lower-cased MIME /// types (e.g. "text/*" or "image/*"), (b) individual file extensions (e.g. /// ".txt" or ".png"), or (c) combined description and file extension delimited /// using "|" and ";" (e.g. "Image Types|.png;.gif;.jpg"). /// |selected_accept_filter| is the 0-based index of the filter that will be /// selected by default. |callback| will be executed after the dialog is /// dismissed or immediately if another dialog is already pending. The dialog /// will be initiated asynchronously on the UI thread. /// </summary> public void RunFileDialog(CefFileDialogMode mode, cef_string_t *title, cef_string_t *default_file_path, cef_string_list *accept_filters, int selected_accept_filter, cef_run_file_dialog_callback_t *callback) { throw new NotImplementedException(); // TODO: CefBrowserHost.RunFileDialog }