Наша сборка Qt VS Tools
giy
2022-09-02 ca47896204482bf4a6979e3838bf7f09f61cebeb
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>();