@@ -36,7 +36,7 @@ namespace Microsoft.Toolkit.Mvvm.Messaging
36
36
/// <code>
37
37
/// Messenger.Default.Send<LoginCompletedMessage>();
38
38
/// </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
40
40
/// to invoke when receiving a message, if a method with the right signature is available
41
41
/// in the current scope. This is helpful to keep the registration and handling logic separate.
42
42
/// 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)
137
137
}
138
138
139
139
/// <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 )
141
141
where TMessage : class
142
142
where TToken : IEquatable < TToken >
143
143
{
@@ -151,14 +151,14 @@ public void Register<TMessage, TToken>(object recipient, TToken token, MessageHa
151
151
map ??= new DictionarySlim < TToken , MessageHandler < TMessage > > ( ) ;
152
152
153
153
// Add the new registration entry
154
- ref MessageHandler < TMessage > ? handler = ref map . GetOrAddValueRef ( token ) ;
154
+ ref MessageHandler < TMessage > ? registeredHandler = ref map . GetOrAddValueRef ( token ) ;
155
155
156
- if ( ! ( handler is null ) )
156
+ if ( ! ( registeredHandler is null ) )
157
157
{
158
158
ThrowInvalidOperationExceptionForDuplicateRegistration ( ) ;
159
159
}
160
160
161
- handler = action ;
161
+ registeredHandler = handler ;
162
162
163
163
// Update the total counter for handlers for the current type parameters
164
164
mapping . TotalHandlersCount ++ ;
@@ -428,7 +428,7 @@ public unsafe TMessage Send<TMessage, TToken>(TMessage message, TToken token)
428
428
// The array is oversized at this point, since it also includes
429
429
// handlers for different tokens. We can reuse the same variable
430
430
// 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.
432
432
var mappingEnumerator = mapping ! . GetEnumerator ( ) ;
433
433
434
434
// Explicit enumerator usage here as we're using a custom one
0 commit comments