Skip to content

Commit

Permalink
More uses of ArgumentOutOfRangeException throw helpers (dotnet#10423)
Browse files Browse the repository at this point in the history
  • Loading branch information
halgab authored Dec 28, 2023
1 parent 25fd629 commit b6b8611
Show file tree
Hide file tree
Showing 51 changed files with 139 additions and 924 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ namespace System.Windows.Forms;
{
private readonly int _count;

private Count(int count) => _count = count.OrThrowIfNegative();
private Count(int count)
{
ArgumentOutOfRangeException.ThrowIfNegative(count);
_count = count;
}

public static Count Zero { get; } = 0;
public static Count One { get; } = 1;
Expand Down
15 changes: 0 additions & 15 deletions src/System.Windows.Forms/src/Resources/SR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3462,9 +3462,6 @@ Stack trace where the illegal operation occurred was:
<data name="InvalidCrossThreadControlCall" xml:space="preserve">
<value>Action being performed on this control is being called from the wrong thread. Marshal to the correct thread using Control.Invoke or Control.BeginInvoke to perform this action.</value>
</data>
<data name="InvalidExBoundArgument" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. '{0}' should be greater than {2} and less than {3}.</value>
</data>
<data name="InvalidFileFormat" xml:space="preserve">
<value>File format is not valid.</value>
</data>
Expand All @@ -3474,18 +3471,6 @@ Stack trace where the illegal operation occurred was:
<data name="InvalidGDIHandle" xml:space="preserve">
<value>Win32 handle passed to {0} is not valid or is the wrong type.</value>
</data>
<data name="InvalidHighBoundArgument" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. '{0}' must be less than {2}.</value>
</data>
<data name="InvalidHighBoundArgumentEx" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. '{0}' must be less than or equal to {2}.</value>
</data>
<data name="InvalidLowBoundArgument" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. '{0}' must be greater than {2}.</value>
</data>
<data name="InvalidLowBoundArgumentEx" xml:space="preserve">
<value>Value of '{1}' is not valid for '{0}'. '{0}' must be greater than or equal to {2}.</value>
</data>
<data name="InvalidNullArgument" xml:space="preserve">
<value>Null is not a valid value for '{0}'.</value>
</data>
Expand Down
27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 1 addition & 26 deletions src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6b8611

Please sign in to comment.