aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-11 10:23:24 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-11 10:23:24 +0300
commitb21d8e7c164b63d14d15cfdf3dda68ae88a03043 (patch)
treed4df5ec93d5cc3011766470183a8a43a96439405 /Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs
parent6323ea8d74be3440286acaf73cab98024a858499 (diff)
downloadTango-b21d8e7c164b63d14d15cfdf3dda68ae88a03043.tar.gz
Tango-b21d8e7c164b63d14d15cfdf3dda68ae88a03043.zip
Code cleanup for warnings.
Diffstat (limited to 'Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs')
-rw-r--r--Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs
index b5e5dd0a0..50860cfa3 100644
--- a/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs
+++ b/Software/Visual_Studio/VSIX/Tango.BuildExtensions/VSIXBase.cs
@@ -134,6 +134,7 @@ namespace Tango.BuildExtensions
public void WriteToConsole(String text)
{
+ ThreadHelper.ThrowIfNotOnUIThread();
// Get the output window
var outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
@@ -199,9 +200,12 @@ namespace Tango.BuildExtensions
protected void OpenVSProgress(String title, String message, bool intermediate)
{
- Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(() =>
+#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
+ ThreadHelper.Generic.Invoke(() =>
+#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs
{
_vsProgress = null;
+ ThreadHelper.ThrowIfNotOnUIThread();
IVsThreadedWaitDialogFactory dialogFactory = BaseServiceProvider.GetService(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory;
dialogFactory.CreateInstance(out _vsProgress);
@@ -221,8 +225,11 @@ namespace Tango.BuildExtensions
protected void SetVSProgress(String message, String progressText = null, int current = 0, int total = 0)
{
- Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(() =>
+#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
+ ThreadHelper.Generic.Invoke(() =>
+#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs
{
+ ThreadHelper.ThrowIfNotOnUIThread();
bool c;
_vsProgress.UpdateProgress(message, progressText, null, current, total, true, out c);
});
@@ -230,7 +237,9 @@ namespace Tango.BuildExtensions
protected void CloseVSProgress()
{
- Microsoft.VisualStudio.Shell.ThreadHelper.Generic.Invoke(() =>
+#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
+ ThreadHelper.Generic.Invoke(() =>
+#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs
{
_vsProgress.EndWaitDialog();
});