private void UpdateHostProjectForeground(object state)
        {
            _foregroundDispatcher.AssertForegroundThread();

            var newHostProject = (HostProject)state;

            if (_currentHostProject == null && newHostProject == null)
            {
                // This is a no-op. This project isn't using Razor.
            }
            else if (_currentHostProject == null && newHostProject != null)
            {
                _projectSnapshotManager.ProjectAdded(newHostProject);
            }
            else if (_currentHostProject != null && newHostProject == null)
            {
                _projectSnapshotManager.ProjectRemoved(HostProject);
            }
            else
            {
                _projectSnapshotManager.ProjectConfigurationChanged(newHostProject);
            }

            _currentHostProject = newHostProject;
        }
        // Internal for testing
        internal void UpdateGuestProjectManager(ProjectChangeEventProxyArgs args)
        {
            if (args.Kind == ProjectProxyChangeKind.ProjectAdded)
            {
                var guestPath   = ResolveGuestPath(args.ProjectFilePath);
                var hostProject = new HostProject(guestPath, args.Newer.Configuration, args.Newer.RootNamespace);
                _projectSnapshotManager.ProjectAdded(hostProject);

                if (args.Newer.ProjectWorkspaceState != null)
                {
                    _projectSnapshotManager.ProjectWorkspaceStateChanged(guestPath, args.Newer.ProjectWorkspaceState);
                }
            }
            else if (args.Kind == ProjectProxyChangeKind.ProjectRemoved)
            {
                var guestPath   = ResolveGuestPath(args.ProjectFilePath);
                var hostProject = new HostProject(guestPath, args.Older.Configuration, args.Older.RootNamespace);
                _projectSnapshotManager.ProjectRemoved(hostProject);
            }
            else if (args.Kind == ProjectProxyChangeKind.ProjectChanged)
            {
                if (!args.Older.Configuration.Equals(args.Newer.Configuration))
                {
                    var guestPath   = ResolveGuestPath(args.Newer.FilePath);
                    var hostProject = new HostProject(guestPath, args.Newer.Configuration, args.Newer.RootNamespace);
                    _projectSnapshotManager.ProjectConfigurationChanged(hostProject);
                }
                else if (args.Older.ProjectWorkspaceState != args.Newer.ProjectWorkspaceState ||
                         args.Older.ProjectWorkspaceState?.Equals(args.Newer.ProjectWorkspaceState) == false)
                {
                    var guestPath = ResolveGuestPath(args.Newer.FilePath);
                    _projectSnapshotManager.ProjectWorkspaceStateChanged(guestPath, args.Newer.ProjectWorkspaceState);
                }
            }
        }