Пример #1
0
        public bool IsKeyPressed(ConsoleKey key, UIManager.FocusableWindows type)
        {
            if (Input.Key == key && UIManager.CurrentlyFocused == type)
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        // Show bindings based on the parameters passed
        public void FilterBindings(Bindings bindings, UIManager.FocusableWindows type)
        {
            int y = Y;
            // Create a filtered list that only contains the passed enumerator
            List <Bindings> filteredBindings = bindings._bindings.Where(b => b.Type == type).ToList();

            for (int i = 0; i < filteredBindings.Count(); i++)
            {
                if (filteredBindings[i].Type == type)
                {
                    Print(0, y, filteredBindings[i].PrintBinding());
                }

                y++;
            }
        }
Пример #3
0
 public void ArrowSelection(UIManager.FocusableWindows type)
 {
     if (UIManager.CurrentlyFocused == type)
     {
         if (IsKeyPressed(ConsoleKey.UpArrow))
         {
             if (Selection > 0)
             {
                 Selection--;
             }
         }
         if (IsKeyPressed(ConsoleKey.DownArrow))
         {
             Selection++;
         }
     }
 }
Пример #4
0
        public void AddBinding(string sid, char keybind, string name, bool isVisible, UIManager.FocusableWindows type)
        {
            Bindings binding = new Bindings();

            binding.SID       = sid;
            binding.Keybind   = keybind;
            binding.Name      = name;
            binding.IsVisible = isVisible;
            binding.Type      = type;

            _bindings.Add(binding);
        }