From 7ca8255d6f92470493cb24537967786d326acc78 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Thu, 24 Aug 2017 11:29:26 -0700 Subject: [PATCH] Add a default VS foregrounddispatcher --- .../VisualStudioForegroundDispatcher.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs diff --git a/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs b/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs new file mode 100644 index 0000000000..1a8ab11930 --- /dev/null +++ b/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioForegroundDispatcher.cs @@ -0,0 +1,14 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.ComponentModel.Composition; +using Microsoft.VisualStudio.Shell; + +namespace Microsoft.VisualStudio.LanguageServices.Razor +{ + [Export(typeof(ForegroundDispatcher))] + internal class VisualStudioForegroundDispatcher : ForegroundDispatcher + { + public override bool IsForegroundThread => ThreadHelper.CheckAccess(); + } +}