Ejemplo n.º 1
0
 /// <summary>
 /// 菜单是否包含指定标识
 /// </summary>
 /// <param name="flag"></param>
 /// <returns></returns>
 public bool HasFlag(MenuFlag flag)
 {
     if (this.Flags == null)
     {
         return(false);
     }
     return(this.Flags.Contains((int)flag));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create only one of these per mod. Automatically attaches to parent lists.
 /// </summary>
 /// <param name="Text">Text displayed in the root menu list</param>
 /// <param name="AttachedMenu">Which menu to attach to, either Player or Admin menus. </param>
 /// <param name="HeaderText">Header text of this menu list.</param>
 public MenuRootCategory(string Text, MenuFlag AttachedMenu = MenuFlag.None, string HeaderText = "Default Header")
 {
     Instance.RegisterCheck();
     BackingObject = Instance.CreateMessage(MessageTypes.MenuRootCategory);
     this.Text     = Text;
     Header        = HeaderText;
     Menu          = AttachedMenu;
 }
Ejemplo n.º 3
0
        //create menu with parameters
        public Dictionary <int, Menu> Create(Menu left, MenuFlag flag)
        {
            Dictionary <int, Menu> newDict = new Dictionary <int, Menu>();
            var menuCreate = from i in left.listMenu
                             where i.Value.FlagMenu.Equals(flag) || i.Value.FlagMenu.Equals(MenuFlag.All)
                             select i;

            foreach (var item in menuCreate)
            {
                newDict.Add(item.Key, item.Value);
                Console.WriteLine(item.Value);
            }
            return(newDict);
        }
Ejemplo n.º 4
0
 //reload const
 public Menu(string name, double price, DishType type, MenuFlag flag) : base(name, price, type)
 {
     FlagMenu = flag;
 }
Ejemplo n.º 5
0
 //default const
 public Menu() : base()
 {
     FlagMenu = MenuFlag.All;
 }
Ejemplo n.º 6
0
 private static extern bool CheckMenuItem(IntPtr menuHandle, uint itemdId, MenuFlag flags);
Ejemplo n.º 7
0
 public static extern bool InsertMenu(IntPtr menuHandle, uint itemId, MenuFlag flags, IntPtr commandId, string caption);
Ejemplo n.º 8
0
 private static extern bool DeleteMenu(IntPtr menuHandle, uint itemId, MenuFlag flags);
Ejemplo n.º 9
0
 private static extern bool SetMenuItemBitmaps(IntPtr menuHandle, uint itemdId, MenuFlag flags, IntPtr uncheckedBitmapHandle, IntPtr checkedBitmapHandle);
Ejemplo n.º 10
0
		private static extern bool SetMenuItemBitmaps(IntPtr menuHandle, uint itemdId, MenuFlag flags, IntPtr uncheckedBitmapHandle, IntPtr checkedBitmapHandle);
Ejemplo n.º 11
0
		private static extern bool EnableMenuItem(IntPtr menuHandle, uint itemdId, MenuFlag flags);
Ejemplo n.º 12
0
		private static extern bool DeleteMenu(IntPtr menuHandle, uint itemId, MenuFlag flags);
Ejemplo n.º 13
0
		public static extern bool InsertMenu(IntPtr menuHandle, uint itemId, MenuFlag flags, IntPtr commandId, string caption);