From bdb69deb66077865cfc5daeb27332deaa5c9c376 Mon Sep 17 00:00:00 2001 From: Stefan Negulescu Date: Fri, 5 Apr 2019 19:11:09 +0300 Subject: [PATCH] Use nameof in ArgumentNullException --- .../src/System/ComponentModel/Design/CodeMarkers.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/CodeMarkers.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/CodeMarkers.cs index 60c25b71b87..f85dcbc09ff 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/CodeMarkers.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/CodeMarkers.cs @@ -175,7 +175,7 @@ public bool CodeMarkerEx(int nTimerID, byte[] aBuff) // Check the arguments only after checking whether code markers are enabled // This allows the calling code to pass null value and avoid calculation of data if nothing is to be logged if (aBuff == null) - throw new ArgumentNullException("aBuff"); + throw new ArgumentNullException(nameof(aBuff)); try { @@ -236,7 +236,7 @@ public bool CodeMarkerEx(int nTimerID, string stringData) // Check the arguments only after checking whether code markers are enabled // This allows the calling code to pass null value and avoid calculation of data if nothing is to be logged if (stringData == null) - throw new ArgumentNullException("stringData"); + throw new ArgumentNullException(nameof(stringData)); try { @@ -328,7 +328,7 @@ private static bool UsePrivateCodeMarkers(string regRoot, RegistryView registryV { if (regRoot == null) { - throw new ArgumentNullException("regRoot"); + throw new ArgumentNullException(nameof(regRoot)); } // Reads the Performance subkey from the given registry key @@ -393,7 +393,7 @@ public bool InitPerformanceDll(int iApp, string strRegRoot, RegistryView registr if (strRegRoot == null) { - throw new ArgumentNullException("strRegRoot"); + throw new ArgumentNullException(nameof(strRegRoot)); } this.regroot = strRegRoot;