Skip to content

Commit

Permalink
remove several runtime warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cabryant20 committed Oct 4, 2018
1 parent 345e99d commit b89a4c3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion iTraceVS/iTraceVS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<EmbedInteropTypes>True</EmbedInteropTypes>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>False</EmbedInteropTypes>
Expand Down
1 change: 1 addition & 0 deletions iTraceVS/itrace_windowCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static void Initialize(Package package)
/// <param name="e">The event args.</param>
private void ShowToolWindow(object sender, EventArgs e)
{
ThreadHelper.ThrowIfNotOnUIThread();
// Get the instance number 0 of this tool window. This window is single instance so this instance
// is actually the only one.
// The last flag is set to true so that if the tool window does not exists it will be created.
Expand Down
10 changes: 6 additions & 4 deletions iTraceVS/status_bar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.Windows.Threading;

Expand All @@ -14,9 +16,9 @@ class status_bar
//Must be created on UI Thread
public status_bar()
{
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
ThreadHelper.ThrowIfNotOnUIThread();
statusBar = (IVsStatusbar)itrace_windowCommand.Instance.ServiceProvider.GetService(typeof(SVsStatusbar));

Assumes.Present(statusBar);
statusBarRefreshTimer = new DispatcherTimer();
statusBarRefreshTimer.Tick += statusBarRefreshTimer_Tick;
statusBarRefreshTimer.Interval = TimeSpan.FromSeconds(1);
Expand All @@ -34,7 +36,7 @@ public void stopUpdating()

private void statusBarRefreshTimer_Tick(object sender, object e)
{
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
ThreadHelper.ThrowIfNotOnUIThread();

int frozen;

Expand Down
1 change: 1 addition & 0 deletions iTraceVS/xml_writer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static void writeResponse(Int64 sessionTime, double x, double y) {
}

static void getVSData(double x, double y) {
ThreadHelper.ThrowIfNotOnUIThread();
DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE;
//Var to print
String lineHeight = "", fontHeight = "", lineBaseX = "", lineBaseY = "";
Expand Down

0 comments on commit b89a4c3

Please sign in to comment.