예제 #1
0
 private CefDownloadItemCallback(cef_download_item_callback_t *ptr)
 {
     if (ptr == null)
     {
         throw new ArgumentNullException("ptr");
     }
     _self = ptr;
 }
예제 #2
0
 internal static CefDownloadItemCallback FromNativeOrNull(cef_download_item_callback_t *ptr)
 {
     if (ptr == null)
     {
         return(null);
     }
     return(new CefDownloadItemCallback(ptr));
 }
예제 #3
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
예제 #4
0
 public void Dispose()
 {
     if (_self != null)
     {
         Release();
         _self = null;
     }
     GC.SuppressFinalize(this);
 }
예제 #5
0
        public static void add_ref(cef_download_item_callback_t *self)
        {
            add_ref_delegate d;
            var p = self->_base._add_ref;

            if (p == _p0)
            {
                d = _d0;
            }
            else
            {
                d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
                if (_p0 == IntPtr.Zero)
                {
                    _d0 = d; _p0 = p;
                }
            }
            d(self);
        }
예제 #6
0
        public static void cancel(cef_download_item_callback_t *self)
        {
            cancel_delegate d;
            var             p = self->_cancel;

            if (p == _p3)
            {
                d = _d3;
            }
            else
            {
                d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
                if (_p3 == IntPtr.Zero)
                {
                    _d3 = d; _p3 = p;
                }
            }
            d(self);
        }
예제 #7
0
        public static int has_one_ref(cef_download_item_callback_t *self)
        {
            has_one_ref_delegate d;
            var p = self->_base._has_one_ref;

            if (p == _p2)
            {
                d = _d2;
            }
            else
            {
                d = (has_one_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(has_one_ref_delegate));
                if (_p2 == IntPtr.Zero)
                {
                    _d2 = d; _p2 = p;
                }
            }
            return(d(self));
        }
        public static void pause(cef_download_item_callback_t *self)
        {
            pause_delegate d;
            var            p = self->_pause;

            if (p == _p4)
            {
                d = _d4;
            }
            else
            {
                d = (pause_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(pause_delegate));
                if (_p4 == IntPtr.Zero)
                {
                    _d4 = d; _p4 = p;
                }
            }
            d(self);
        }
        public static void resume(cef_download_item_callback_t *self)
        {
            resume_delegate d;
            var             p = self->_resume;

            if (p == _p5)
            {
                d = _d5;
            }
            else
            {
                d = (resume_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(resume_delegate));
                if (_p5 == IntPtr.Zero)
                {
                    _d5 = d; _p5 = p;
                }
            }
            d(self);
        }
예제 #10
0
        public static int release(cef_download_item_callback_t *self)
        {
            release_delegate d;
            var p = self->_base._release;

            if (p == _p1)
            {
                d = _d1;
            }
            else
            {
                d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
                if (_p1 == IntPtr.Zero)
                {
                    _d1 = d; _p1 = p;
                }
            }
            return(d(self));
        }
예제 #11
0
 public unsafe extern void OnDownloadUpdated(cef_browser_t *browser, cef_download_item_t *download_item, cef_download_item_callback_t *callback);
예제 #12
0
 private CefDownloadItemCallback(cef_download_item_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
예제 #13
0
        private void on_download_updated(cef_download_handler_t *self, cef_browser_t *browser, cef_download_item_t *download_item, cef_download_item_callback_t *callback)
        {
            CheckSelf(self);

            var m_browser       = CefBrowser.FromNative(browser);
            var m_download_item = CefDownloadItem.FromNative(download_item);
            var m_callback      = CefDownloadItemCallback.FromNative(callback);

            OnDownloadUpdated(m_browser, m_download_item, m_callback);

            m_download_item.Dispose();
        }
예제 #14
0
파일: _partial_gen.cs 프로젝트: qkb/CefLite
 static public CefDownloadItemCallback FromOutVal(cef_download_item_callback_t *ptr) => FromOutVal((IntPtr)ptr, (p2) => new CefDownloadItemCallback(p2, false));
        /// <summary>
        /// Called before a download begins. |suggested_name| is the suggested name for
        /// the download file. By default the download will be canceled. Execute
        /// |callback| either asynchronously or in this method to continue the download
        /// if desired. Do not keep a reference to |download_item| outside of this
        /// method.
        /// </summary>
        // protected abstract void OnBeforeDownload(cef_browser_t* browser, cef_download_item_t* download_item, cef_string_t* suggested_name, cef_before_download_callback_t* callback);

        private void on_download_updated(cef_download_handler_t *self, cef_browser_t *browser, cef_download_item_t *download_item, cef_download_item_callback_t *callback)
        {
            CheckSelf(self);
            throw new NotImplementedException(); // TODO: CefDownloadHandler.OnDownloadUpdated
        }
예제 #16
0
        // void (*)(_cef_download_handler_t* self, _cef_browser_t* browser, _cef_download_item_t* download_item, _cef_download_item_callback_t* callback)*
        private static unsafe void OnDownloadUpdatedImpl(cef_download_handler_t *self, cef_browser_t *browser, cef_download_item_t *download_item, cef_download_item_callback_t *callback)
        {
            var instance = GetInstance((IntPtr)self) as CefDownloadHandler;

            if (instance == null || ((ICefDownloadHandlerPrivate)instance).AvoidOnDownloadUpdated())
            {
                ReleaseIfNonNull((cef_base_ref_counted_t *)browser);
                ReleaseIfNonNull((cef_base_ref_counted_t *)download_item);
                ReleaseIfNonNull((cef_base_ref_counted_t *)callback);
                return;
            }
            instance.OnDownloadUpdated(CefBrowser.Wrap(CefBrowser.Create, browser), CefDownloadItem.Wrap(CefDownloadItem.Create, download_item), CefDownloadItemCallback.Wrap(CefDownloadItemCallback.Create, callback));
        }
예제 #17
0
 internal static CefDownloadItemCallback FromNative(cef_download_item_callback_t *ptr)
 {
     return(new CefDownloadItemCallback(ptr));
 }
예제 #18
0
 public unsafe void OnDownloadUpdated(cef_browser_t *browser, cef_download_item_t *download_item, cef_download_item_callback_t *callback)
 {
     fixed(cef_download_handler_t *self = &this)
     {
         ((delegate * unmanaged[Stdcall] < cef_download_handler_t *, cef_browser_t *, cef_download_item_t *, cef_download_item_callback_t *, void >)on_download_updated)(self, browser, download_item, callback);
     }
 }
예제 #19
0
 public CefDownloadItemCallback(cef_download_item_callback_t *instance)
     : base((cef_base_ref_counted_t *)instance)
 {
 }
예제 #20
0
파일: _partial_gen.cs 프로젝트: qkb/CefLite
 static public CefDownloadItemCallback FromInArg(cef_download_item_callback_t *ptr) => FromInArg((IntPtr)ptr, (p2) => new CefDownloadItemCallback(p2));