protected override void OnHandleDestroyed(EventArgs e) { this.site.DeactivateHtml(); this.site.CloseHtml(); this.site = null; base.OnHandleDestroyed(e); }
/// <summary>We can only activate the MSHTML after our handle has been created, so upon creating the handle, we create and activate NativeMethods. If LoadHtml was called prior to this, we do the loading now.</summary> /// <param name="e"></param> protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); if (this.firstActivation) { this.site = new HtmlSite(this); this.site.CreateHtml(); this.isCreated = true; this.OnCreated(EventArgs.Empty); this.site.ActivateHtml(); this.firstActivation = false; if (this.desiredLoad) { this.LoadHtml(this.desiredContent, this.desiredUrl); this.desiredLoad = false; } } }