/// <summary> /// 反绑定主机时候调用 /// </summary> public void RemoveHost() { Host.AbsenceModeChanged -= host_AbsenceModeChanged; Host.NickNameChanged -= host_NickNameChanged; Host.AbsenceMessageChanged -= host_AbsenceMessageChanged; browser.Dispose(); }
private void DeleteHtmlRender() { try { if (webHtml is WebBrowserEx) { webHtml.DocumentCompleted -= new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(WebBrowser_DocumentCompleted); webHtml.Navigating -= new System.Windows.Forms.WebBrowserNavigatingEventHandler(WebBrowser_Navigating); webHtml.ProgressChanged -= new System.Windows.Forms.WebBrowserProgressChangedEventHandler(WebBrowser_ProgressChanged); webHtml.PreviewKeyDown -= new System.Windows.Forms.PreviewKeyDownEventHandler(WebBrowser_PreviewKeyDown); webHtml.Dispose(true); } } catch (Exception ex) { ex.ERROR("DeleteHtmlRender"); } try { if (webHost is WindowsFormsHostEx) { webHost.Dispose(); } } catch (Exception ex) { ex.ERROR("DeleteHtmlRender"); } }