Change template for Check Parameter for Null

Hi

Is it possible to change the generated code for the Check Parameter for Null quick fix:

From      

if (a == null)
{
  throw new ArgumentNullException("a");
}


to

Args.NotNull(a, "a");

--Jakob
2 comments

Hi Jakob,

I can offer a suggestion that might get you close.  Create a structured pattern quick fix for

if(a==null) { throw new ArgumentNullException("a");} 

to

Args.NotNull(a, "a");


Then the combination of the two quick fixes will get you there.
Josh

0

Thanks for the suggestion.

If I decompile the assemblies, I can see that the code is hardcoded.

--Jakob

0

Please sign in to leave a comment.