Skip to content

Commit b89a4c3

Browse files
committed
remove several runtime warnings
1 parent 345e99d commit b89a4c3

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

iTraceVS/iTraceVS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
</ItemGroup>
106106
<ItemGroup>
107107
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
108-
<EmbedInteropTypes>True</EmbedInteropTypes>
108+
<EmbedInteropTypes>False</EmbedInteropTypes>
109109
</Reference>
110110
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
111111
<EmbedInteropTypes>False</EmbedInteropTypes>

iTraceVS/itrace_windowCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static void Initialize(Package package)
8585
/// <param name="e">The event args.</param>
8686
private void ShowToolWindow(object sender, EventArgs e)
8787
{
88+
ThreadHelper.ThrowIfNotOnUIThread();
8889
// Get the instance number 0 of this tool window. This window is single instance so this instance
8990
// is actually the only one.
9091
// The last flag is set to true so that if the tool window does not exists it will be created.

iTraceVS/status_bar.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using Microsoft.VisualStudio.Shell.Interop;
1+
using Microsoft;
2+
using Microsoft.VisualStudio.Shell;
3+
using Microsoft.VisualStudio.Shell.Interop;
24
using System;
35
using System.Windows.Threading;
46

@@ -14,9 +16,9 @@ class status_bar
1416
//Must be created on UI Thread
1517
public status_bar()
1618
{
17-
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
19+
ThreadHelper.ThrowIfNotOnUIThread();
1820
statusBar = (IVsStatusbar)itrace_windowCommand.Instance.ServiceProvider.GetService(typeof(SVsStatusbar));
19-
21+
Assumes.Present(statusBar);
2022
statusBarRefreshTimer = new DispatcherTimer();
2123
statusBarRefreshTimer.Tick += statusBarRefreshTimer_Tick;
2224
statusBarRefreshTimer.Interval = TimeSpan.FromSeconds(1);
@@ -34,7 +36,7 @@ public void stopUpdating()
3436

3537
private void statusBarRefreshTimer_Tick(object sender, object e)
3638
{
37-
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
39+
ThreadHelper.ThrowIfNotOnUIThread();
3840

3941
int frozen;
4042

iTraceVS/xml_writer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ public static void writeResponse(Int64 sessionTime, double x, double y) {
7878
}
7979

8080
static void getVSData(double x, double y) {
81+
ThreadHelper.ThrowIfNotOnUIThread();
8182
DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE;
8283
//Var to print
8384
String lineHeight = "", fontHeight = "", lineBaseX = "", lineBaseY = "";

0 commit comments

Comments
 (0)