private bool DestroyOverlay(IOverlay overlay) { if (this.overlays.Contains(overlay)) { overlay.Process.Exited -= this.OnProcessExited; overlay.PositionChanged -= this.OnOverlayRelativePositionChangedChanged; overlay.DisplayModeChanged -= this.OnOverlayDisplayModeChanged; this.log.Write(LogLevel.Trace, string.Format("Destroying overlay for process {0}.", overlay.Process.Id)); overlay.Close(); return(this.overlays.Remove(overlay)); } return(false); }
private bool DestroyOverlay(IOverlay overlay) { if (this.overlays.Contains(overlay)) { overlay.Process.Exited -= this.OnProcessExited; overlay.PositionChanged -= this.OnOverlayRelativePositionChangedChanged; overlay.DisplayModeChanged -= this.OnOverlayDisplayModeChanged; this.log.Write(LogLevel.Trace, string.Format("Destroying overlay for process {0}.", overlay.Process.Id)); overlay.Close(); return this.overlays.Remove(overlay); } return false; }