MenuItem.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. [AttributeUsage(AttributeTargets.Method)]
  6. public sealed class MenuItem : Attribute
  7. {
  8. public MenuItem(string path, ButtonModifier shortcutModifier, ButtonCode shortcutKey, int priority = 0,
  9. bool separator = false, string contextCallback = null)
  10. {
  11. this.path = path;
  12. this.shortcut = new ShortcutKey(shortcutModifier, shortcutKey);
  13. this.priority = priority;
  14. this.separator = separator;
  15. this.contextCallback = contextCallback;
  16. }
  17. public MenuItem(string path, int priority = 0, bool separator = false, string contextCallback = null)
  18. {
  19. this.path = path;
  20. this.priority = priority;
  21. this.separator = separator;
  22. this.contextCallback = contextCallback;
  23. }
  24. private string path;
  25. private ShortcutKey shortcut;
  26. private int priority;
  27. private bool separator;
  28. private string contextCallback;
  29. }
  30. }