Skip to content

Commit fec4b22

Browse files
committed
Code refactoring (not a fan of StyleCop here)
1 parent c5a5d5d commit fec4b22

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Microsoft.Toolkit.Mvvm/ComponentModel/ObservableValidator.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,6 @@ private void ValidateProperty(object? value, string? propertyName)
253253
{
254254
if (propertyName is null)
255255
{
256-
static void ThrowArgumentNullExceptionForNullPropertyName()
257-
{
258-
throw new ArgumentNullException(nameof(propertyName), "The input property name cannot be null when validating a property");
259-
}
260-
261256
ThrowArgumentNullExceptionForNullPropertyName();
262257
}
263258

@@ -296,5 +291,15 @@ static void ThrowArgumentNullExceptionForNullPropertyName()
296291
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
297292
}
298293
}
294+
295+
#pragma warning disable SA1204
296+
/// <summary>
297+
/// Throws an <see cref="ArgumentNullException"/> when a property name given as input is <see langword="null"/>.
298+
/// </summary>
299+
private static void ThrowArgumentNullExceptionForNullPropertyName()
300+
{
301+
throw new ArgumentNullException("propertyName", "The input property name cannot be null when validating a property");
302+
}
303+
#pragma warning restore SA1204
299304
}
300305
}

0 commit comments

Comments
 (0)