From ca47896204482bf4a6979e3838bf7f09f61cebeb Mon Sep 17 00:00:00 2001
From: giy <giy@omp-system.ru>
Date: Fri, 02 Sep 2022 14:16:56 +0300
Subject: [PATCH] Обновление до версии 2.9.0
---
QtVsTools.Core/VisualStudio/VsServiceProvider.cs | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/QtVsTools.Core/VisualStudio/VsServiceProvider.cs b/QtVsTools.Core/VisualStudio/VsServiceProvider.cs
index ed53ed5..d9060ed 100644
--- a/QtVsTools.Core/VisualStudio/VsServiceProvider.cs
+++ b/QtVsTools.Core/VisualStudio/VsServiceProvider.cs
@@ -26,7 +26,6 @@
**
****************************************************************************/
-using Microsoft.VisualStudio.Shell;
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
@@ -45,7 +44,7 @@
{
public static IVsServiceProvider Instance { get; set; }
- static ConcurrentDictionary<ServiceType, object> services
+ static readonly ConcurrentDictionary<ServiceType, object> services
= new ConcurrentDictionary<ServiceType, object>();
public static I GetService<I>()
@@ -61,8 +60,7 @@
if (Instance == null)
return null;
- object serviceObj;
- if (services.TryGetValue(new ServiceType(typeof(T), typeof(I)), out serviceObj))
+ if (services.TryGetValue(new ServiceType(typeof(T), typeof(I)), out object serviceObj))
return serviceObj as I;
var serviceInterface = Instance.GetService<T, I>();
@@ -83,8 +81,7 @@
if (Instance == null)
return null;
- object serviceObj;
- if (services.TryGetValue(new ServiceType(typeof(T), typeof(I)), out serviceObj))
+ if (services.TryGetValue(new ServiceType(typeof(T), typeof(I)), out object serviceObj))
return serviceObj as I;
var serviceInterface = await Instance.GetServiceAsync<T, I>();
--
Gitblit v1.9.1