Skip to content

Commit c4a89d7

Browse files
committed
fixed double-handling of CommandBarButton clicks
1 parent 988076f commit c4a89d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RetailCoder.VBE/UI/Command/MenuItems/ParentMenus/ParentMenuItemBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ private ICommandBarControl InitializeChildControl(ICommandMenuItem item)
163163
}
164164

165165
// note: HAAAAACK!!!
166-
private static int _lastHashCode;
166+
private static int? _lastHashCode;
167167

168168
private void child_Click(object sender, CommandBarButtonClickEventArgs e)
169169
{
170170
var item = _items.Select(kvp => kvp.Key).SingleOrDefault(menu => menu.GetType().FullName == e.Control.Tag) as ICommandMenuItem;
171-
if (item == null || e.Control.Target.GetHashCode() == _lastHashCode)
171+
if (item == null || (_lastHashCode.HasValue && e.Control.Target.GetHashCode() != _lastHashCode.Value))
172172
{
173173
return;
174174
}

0 commit comments

Comments
 (0)