RaUI/Source/ryControls/HtmlRenderer/Adapters/RContextMenu.cs
zilinsoft 3262955f2f ### 2023-11-07更新
------
#### RaUIV4    V4.0.2311.0701
- *.[全新]整合了MyDb、ryControls、MyDb_MySQL等dll文件到RaUI一个项目。
- *.[新增]新增ApkOp类,可以轻松获取APK信息。
- *.[新增]新增JsonExt扩展类,让Json操作更简单。
- *.[新增]新增WebP类,可以支持webp格式的图片。
- *.[改进]ryQuickSQL中的AddField方法改为自动替换已存在的同名值。
- *.[修复]ryQuickSQL中的AddFieldCalc方法无法正常计算的BUG。
2023-11-07 16:37:53 +08:00

54 lines
2.1 KiB
C#

// "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
{
/// <summary>
/// Adapter for platform specific context menu - used to create and show context menu at specific location.<br/>
/// Not relevant for platforms that don't render HTML on UI element.
/// </summary>
public abstract class RContextMenu : IDisposable
{
/// <summary>
/// The total number of items in the context menu
/// </summary>
public abstract int ItemsCount { get; }
/// <summary>
/// Add divider item to the context menu.<br />
/// The divider is a non clickable place holder used to separate items.
/// </summary>
public abstract void AddDivider();
/// <summary>
/// Add item to the context menu with the given text that will raise the given event when clicked.
/// </summary><param name="text">the text to set on the new context menu item</param><param name="enabled">if to set the item as enabled or disabled</param><param name="onClick">the event to raise when the item is clicked</param>
public abstract void AddItem(string text, bool enabled, EventHandler onClick);
/// <summary>
/// Remove the last item from the context menu iff it is a divider
/// </summary>
public abstract void RemoveLastDivider();
/// <summary>
/// Show the context menu in the given parent control at the given location.
/// </summary><param name="parent">the parent control to show in</param><param name="location">the location to show at relative to the parent control</param>
public abstract void Show(RControl parent, RPoint location);
/// <summary>
///
/// </summary>
public abstract void Dispose();
}
}