// "Therefore those skilled at the unorthodox // are infinite as heaven and earth, // inexhaustible as the great rivers. // When they come to an end, // they begin again, // like the days and months; // they die and are reborn, // like the four seasons." // // - Sun Tsu, // "The Art of War" using System; using TheArtOfDev.HtmlRenderer.Adapters.Entities; namespace TheArtOfDev.HtmlRenderer.Adapters { /// /// Adapter for platform specific context menu - used to create and show context menu at specific location.
/// Not relevant for platforms that don't render HTML on UI element. ///
public abstract class RContextMenu : IDisposable { /// /// The total number of items in the context menu /// public abstract int ItemsCount { get; } /// /// Add divider item to the context menu.
/// The divider is a non clickable place holder used to separate items. ///
public abstract void AddDivider(); /// /// Add item to the context menu with the given text that will raise the given event when clicked. /// the text to set on the new context menu itemif to set the item as enabled or disabledthe event to raise when the item is clicked public abstract void AddItem(string text, bool enabled, EventHandler onClick); /// /// Remove the last item from the context menu iff it is a divider /// public abstract void RemoveLastDivider(); /// /// Show the context menu in the given parent control at the given location. /// the parent control to show inthe location to show at relative to the parent control public abstract void Show(RControl parent, RPoint location); /// /// /// public abstract void Dispose(); } }