From 27a3f7ff41a62c683b7920be17f1cee4bfd4f0db Mon Sep 17 00:00:00 2001 From: Ronny Klier Date: Tue, 5 Jun 2012 23:56:26 +0200 Subject: [PATCH] Don't add seperator after first context menu entry --- ILSpy/ContextMenuEntry.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ILSpy/ContextMenuEntry.cs b/ILSpy/ContextMenuEntry.cs index df64b4046..0f47af847 100644 --- a/ILSpy/ContextMenuEntry.cs +++ b/ILSpy/ContextMenuEntry.cs @@ -159,11 +159,11 @@ namespace ICSharpCode.ILSpy { menu = new ContextMenu(); foreach (var category in entries.OrderBy(c => c.Metadata.Order).GroupBy(c => c.Metadata.Category)) { - bool needSeparatorForCategory = true; + bool needSeparatorForCategory = menu.Items.Count > 0; foreach (var entryPair in category) { IContextMenuEntry entry = entryPair.Value; if (entry.IsVisible(context)) { - if (needSeparatorForCategory && menu.Items.Count > 0) { + if (needSeparatorForCategory) { menu.Items.Add(new Separator()); needSeparatorForCategory = false; }