#region License // Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved. // This source code is made available under the terms of the GNU Lesser General Public License v3.0 // https://github.com/paulkohler/minisqlquery/blob/master/LICENSE #endregion using System.Drawing; using System.Windows.Forms; namespace MiniSqlQuery.Core { /// /// Represents a "command", typically a user action such as saving a file or executing a query. /// public interface ICommand { /// /// Gets a value indicating whether this is enabled. /// /// true if enabled; otherwise, false. bool Enabled { get; } /// /// Gets or sets the host, typically the button holding the command. /// /// The host control. object Host { get; set; } /// /// Gets the name of the command, used in menus and buttons. /// /// The name of the command. string Name { get; } /// /// Gets or sets a reference to the application services to allow access to the other components. /// /// A reference to the instance. IApplicationServices Services { get; set; } /// /// Gets or sets a reference to the application settings. /// /// The application settings. IApplicationSettings Settings { get; set; } /// /// Gets the menu shortcut keys for this command (e.g. Keys.F5). /// /// The shortcut keys for this command. Keys ShortcutKeys { get; } /// /// Gets the shortcut key text to be displayed as help. /// /// The shortcut keys text. string ShortcutKeysText { get; } /// /// Gets the "small image" associated with this control (for use on buttons or menu items). /// Use null (or Nothing in Visual Basic) if there is no image. /// /// The small image representing this command (or null for none). Image SmallImage { get; } /// /// Executes the command based on the current settings. /// /// /// If a commands value is false, a call to should have no effect /// (and not throw an exception). /// void Execute(); } }