예제 #1
0
        internal static void on_find_result(IntPtr gcHandlePtr, IntPtr browser, out int browser_release, int identifier, int count, IntPtr selectionRect, int activeMatchOrdinal, int finalUpdate)
        {
            var self = (CfxFindHandler)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                browser_release = 1;
                return;
            }
            var e = new CfxFindHandlerOnFindResultEventArgs(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);

            self.m_OnFindResult?.Invoke(self, e);
            e.m_isInvalid   = true;
            browser_release = e.m_browser_wrapped == null? 1 : 0;
        }
예제 #2
0
        internal static void on_find_result(IntPtr gcHandlePtr, IntPtr browser, int identifier, int count, IntPtr selectionRect, int activeMatchOrdinal, int finalUpdate)
        {
            var self = (CfxFindHandler)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null)
            {
                return;
            }
            var e            = new CfxFindHandlerOnFindResultEventArgs(browser, identifier, count, selectionRect, activeMatchOrdinal, finalUpdate);
            var eventHandler = self.m_OnFindResult;

            if (eventHandler != null)
            {
                eventHandler(self, e);
            }
            e.m_isInvalid = true;
            if (e.m_browser_wrapped == null)
            {
                CfxApi.cfx_release(e.m_browser);
            }
        }
예제 #3
0
 /// <summary>
 /// 浏览器框架内容查找结果
 /// </summary>
 /// <param name="e">传递事件</param>
 internal void OnFound(CfxFindHandlerOnFindResultEventArgs e)
 {
     FindHandler?.Invoke(null, new FindEventArgs(e.FinalUpdate, e.Identifier, e.Count));
 }