UserMenu.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Collections.Generic;
  2. using Abp.Localization;
  3. namespace Abp.Application.Navigation
  4. {
  5. /// <summary>
  6. /// Represents a menu shown to the user.
  7. /// </summary>
  8. public class UserMenu
  9. {
  10. /// <summary>
  11. /// Unique name of the menu in the application.
  12. /// </summary>
  13. public string Name { get; set; }
  14. /// <summary>
  15. /// Display name of the menu.
  16. /// </summary>
  17. public string DisplayName { get; set; }
  18. /// <summary>
  19. /// A custom object related to this menu item.
  20. /// </summary>
  21. public object CustomData { get; set; }
  22. /// <summary>
  23. /// Menu items (first level).
  24. /// </summary>
  25. public IList<UserMenuItem> Items { get; set; }
  26. /// <summary>
  27. /// Creates a new <see cref="UserMenu"/> object.
  28. /// </summary>
  29. public UserMenu()
  30. {
  31. }
  32. /// <summary>
  33. /// Creates a new <see cref="UserMenu"/> object from given <see cref="MenuDefinition"/>.
  34. /// </summary>
  35. internal UserMenu(MenuDefinition menuDefinition, ILocalizationContext localizationContext)
  36. {
  37. Name = menuDefinition.Name;
  38. DisplayName = menuDefinition.DisplayName.Localize(localizationContext);
  39. CustomData = menuDefinition.CustomData;
  40. Items = new List<UserMenuItem>();
  41. }
  42. }
  43. }