Skip to content

Commit f756897

Browse files
author
Dan Gidman
committed
Fixing a duplicate key exception, adding a preview of the tool
1 parent 0de0c62 commit f756897

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Prefix.VS-Ext.2015/TraceBrowserToolWindow.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@ internal void CreateHubspotConnection(string prefixEndpoint)
6868
{
6969
MyDispatcher.Invoke(delegate
7070
{
71-
Control.Model.Summaries.AddRange(a.ToDictionary(i => i.ID, i => new RequestSummaryVM(i)));
71+
foreach (var summary in a)
72+
{
73+
// prevent duplicate keys
74+
if (Control.Model.Summaries.ContainsKey(summary.ID) == false)
75+
{
76+
Control.Model.Summaries.Add(new KeyValuePair<string, RequestSummaryVM>(summary.ID,
77+
new RequestSummaryVM(summary)));
78+
}
79+
}
80+
7281
var list = Control.FindName("TraceList") as ListView;
7382
if (list == null) return;
7483
list.ScrollIntoView(list.Items.GetItemAt(list.Items.Count - 1));
259 KB
Loading

VSIX/Installs/PREFIX.2015.vsix

856 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)