docs(context): add missing documentation

This commit is contained in:
Anna 2021-04-30 15:12:20 -04:00
parent 90c91c09d4
commit a57af7413a
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
8 changed files with 52 additions and 1 deletions

View File

@ -1,6 +1,9 @@
using System;
namespace XivCommon.Functions.ContextMenu {
/// <summary>
/// The base class for context menu arguments
/// </summary>
public abstract class BaseContextMenuArgs {
/// <summary>
/// Pointer to the context menu addon.

View File

@ -78,8 +78,19 @@ namespace XivCommon.Functions.ContextMenu {
/// </summary>
public event ContextMenuOpenEventDelegate? OpenContextMenu;
/// <summary>
/// The delegate for inventory context menu events.
/// </summary>
public delegate void InventoryContextMenuOpenEventDelegate(InventoryContextMenuOpenArgs args);
/// <summary>
/// <para>
/// The event that is fired when an inventory context menu is being prepared for opening.
/// </para>
/// <para>
/// Requires the <see cref="Hooks.ContextMenu"/> hook to be enabled.
/// </para>
/// </summary>
public event InventoryContextMenuOpenEventDelegate? OpenInventoryContextMenu;
/// <summary>

View File

@ -36,7 +36,7 @@ namespace XivCommon.Functions.ContextMenu {
/// </summary>
/// <param name="name">the English name of the item, copied to other languages</param>
/// <param name="action">the action to perform on click</param>
public CustomContextMenuItem(string name, T action) {
internal CustomContextMenuItem(string name, T action) {
this.NameEnglish = name;
this.NameJapanese = name;
this.NameFrench = name;

View File

@ -1,6 +1,9 @@
using System;
namespace XivCommon.Functions.ContextMenu.Inventory {
/// <summary>
/// The base class for inventory context menu arguments
/// </summary>
public abstract class BaseInventoryContextMenuArgs {
/// <summary>
/// Pointer to the context menu addon.
@ -17,10 +20,19 @@ namespace XivCommon.Functions.ContextMenu.Inventory {
/// </summary>
public string? ParentAddonName { get; }
/// <summary>
/// The ID of the item this context menu is for.
/// </summary>
public uint ItemId { get; }
/// <summary>
/// The amount of the item this context menu is for.
/// </summary>
public uint ItemAmount { get; }
/// <summary>
/// If the item this context menu is for is high-quality.
/// </summary>
public bool ItemHq { get; }
internal BaseInventoryContextMenuArgs(IntPtr addon, IntPtr agent, string? parentAddonName, uint itemId, uint itemAmount, bool itemHq) {

View File

@ -1,5 +1,13 @@
namespace XivCommon.Functions.ContextMenu.Inventory {
/// <summary>
/// A custom context menu item for inventory items.
/// </summary>
public class InventoryContextMenuItem : CustomContextMenuItem<ContextMenu.InventoryContextMenuItemSelectedDelegate> {
/// <summary>
/// Create a new context menu item for inventory items.
/// </summary>
/// <param name="name">the English name of the item, copied to other languages</param>
/// <param name="action">the action to perform on click</param>
public InventoryContextMenuItem(string name, ContextMenu.InventoryContextMenuItemSelectedDelegate action) : base(name, action) {
}
}

View File

@ -1,6 +1,9 @@
using System;
namespace XivCommon.Functions.ContextMenu.Inventory {
/// <summary>
/// The arguments for when an inventory context menu item is selected
/// </summary>
public class InventoryContextMenuItemSelectedArgs : BaseInventoryContextMenuArgs {
internal InventoryContextMenuItemSelectedArgs(IntPtr addon, IntPtr agent, string? parentAddonName, uint itemId, uint itemAmount, bool itemHq) : base(addon, agent, parentAddonName, itemId, itemAmount, itemHq) {
}

View File

@ -2,6 +2,9 @@
using System.Collections.Generic;
namespace XivCommon.Functions.ContextMenu.Inventory {
/// <summary>
/// The arguments for when an inventory context menu is opened
/// </summary>
public class InventoryContextMenuOpenArgs : BaseInventoryContextMenuArgs {
/// <summary>
/// Context menu items in this menu.

View File

@ -1,5 +1,16 @@
namespace XivCommon.Functions.ContextMenu {
/// <summary>
/// A custom normal context menu item
/// </summary>
public class NormalContextMenuItem : CustomContextMenuItem<ContextMenu.ContextMenuItemSelectedDelegate> {
/// <summary>
/// Create a new custom context menu item.
/// </summary>
/// <summary>
/// Create a new context menu item for inventory items.
/// </summary>
/// <param name="name">the English name of the item, copied to other languages</param>
/// <param name="action">the action to perform on click</param>
public NormalContextMenuItem(string name, ContextMenu.ContextMenuItemSelectedDelegate action) : base(name, action) {
}
}