private void CleanWebControl(ref IHTMLWindowProvider iWebControl) { if (iWebControl == null) { return; } //iWebControl.Crashed -= Crashed; iWebControl.HTMLWindow.ConsoleMessage -= ConsoleMessage; iWebControl.Dispose(); iWebControl = null; }
private void Switch(Task <IHTMLBinding> iBinding, HTMLLogicWindow iwindow, TaskCompletionSource <IHTMLBinding> tcs) { object oldvm = (Binding != null) ? Binding.Root : null; Binding = iBinding.Result; if (_CurrentWebControl != null) { _CurrentWebControl.HTMLWindow.ConsoleMessage -= ConsoleMessage; _CurrentWebControl.Dispose(); } else if (OnFirstLoad != null) { OnFirstLoad(this, EventArgs.Empty); } _CurrentWebControl = _NextWebControl; _NextWebControl = null; //_CurrentWebControl.Crashed += Crashed; _CurrentWebControl.Show(); _Window = iwindow; var inav = _UseINavigable ? Binding.Root as INavigable : null; if (inav != null) { inav.Navigation = this; } _Window.State = WindowLogicalState.Opened; _Window.OpenAsync().ContinueWith(t => EndAnimation(Binding.Root)); _Navigating = false; FireNavigate(Binding.Root, oldvm); if (tcs != null) { tcs.SetResult(Binding); } }
private void CleanWebControl(ref IHTMLWindowProvider iWebControl) { if (iWebControl == null) return; //iWebControl.Crashed -= Crashed; iWebControl.HTMLWindow.ConsoleMessage -= ConsoleMessage; iWebControl.Dispose(); iWebControl = null; }