mirror of https://github.com/abpframework/abp.git
9 changed files with 122 additions and 25 deletions
@ -0,0 +1,46 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using Volo.Abp.UI.Navigation; |
||||
|
|
||||
|
namespace Volo.Abp.Ui.Navigation |
||||
|
{ |
||||
|
public class ApplicationMenuItemList : List<ApplicationMenuItem> |
||||
|
{ |
||||
|
public ApplicationMenuItemList() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public ApplicationMenuItemList(int capacity) |
||||
|
: base(capacity) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public ApplicationMenuItemList(IEnumerable<ApplicationMenuItem> collection) |
||||
|
: base(collection) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void Normalize() |
||||
|
{ |
||||
|
RemoveEmptyItems(); |
||||
|
Order(); |
||||
|
} |
||||
|
|
||||
|
private void RemoveEmptyItems() |
||||
|
{ |
||||
|
RemoveAll(item => item.IsLeaf && item.Url.IsNullOrEmpty()); |
||||
|
} |
||||
|
|
||||
|
private void Order() |
||||
|
{ |
||||
|
//TODO: Is there any way that is more performant?
|
||||
|
var orderedItems = this.OrderBy(item => item.Order).ToArray(); |
||||
|
Clear(); |
||||
|
AddRange(orderedItems); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,14 +1,7 @@ |
|||||
using System; |
namespace Volo.Abp.SettingManagement.Web.Navigation |
||||
using System.Collections.Generic; |
|
||||
using System.Linq; |
|
||||
using System.Threading.Tasks; |
|
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Web.Navigation |
|
||||
{ |
{ |
||||
public class SettingManagementMenuNames |
public class SettingManagementMenuNames |
||||
{ |
{ |
||||
public const string GroupName = "SettingManagement"; |
public const string GroupName = "SettingManagement"; |
||||
|
|
||||
public const string Settings = GroupName + ".Settings"; |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue