mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 20:03:41 +01:00
Use EnumerateInvocationList instead of GetInvocationList (#2303)
This commit is contained in:
parent
13306e24ba
commit
03e728e129
24 changed files with 402 additions and 294 deletions
|
|
@ -184,8 +184,18 @@ internal partial class ConsoleManager : IServiceType
|
|||
/// <returns>Whether the command was successfully processed.</returns>
|
||||
public bool ProcessCommand(string command)
|
||||
{
|
||||
if (this.Invoke?.Invoke(command) == true)
|
||||
return true;
|
||||
foreach (var action in Delegate.EnumerateInvocationList(this.Invoke))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (action(command))
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Exception during raise of {handler}", action.Method);
|
||||
}
|
||||
}
|
||||
|
||||
var matches = GetCommandParsingRegex().Matches(command);
|
||||
if (matches.Count == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue