Add XML documentation across gateway, worker, and .NET client

This commit is contained in:
Joseph Doherty
2026-04-30 11:49:58 -04:00
parent 4731ab535c
commit eed1e88a37
269 changed files with 4555 additions and 13 deletions
@@ -10,17 +10,20 @@ public sealed class MxAccessHandleRegistry
private readonly Dictionary<long, RegisteredItemHandle> itemHandles = new();
private readonly Dictionary<AdviceHandleKey, RegisteredAdviceHandle> adviceHandles = new();
/// <summary>Gets a read-only list of registered server handles ordered by handle value.</summary>
public IReadOnlyList<RegisteredServerHandle> ServerHandles => serverHandles
.Values
.OrderBy(handle => handle.ServerHandle)
.ToArray();
/// <summary>Gets a read-only list of registered item handles ordered by server handle then item handle.</summary>
public IReadOnlyList<RegisteredItemHandle> ItemHandles => itemHandles
.Values
.OrderBy(handle => handle.ServerHandle)
.ThenBy(handle => handle.ItemHandle)
.ToArray();
/// <summary>Gets a read-only list of registered advice handles ordered by server handle, item handle, and advice kind.</summary>
public IReadOnlyList<RegisteredAdviceHandle> AdviceHandles => adviceHandles
.Values
.OrderBy(handle => handle.ServerHandle)
@@ -28,6 +31,9 @@ public sealed class MxAccessHandleRegistry
.ThenBy(handle => handle.AdviceKind)
.ToArray();
/// <summary>Registers a server handle with the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="clientName">Display name of the client that owns the server handle.</param>
public void RegisterServerHandle(
int serverHandle,
string clientName)
@@ -35,6 +41,8 @@ public sealed class MxAccessHandleRegistry
serverHandles[serverHandle] = new RegisteredServerHandle(serverHandle, clientName);
}
/// <summary>Unregisters a server handle and all associated item and advice handles from the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
public void UnregisterServerHandle(int serverHandle)
{
serverHandles.Remove(serverHandle);
@@ -56,11 +64,19 @@ public sealed class MxAccessHandleRegistry
}
}
/// <summary>Checks if the registry contains the specified server handle.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
public bool ContainsServerHandle(int serverHandle)
{
return serverHandles.ContainsKey(serverHandle);
}
/// <summary>Registers an item handle with the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
/// <param name="itemDefinition">Item definition name from MXAccess.</param>
/// <param name="itemContext">Item context from MXAccess, or empty string if none.</param>
/// <param name="hasItemContext">True if the item has a context; false otherwise.</param>
public void RegisterItemHandle(
int serverHandle,
int itemHandle,
@@ -76,6 +92,9 @@ public sealed class MxAccessHandleRegistry
hasItemContext);
}
/// <summary>Removes an item handle and all associated advice handles from the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
public void RemoveItemHandle(
int serverHandle,
int itemHandle)
@@ -84,6 +103,9 @@ public sealed class MxAccessHandleRegistry
RemoveAdviceHandles(serverHandle, itemHandle);
}
/// <summary>Checks if the registry contains the specified item handle.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
public bool ContainsItemHandle(
int serverHandle,
int itemHandle)
@@ -91,6 +113,10 @@ public sealed class MxAccessHandleRegistry
return itemHandles.ContainsKey(CreateItemKey(serverHandle, itemHandle));
}
/// <summary>Registers an advice handle with the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
/// <param name="adviceKind">Type of advice to register.</param>
public void RegisterAdviceHandle(
int serverHandle,
int itemHandle,
@@ -103,6 +129,9 @@ public sealed class MxAccessHandleRegistry
adviceKind);
}
/// <summary>Removes all advice handles for the specified server and item handles from the registry.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
public void RemoveAdviceHandles(
int serverHandle,
int itemHandle)
@@ -116,6 +145,10 @@ public sealed class MxAccessHandleRegistry
}
}
/// <summary>Checks if the registry contains the specified advice handle.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
/// <param name="adviceKind">Type of advice to check.</param>
public bool ContainsAdviceHandle(
int serverHandle,
int itemHandle,
@@ -137,6 +170,10 @@ public sealed class MxAccessHandleRegistry
private readonly int itemHandle;
private readonly MxAccessAdviceKind adviceKind;
/// <summary>Initializes a new instance of the <see cref="AdviceHandleKey"/> struct.</summary>
/// <param name="serverHandle">Handle returned by the worker.</param>
/// <param name="itemHandle">Handle returned by the worker.</param>
/// <param name="adviceKind">Type of advice.</param>
public AdviceHandleKey(
int serverHandle,
int itemHandle,
@@ -147,6 +184,7 @@ public sealed class MxAccessHandleRegistry
this.adviceKind = adviceKind;
}
/// <inheritdoc />
public bool Equals(AdviceHandleKey other)
{
return serverHandle == other.serverHandle
@@ -154,11 +192,13 @@ public sealed class MxAccessHandleRegistry
&& adviceKind == other.adviceKind;
}
/// <inheritdoc />
public override bool Equals(object? obj)
{
return obj is AdviceHandleKey other && Equals(other);
}
/// <inheritdoc />
public override int GetHashCode()
{
unchecked