예제 #1
0
        public PluginUIElementCommand(IPluginUIElement uiElement)
        {
            _uiElement = uiElement;

            Text       = _uiElement.Text;
            ImageLarge = _uiElement.Image;
            ImageSmall = _uiElement.Image;

            _uiElement.CommandExecuted += CommandExecuted;
            _uiElement.UIChanged       += UIChanged;
        }
예제 #2
0
        private KryptonCommand CreateCommandForPluginUIElement(IPluginUIElement uiElement)
        {
            KryptonCommand command;

            if (uiElement is IPluginCheckedUIElement)
            {
                command = new CheckedPluginUIElementCommand((IPluginCheckedUIElement)uiElement);
            }
            else
            {
                command = new PluginUIElementCommand(uiElement);
            }

            _uiElementsCommands.Add(uiElement.Id, command);

            return(command);
        }
예제 #3
0
 protected virtual void UIChanged(IPluginUIElement obj)
 {
     Enabled = _uiElement.Enabled;
     UpdateImage();
 }
예제 #4
0
 protected virtual void CommandExecuted(object sender, IPluginUIElement pluginUIElement)
 {
 }
 void OnCheckedChanged(IPluginUIElement obj)
 {
     Checked = _uiElement.Checked;
 }
예제 #6
0
 /// <summary>
 /// Raises CommandExecuted event
 /// </summary>
 /// <param name="sender">UI object assigned with this action</param>
 /// <param name="pluginUIElement">UI element</param>
 protected void RaiseCommandExecutedEvent(object sender, IPluginUIElement pluginUIElement)
 {
     CommandExecuted?.Invoke(sender, pluginUIElement);
 }