/// <summary>
        /// Disposes the data collector
        /// </summary>
        /// <param name="disposing">Disposing flag</param>
        protected override void Dispose(bool disposing)
        {
            this.eqtTrace.Verbose("{0}: Disposing", CoverletConstants.DataCollectorName);

            // Unregister events
            if (this.events != null)
            {
                this.events.SessionStart -= this.OnSessionStart;
                this.events.SessionEnd   -= this.OnSessionEnd;
            }

            // Remove vars
            this.events          = null;
            this.dataSink        = null;
            this.coverageManager = null;

            base.Dispose(disposing);
        }
        /// <summary>
        /// SessionStart event handler
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="sessionStartEventArgs">Event args</param>
        private void OnSessionStart(object sender, SessionStartEventArgs sessionStartEventArgs)
        {
            this.eqtTrace.Verbose("{0}: SessionStart received", CoverletConstants.DataCollectorName);

            try
            {
                // Get coverlet settings
                IEnumerable <string> testModules = this.GetTestModules(sessionStartEventArgs);
                var coverletSettingsParser       = new CoverletSettingsParser(this.eqtTrace);
                var coverletSettings             = coverletSettingsParser.Parse(this.configurationElement, testModules);

                // Get coverage and attachment managers
                this.coverageManager = new CoverageManager(coverletSettings, this.eqtTrace, this.logger);

                // Instrument modules
                this.coverageManager.InstrumentModules();
            }
            catch (Exception ex)
            {
                this.logger.LogWarning(ex.ToString());
                this.Dispose(true);
            }
        }