Browse Source
Merge pull request #12150 from Lehonti/master
Changed null checks to make use of nameof()
pull/12177/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
10 additions and
10 deletions
-
src/Avalonia.Base/Threading/Dispatcher.Invoke.cs
-
src/Avalonia.Base/Threading/DispatcherTimer.cs
-
src/Avalonia.Controls.DataGrid/DataGridCheckBoxColumn.cs
-
src/Avalonia.Controls.DataGrid/DataGridColumnCollection.cs
-
src/Avalonia.Controls.DataGrid/DataGridLength.cs
-
src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs
|
|
|
@ -90,7 +90,7 @@ public partial class Dispatcher |
|
|
|
{ |
|
|
|
if (callback == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("callback"); |
|
|
|
throw new ArgumentNullException(nameof(callback)); |
|
|
|
} |
|
|
|
|
|
|
|
DispatcherPriority.Validate(priority, "priority"); |
|
|
|
@ -212,7 +212,7 @@ public partial class Dispatcher |
|
|
|
{ |
|
|
|
if (callback == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("callback"); |
|
|
|
throw new ArgumentNullException(nameof(callback)); |
|
|
|
} |
|
|
|
|
|
|
|
DispatcherPriority.Validate(priority, "priority"); |
|
|
|
@ -304,7 +304,7 @@ public partial class Dispatcher |
|
|
|
{ |
|
|
|
if (callback == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("callback"); |
|
|
|
throw new ArgumentNullException(nameof(callback)); |
|
|
|
} |
|
|
|
|
|
|
|
DispatcherPriority.Validate(priority, "priority"); |
|
|
|
@ -379,7 +379,7 @@ public partial class Dispatcher |
|
|
|
{ |
|
|
|
if (callback == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("callback"); |
|
|
|
throw new ArgumentNullException(nameof(callback)); |
|
|
|
} |
|
|
|
|
|
|
|
DispatcherPriority.Validate(priority, "priority"); |
|
|
|
|
|
|
|
@ -62,7 +62,7 @@ public partial class DispatcherTimer |
|
|
|
{ |
|
|
|
if (callback == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("callback"); |
|
|
|
throw new ArgumentNullException(nameof(callback)); |
|
|
|
} |
|
|
|
|
|
|
|
Tick += callback; |
|
|
|
@ -253,7 +253,7 @@ public partial class DispatcherTimer |
|
|
|
{ |
|
|
|
if (dispatcher == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("dispatcher"); |
|
|
|
throw new ArgumentNullException(nameof(dispatcher)); |
|
|
|
} |
|
|
|
|
|
|
|
DispatcherPriority.Validate(priority, "priority"); |
|
|
|
|
|
|
|
@ -222,7 +222,7 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
if (element == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("element"); |
|
|
|
throw new ArgumentNullException(nameof(element)); |
|
|
|
} |
|
|
|
if (element is CheckBox checkBox) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -191,7 +191,7 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
if (dataGridColumn == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("dataGridColumn"); |
|
|
|
throw new ArgumentNullException(nameof(dataGridColumn)); |
|
|
|
} |
|
|
|
|
|
|
|
int columnIndexWithFiller = columnIndex; |
|
|
|
|
|
|
|
@ -499,7 +499,7 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
if (destinationType == null) |
|
|
|
{ |
|
|
|
throw new ArgumentNullException("destinationType"); |
|
|
|
throw new ArgumentNullException(nameof(destinationType)); |
|
|
|
} |
|
|
|
if (destinationType != typeof(string)) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -18,7 +18,7 @@ namespace Avalonia.Automation.Peers |
|
|
|
|
|
|
|
public ControlAutomationPeer(Control owner) |
|
|
|
{ |
|
|
|
Owner = owner ?? throw new ArgumentNullException("owner"); |
|
|
|
Owner = owner ?? throw new ArgumentNullException(nameof(owner)); |
|
|
|
Initialize(); |
|
|
|
} |
|
|
|
|
|
|
|
|