public override void OnDisconnecting(BrowserLinkConnection connection)
        {
            lock (_operationsInProgress)
            {
                foreach (var opId in _operationsInProgress)
                {
                    _uploadHelper.CancelOperation(opId);
                }
            }

            if (IsRecording)
            {
                var appBag = BrowserLocationContinuationActions.GetOrAdd(_connection.AppName, n => new ConcurrentDictionary <string, Action <UnusedCssExtension> >());

                try
                {
                    appBag.AddOrUpdate(_connection.Project.UniqueName, n => c => c.ToggleRecordingMode(), (n, a) => c => c.ToggleRecordingMode());
                }
                catch (COMException)
                {
                    return;
                }
            }

            UnusedCssExtension extension;

            ExtensionByConnection.TryRemove(connection, out extension);

            Settings.BrowserLinkOptions.SettingsUpdated -= InstallIgnorePatterns;
        }