Fix breaking change in MenuItemList

This commit is contained in:
Sebastiaan Janssen
2022-07-11 15:36:23 +02:00
parent 942c4b336d
commit 885ec99cc4

View File

@@ -24,6 +24,17 @@ public class MenuItemList : List<MenuItem>
: base(items) =>
_actionCollection = actionCollection;
/// <summary>
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="hasSeparator"></param>
/// <param name="textService">The <see cref="ILocalizedTextService" /> used to localize the action name based on its alias</param>
/// <param name="opensDialog">Whether or not this action opens a dialog</param>
/// <param name="useLegacyIcon">Whether or not this action should use legacy icon prefixed with "icon-" or full icon name is specified.</param>
public MenuItem? Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
where T : IAction => Add<T>(textService, hasSeparator, opensDialog, useLegacyIcon: true);
/// <summary>
/// Adds a menu item with a dictionary which is merged to the AdditionalData bag
/// </summary>
@@ -35,7 +46,7 @@ public class MenuItemList : List<MenuItem>
public MenuItem? Add<T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false, bool useLegacyIcon = true)
where T : IAction
{
var item = CreateMenuItem<T>(textService, hasSeparator, opensDialog);
MenuItem? item = CreateMenuItem<T>(textService, hasSeparator, opensDialog, useLegacyIcon);
if (item != null)
{
Add(item);