Esempio n. 1
0
        void IKeyboardControl.Create(CommandKeyRef keyRef, CommandKey key)
        {
            ButtonManager manager;

            switch (key.CommandType)
            {
            case "Navigate":
                manager = NavigateCommandButtonManager.CreateInstance(_parent, key);
                break;

            case "Function":
                manager = FunctionCommandButtonManager.CreateInstance(_parent, key);
                break;

            case "Modifier":
                manager = ModifierCommandButtonManager.CreateInstance(_parent, key);
                break;

            case "Custom":
                manager = CustomCommandButtonManager.CreateInstance(_parent, key);
                break;

            default:
                throw new InvalidOperationException();
            }
            _parent.AddManager(this, keyRef, manager);
        }
        internal static FunctionCommandButtonManager CreateInstance(KeyboardControl parent, CommandKey key)
        {
            Debug.Assert(!key.Toggles);
            ButtonBase button  = new KeyboardButton();
            var        manager = new FunctionCommandButtonManager(parent, key, button);

            return(manager);
        }