diff --git a/src/VisualStudio/Core/Def/Implementation/NavigationBar/NavigationBarClient.cs b/src/VisualStudio/Core/Def/Implementation/NavigationBar/NavigationBarClient.cs index 781b4bbc7e79b37a6f70f129d6ed0a7454b9a0ff..7a4660409e6dbc9b74a6aed76e1e8b2f735ae1c6 100644 --- a/src/VisualStudio/Core/Def/Implementation/NavigationBar/NavigationBarClient.cs +++ b/src/VisualStudio/Core/Def/Implementation/NavigationBar/NavigationBarClient.cs @@ -291,9 +291,8 @@ int IVsDropdownBarClient3.GetEntryImage(int iCombo, int iIndex, out int piImageI // represents. That way the icon will always look right no matter which type of project // it is. For example, if phone/Windows projects have different icons, then this can // ensure we get the right icon, and not just a hardcoded C#/VB icon. - if (item is NavigationBarProjectItem) + if (item is NavigationBarProjectItem projectItem) { - var projectItem = (NavigationBarProjectItem)item; if (_workspace.TryGetImageListAndIndex(_imageService, projectItem.DocumentId.ProjectId, out phImageList, out piImageIndex)) { return VSConstants.S_OK; diff --git a/src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs b/src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs index 4df6cea011287a260c305c2c145503102b0edb54..f524e6293b1626bc50c28823a6d03d8978066fbe 100644 --- a/src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs +++ b/src/VisualStudio/Core/Def/Implementation/Preview/FileChange.cs @@ -219,9 +219,9 @@ internal override void GetDisplayData(VSTREEDISPLAYDATA[] pData) // If these are documents from a VS workspace, then attempt to get the right display // data from the underlying VSHierarchy and itemids for the document. var workspace = document.Project.Solution.Workspace; - if (workspace is VisualStudioWorkspaceImpl) + if (workspace is VisualStudioWorkspaceImpl vsWorkspace) { - if (((VisualStudioWorkspaceImpl)workspace).TryGetImageListAndIndex(_imageService, document.Id, out pData[0].hImageList, out pData[0].Image)) + if (vsWorkspace.TryGetImageListAndIndex(_imageService, document.Id, out pData[0].hImageList, out pData[0].Image)) { pData[0].SelectedImage = pData[0].Image; return;