Skip to content

Commit dea8b89

Browse files
committed
Tweaked XML docs and comments
1 parent eef4d0a commit dea8b89

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Microsoft.Toolkit.Mvvm/Messaging/IMessenger.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ bool IsRegistered<TMessage, TToken>(object recipient, TToken token)
4343
/// <typeparam name="TToken">The type of token to use to pick the messages to receive.</typeparam>
4444
/// <param name="recipient">The recipient that will receive the messages.</param>
4545
/// <param name="token">A token used to determine the receiving channel to use.</param>
46-
/// <param name="action">The <see cref="MessageHandler{T}"/> to invoke when a message is received.</param>
46+
/// <param name="handler">The <see cref="MessageHandler{T}"/> to invoke when a message is received.</param>
4747
/// <exception cref="InvalidOperationException">Thrown when trying to register the same message twice.</exception>
48-
void Register<TMessage, TToken>(object recipient, TToken token, MessageHandler<TMessage> action)
48+
void Register<TMessage, TToken>(object recipient, TToken token, MessageHandler<TMessage> handler)
4949
where TMessage : class
5050
where TToken : IEquatable<TToken>;
5151

Microsoft.Toolkit.Mvvm/Messaging/Messenger.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace Microsoft.Toolkit.Mvvm.Messaging
3636
/// <code>
3737
/// Messenger.Default.Send&lt;LoginCompletedMessage&gt;();
3838
/// </code>
39-
/// Additionally, the method group syntax can also be used to specify the action
39+
/// Additionally, the method group syntax can also be used to specify the message handler
4040
/// to invoke when receiving a message, if a method with the right signature is available
4141
/// in the current scope. This is helpful to keep the registration and handling logic separate.
4242
/// Following up from the previous example, consider a class having this method:
@@ -137,7 +137,7 @@ public bool IsRegistered<TMessage, TToken>(object recipient, TToken token)
137137
}
138138

139139
/// <inheritdoc/>
140-
public void Register<TMessage, TToken>(object recipient, TToken token, MessageHandler<TMessage> action)
140+
public void Register<TMessage, TToken>(object recipient, TToken token, MessageHandler<TMessage> handler)
141141
where TMessage : class
142142
where TToken : IEquatable<TToken>
143143
{
@@ -151,14 +151,14 @@ public void Register<TMessage, TToken>(object recipient, TToken token, MessageHa
151151
map ??= new DictionarySlim<TToken, MessageHandler<TMessage>>();
152152

153153
// Add the new registration entry
154-
ref MessageHandler<TMessage>? handler = ref map.GetOrAddValueRef(token);
154+
ref MessageHandler<TMessage>? registeredHandler = ref map.GetOrAddValueRef(token);
155155

156-
if (!(handler is null))
156+
if (!(registeredHandler is null))
157157
{
158158
ThrowInvalidOperationExceptionForDuplicateRegistration();
159159
}
160160

161-
handler = action;
161+
registeredHandler = handler;
162162

163163
// Update the total counter for handlers for the current type parameters
164164
mapping.TotalHandlersCount++;
@@ -428,7 +428,7 @@ public unsafe TMessage Send<TMessage, TToken>(TMessage message, TToken token)
428428
// The array is oversized at this point, since it also includes
429429
// handlers for different tokens. We can reuse the same variable
430430
// to count the number of matching handlers to invoke later on.
431-
// This will be the array slice with valid actions in the rented buffer.
431+
// This will be the array slice with valid handler in the rented buffer.
432432
var mappingEnumerator = mapping!.GetEnumerator();
433433

434434
// Explicit enumerator usage here as we're using a custom one

0 commit comments

Comments
 (0)