VisualStudioNavigateToPreviewServiceFactory.cs 1.1 KB
Newer Older
J
Jonathon Marolf 已提交
1 2 3
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
4 5 6 7 8 9 10 11 12 13 14 15 16

using System;
using System.Composition;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Implementation.NavigateTo;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.NavigateTo
{
    [ExportWorkspaceServiceFactory(typeof(INavigateToPreviewService), ServiceLayer.Host), Shared]
    internal sealed class VisualStudioNavigateToPreviewServiceFactory : IWorkspaceServiceFactory
    {
C
Cyrus Najmabadi 已提交
17
        private readonly Lazy<INavigateToPreviewService> _singleton =
18
            new(() => new VisualStudioNavigateToPreviewService());
19

20
        [ImportingConstructor]
21
        [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
22 23 24 25
        public VisualStudioNavigateToPreviewServiceFactory()
        {
        }

26
        public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
27
            => _singleton.Value;
28 29
    }
}