From 57557caa23aafad95421d882d6b2f6bc72109a9c Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:08:14 +0100 Subject: [PATCH 1/7] get rid of SR.ParameterMustBeGreaterThanZero --- .../internal/TextFormatting/FullTextLine.cs | 7 ++----- .../internal/TextFormatting/SimpleTextLine.cs | 5 +---- .../TextFormatting/TextRunCacheImp.cs | 5 +---- .../PresentationCore/Resources/Strings.resx | 3 --- .../Resources/xlf/Strings.cs.xlf | 7 +------ .../Resources/xlf/Strings.de.xlf | 7 +------ .../Resources/xlf/Strings.es.xlf | 7 +------ .../Resources/xlf/Strings.fr.xlf | 7 +------ .../Resources/xlf/Strings.it.xlf | 7 +------ .../Resources/xlf/Strings.ja.xlf | 7 +------ .../Resources/xlf/Strings.ko.xlf | 7 +------ .../Resources/xlf/Strings.pl.xlf | 7 +------ .../Resources/xlf/Strings.pt-BR.xlf | 7 +------ .../Resources/xlf/Strings.ru.xlf | 7 +------ .../Resources/xlf/Strings.tr.xlf | 7 +------ .../Resources/xlf/Strings.zh-Hans.xlf | 7 +------ .../Resources/xlf/Strings.zh-Hant.xlf | 7 +------ .../System/Windows/InterOp/D3DImage.cs | 13 +++--------- .../System/Windows/Media/FormattedText.cs | 6 ++---- .../Media/Imaging/BitmapSizeOptions.cs | 21 ++++--------------- .../Windows/Media/Imaging/BitmapSource.cs | 3 +-- .../Media/Imaging/InteropBitmapSource.cs | 11 ++-------- .../Media/Imaging/RenderTargetBitmap.cs | 11 ++-------- .../Media/textformatting/TextCharacters.cs | 13 +++--------- .../Media/textformatting/TextEndOfLine.cs | 3 +-- .../Media/textformatting/TextEndOfSegment.cs | 3 +-- .../Media/textformatting/TextHidden.cs | 5 +---- 27 files changed, 37 insertions(+), 163 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/FullTextLine.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/FullTextLine.cs index c8f23183e24..66c76a84158 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/FullTextLine.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/FullTextLine.cs @@ -1498,12 +1498,9 @@ int textLength throw new ObjectDisposedException(SR.TextLineHasBeenDisposed); } - if(textLength == 0) - { - throw new ArgumentOutOfRangeException("textLength", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfZero(textLength); - if(textLength < 0) + if (textLength < 0) { firstTextSourceCharacterIndex += textLength; textLength = -textLength; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/SimpleTextLine.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/SimpleTextLine.cs index f86ec903113..d786414d092 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/SimpleTextLine.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/SimpleTextLine.cs @@ -807,10 +807,7 @@ public override IList GetTextBounds( int textLength ) { - if (textLength == 0) - { - throw new ArgumentOutOfRangeException("textLength", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfZero(textLength); if (textLength < 0) { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextRunCacheImp.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextRunCacheImp.cs index d0db716c9eb..92e5155604c 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextRunCacheImp.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextRunCacheImp.cs @@ -118,10 +118,7 @@ out int runLength textRun = settings.TextSource.GetTextRun(cpFetch); - if (textRun.Length < 1) - { - throw new ArgumentOutOfRangeException("textRun.Length", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(textRun.Length, "textRun.Length"); Plsrun plsrun = TextRunInfo.GetRunType(textRun); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index 1bf23debef8..884109709c0 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1834,9 +1834,6 @@ The parameter value must be between '{0}' and '{1}'. - - The parameter value must be greater than zero. - The parameter value must be finite. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index de9da8bc47c..3725e4bd57f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2542,11 +2542,6 @@ Hodnota tohoto parametru musí být v rozsahu od {0} do {1}. - - The parameter value must be greater than zero. - Hodnota tohoto parametru musí být větší než nula. - - The parameter value must be finite. Hodnota tohoto parametru nesmí být nekonečno. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index c48bf7d269f..4a51df17058 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2542,11 +2542,6 @@ Der Parameterwert muss zwischen "{0}" und "{1}" liegen. - - The parameter value must be greater than zero. - Der Parameterwert muss größer Null sein. - - The parameter value must be finite. Der Parameterwert muss endlich sein. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index 0a19432612c..2dcff01957d 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2542,11 +2542,6 @@ El valor del parámetro debe estar comprendido entre "{0}" y "{1}". - - The parameter value must be greater than zero. - El valor del parámetro debe ser mayor que cero. - - The parameter value must be finite. El valor del parámetro debe ser finito. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index 62edc0824f9..4fcabed9599 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2542,11 +2542,6 @@ La valeur du paramètre doit être comprise entre '{0}' et '{1}'. - - The parameter value must be greater than zero. - La valeur du paramètre doit être supérieure à zéro. - - The parameter value must be finite. La valeur du paramètre doit être finie. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index 32b773a7589..32469a6b755 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2542,11 +2542,6 @@ Il valore del parametro deve essere compreso tra '{0}' e '{1}'. - - The parameter value must be greater than zero. - Il valore del parametro deve essere maggiore di zero. - - The parameter value must be finite. Il valore del parametro deve essere finito. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index 79988770f26..0971412f68a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2542,11 +2542,6 @@ パラメーター値は、'{0}' と '{1}' の間である必要があります。 - - The parameter value must be greater than zero. - パラメーター値は、0 より大きい必要があります。 - - The parameter value must be finite. パラメーター値は、有限である必要があります。 @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index bc20536905e..13fca4f8d61 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2542,11 +2542,6 @@ 매개 변수 값은 '{0}'과(와) '{1}' 사이에 있어야 합니다. - - The parameter value must be greater than zero. - 매개 변수 값은 0보다 커야 합니다. - - The parameter value must be finite. 매개 변수는 유한한 값이어야 합니다. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index ae9b7c2b39a..594cba579ec 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2542,11 +2542,6 @@ Wartość parametru musi należeć do przedziału od „{0}” do „{1}”. - - The parameter value must be greater than zero. - Wartość parametru musi być większa od zera. - - The parameter value must be finite. Wartość parametru musi być skończona. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index 1ad18078812..1c51216d186 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2542,11 +2542,6 @@ O valor do parâmetro precisa estar entre '{0}' e '{1}'. - - The parameter value must be greater than zero. - O valor do parâmetro deve ser maior que zero. - - The parameter value must be finite. O valor do parâmetro deve ser finito. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index 825628fb7fe..8f583500704 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2542,11 +2542,6 @@ Параметр должен принимать значения от "{0}" до "{1}". - - The parameter value must be greater than zero. - Значение параметра должно быть больше 0. - - The parameter value must be finite. Значение параметра должно быть конечным. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index d8020393543..f4ef2395760 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2542,11 +2542,6 @@ Parametre değeri '{0}' ile '{1}' arasında olmalıdır. - - The parameter value must be greater than zero. - Parametre değeri sıfırdan büyük olmalıdır. - - The parameter value must be finite. Parametre değeri sonlu olmalıdır. @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index 43a992c0502..3d1ba2f33db 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2542,11 +2542,6 @@ 参数值必须介于“{0}”到“{1}”之间。 - - The parameter value must be greater than zero. - 参数值必须大于零。 - - The parameter value must be finite. 参数值必须有限。 @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 1e3b392a2ae..76414c9f948 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2542,11 +2542,6 @@ 參數值必須介於 '{0}' 到 '{1}' 之間。 - - The parameter value must be greater than zero. - 參數值必須大於零。 - - The parameter value must be finite. 參數值必須有限制。 @@ -3619,4 +3614,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/D3DImage.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/D3DImage.cs index dca515e49d5..445bdbcdd4b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/D3DImage.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/D3DImage.cs @@ -67,17 +67,10 @@ public D3DImage() : this(96.0, 96.0) /// public D3DImage(double dpiX, double dpiY) { - - if (dpiX < 0) - { - throw new ArgumentOutOfRangeException("dpiX", SR.ParameterMustBeGreaterThanZero); - } - if (dpiY < 0) - { - throw new ArgumentOutOfRangeException("dpiY", SR.ParameterMustBeGreaterThanZero); - } - + ArgumentOutOfRangeException.ThrowIfNegative(dpiX); + ArgumentOutOfRangeException.ThrowIfNegative(dpiY); + _canWriteEvent = new ManualResetEvent(true); _availableCallback = Callback; _sendPresentDelegate = SendPresent; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs index fe13abbf163..776fbfe759f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs @@ -290,8 +290,7 @@ private static void ValidateCulture(CultureInfo culture) private static void ValidateFontSize(double emSize) { - if (emSize <= 0) - throw new ArgumentOutOfRangeException("emSize", SR.ParameterMustBeGreaterThanZero); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(emSize); if (emSize > MaxFontEmSize) throw new ArgumentOutOfRangeException("emSize", SR.Format(SR.ParameterCannotBeGreaterThan, MaxFontEmSize)); @@ -1376,8 +1375,7 @@ public int MaxLineCount { set { - if (value <= 0) - throw new ArgumentOutOfRangeException("value", SR.ParameterMustBeGreaterThanZero); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(value); _maxLineCount = value; InvalidateMetrics(); } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSizeOptions.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSizeOptions.cs index 7f54f22a319..667743a62c5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSizeOptions.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSizeOptions.cs @@ -117,10 +117,7 @@ public static BitmapSizeOptions FromEmptyOptions() /// Height of the resulting Bitmap public static BitmapSizeOptions FromHeight(int pixelHeight) { - if (pixelHeight <= 0) - { - throw new System.ArgumentOutOfRangeException("pixelHeight", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelHeight); BitmapSizeOptions sizeOptions = new BitmapSizeOptions(); @@ -138,10 +135,7 @@ public static BitmapSizeOptions FromHeight(int pixelHeight) /// Width of the resulting Bitmap public static BitmapSizeOptions FromWidth(int pixelWidth) { - if (pixelWidth <= 0) - { - throw new System.ArgumentOutOfRangeException("pixelWidth", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelWidth); BitmapSizeOptions sizeOptions = new BitmapSizeOptions(); @@ -161,15 +155,8 @@ public static BitmapSizeOptions FromWidth(int pixelWidth) /// Height of the resulting Bitmap public static BitmapSizeOptions FromWidthAndHeight(int pixelWidth, int pixelHeight) { - if (pixelWidth <= 0) - { - throw new System.ArgumentOutOfRangeException("pixelWidth", SR.ParameterMustBeGreaterThanZero); - } - - if (pixelHeight <= 0) - { - throw new System.ArgumentOutOfRangeException("pixelHeight", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelWidth); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelHeight); BitmapSizeOptions sizeOptions = new BitmapSizeOptions(); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs index ef27321b89b..cc75b26f4a4 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs @@ -730,8 +730,7 @@ internal void CriticalCopyPixels(Int32Rect sourceRect, IntPtr buffer, int buffer if (buffer == IntPtr.Zero) throw new ArgumentNullException("buffer"); - if (stride <= 0) - throw new ArgumentOutOfRangeException("stride", SR.ParameterMustBeGreaterThanZero); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(stride); if (sourceRect.Width <= 0) sourceRect.Width = PixelWidth; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/InteropBitmapSource.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/InteropBitmapSource.cs index 8b662538c75..69a807928b5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/InteropBitmapSource.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/InteropBitmapSource.cs @@ -126,15 +126,8 @@ internal InteropBitmap( { _bitmapInit.BeginInit(); - if (pixelWidth <= 0) - { - throw new ArgumentOutOfRangeException("pixelWidth", SR.ParameterMustBeGreaterThanZero); - } - - if (pixelHeight <= 0) - { - throw new ArgumentOutOfRangeException("pixelHeight", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelWidth); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelHeight); Guid formatGuid = format.Guid; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/RenderTargetBitmap.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/RenderTargetBitmap.cs index 19def24cdac..52d6c410d3b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/RenderTargetBitmap.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/RenderTargetBitmap.cs @@ -61,15 +61,8 @@ PixelFormat pixelFormat ); } - if (pixelWidth <= 0) - { - throw new ArgumentOutOfRangeException("pixelWidth", SR.ParameterMustBeGreaterThanZero); - } - - if (pixelHeight <= 0) - { - throw new ArgumentOutOfRangeException("pixelHeight", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelWidth); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(pixelHeight); if (dpiX < DoubleUtil.DBL_EPSILON) { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextCharacters.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextCharacters.cs index 19945d744ca..90d19a3b39f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextCharacters.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextCharacters.cs @@ -115,12 +115,8 @@ private TextCharacters( int length, TextRunProperties textRunProperties ) - { - if (length <= 0) - { - throw new ArgumentOutOfRangeException("length", SR.ParameterMustBeGreaterThanZero); - } - + { + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); ArgumentNullException.ThrowIfNull(textRunProperties); if (textRunProperties.Typeface == null) @@ -133,10 +129,7 @@ TextRunProperties textRunProperties throw new ArgumentNullException("textRunProperties.CultureInfo"); } - if (textRunProperties.FontRenderingEmSize <= 0) - { - throw new ArgumentOutOfRangeException("textRunProperties.FontRenderingEmSize", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(textRunProperties.FontRenderingEmSize, "textRunProperties.FontRenderingEmSize"); _characterBufferReference = characterBufferReference; _length = length; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfLine.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfLine.cs index d7ce8736e23..828db4da5d6 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfLine.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfLine.cs @@ -48,8 +48,7 @@ public TextEndOfLine( TextRunProperties textRunProperties ) { - if (length <= 0) - throw new ArgumentOutOfRangeException("length", SR.ParameterMustBeGreaterThanZero); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); if (textRunProperties != null && textRunProperties.Typeface == null) throw new ArgumentNullException("textRunProperties.Typeface"); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfSegment.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfSegment.cs index da2b36065ad..dc7ee9e86a5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfSegment.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextEndOfSegment.cs @@ -37,8 +37,7 @@ public class TextEndOfSegment : TextRun /// number of characters public TextEndOfSegment(int length) { - if (length <= 0) - throw new ArgumentOutOfRangeException("length", SR.ParameterMustBeGreaterThanZero); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); _length = length; } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextHidden.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextHidden.cs index be5399bfe24..0a78596c37c 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextHidden.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextHidden.cs @@ -38,10 +38,7 @@ public TextHidden( int length ) { - if (length <= 0) - { - throw new ArgumentOutOfRangeException("length", SR.ParameterMustBeGreaterThanZero); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); _length = length; } From 02e0b7dc29f8b060a0dd470e61f30f9b63347461 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:26:04 +0100 Subject: [PATCH 2/7] get rid of SR.ParameterCannotBeNegative --- .../TextFormatting/TextFormatterImp.cs | 5 +--- .../PresentationCore/Resources/Strings.resx | 3 -- .../Resources/xlf/Strings.cs.xlf | 5 ---- .../Resources/xlf/Strings.de.xlf | 5 ---- .../Resources/xlf/Strings.es.xlf | 5 ---- .../Resources/xlf/Strings.fr.xlf | 5 ---- .../Resources/xlf/Strings.it.xlf | 5 ---- .../Resources/xlf/Strings.ja.xlf | 5 ---- .../Resources/xlf/Strings.ko.xlf | 5 ---- .../Resources/xlf/Strings.pl.xlf | 5 ---- .../Resources/xlf/Strings.pt-BR.xlf | 5 ---- .../Resources/xlf/Strings.ru.xlf | 5 ---- .../Resources/xlf/Strings.tr.xlf | 5 ---- .../Resources/xlf/Strings.zh-Hans.xlf | 5 ---- .../Resources/xlf/Strings.zh-Hant.xlf | 5 ---- .../System/Windows/Media/FormattedText.cs | 6 ++-- .../Windows/Media/Imaging/WriteableBitmap.cs | 28 +++++++------------ .../System/Windows/Media/TextEffect.cs | 5 +--- .../CharacterBufferReference.cs | 5 +--- .../Media/textformatting/CharacterString.cs | 5 +--- .../Resources/Strings.resx | 3 -- .../Resources/xlf/Strings.cs.xlf | 7 +---- .../Resources/xlf/Strings.de.xlf | 7 +---- .../Resources/xlf/Strings.es.xlf | 7 +---- .../Resources/xlf/Strings.fr.xlf | 7 +---- .../Resources/xlf/Strings.it.xlf | 7 +---- .../Resources/xlf/Strings.ja.xlf | 7 +---- .../Resources/xlf/Strings.ko.xlf | 7 +---- .../Resources/xlf/Strings.pl.xlf | 7 +---- .../Resources/xlf/Strings.pt-BR.xlf | 7 +---- .../Resources/xlf/Strings.ru.xlf | 7 +---- .../Resources/xlf/Strings.tr.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hans.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hant.xlf | 7 +---- .../System/Windows/Controls/PasswordBox.cs | 11 ++------ .../System/Windows/Controls/TextBox.cs | 21 +++----------- .../Localizer/BamlLocalizationDictionary.cs | 9 +----- .../src/System.Xaml/Resources/Strings.resx | 3 -- .../System.Xaml/Resources/xlf/Strings.cs.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.de.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.es.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.fr.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.it.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.ja.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.ko.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.pl.xlf | 7 +---- .../Resources/xlf/Strings.pt-BR.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.ru.xlf | 7 +---- .../System.Xaml/Resources/xlf/Strings.tr.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hans.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hant.xlf | 7 +---- .../src/WindowsBase/Resources/Strings.resx | 5 +--- .../WindowsBase/Resources/xlf/Strings.cs.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.de.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.es.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.fr.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.it.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.ja.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.ko.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.pl.xlf | 7 +---- .../Resources/xlf/Strings.pt-BR.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.ru.xlf | 7 +---- .../WindowsBase/Resources/xlf/Strings.tr.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hans.xlf | 7 +---- .../Resources/xlf/Strings.zh-Hant.xlf | 7 +---- .../WindowsBase/System/Windows/Int32Rect.cs | 11 ++------ 66 files changed, 65 insertions(+), 393 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs index f81719477f4..cd6e5d82ce6 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs @@ -526,10 +526,7 @@ int cchLength throw new ArgumentOutOfRangeException("cpFirst", SR.Format(SR.ParameterMustBeBetween, cpFirst, cpFirst + cchLength)); } - if (characterHit.TrailingLength < 0) - { - throw new ArgumentOutOfRangeException("cchLength", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(characterHit.TrailingLength, nameof(cchLength)); } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index 884109709c0..317340c7d68 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1828,9 +1828,6 @@ The parameter value cannot be less than '{0}'. - - Parameter must be greater than or equal to zero. - The parameter value must be between '{0}' and '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index 3725e4bd57f..270b7b358ad 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2532,11 +2532,6 @@ Hodnota tohoto parametru nemůže být menší než {0}. - - Parameter must be greater than or equal to zero. - Hodnota tohoto parametru musí být větší nebo rovna nule. - - The parameter value must be between '{0}' and '{1}'. Hodnota tohoto parametru musí být v rozsahu od {0} do {1}. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index 4a51df17058..27a16035b71 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2532,11 +2532,6 @@ Der Parameterwert darf nicht kleiner sein als "{0}". - - Parameter must be greater than or equal to zero. - Der Parameter muss größer oder gleich null sein. - - The parameter value must be between '{0}' and '{1}'. Der Parameterwert muss zwischen "{0}" und "{1}" liegen. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index 2dcff01957d..addd1634ea6 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2532,11 +2532,6 @@ El valor del parámetro no puede ser menor que '{0}'. - - Parameter must be greater than or equal to zero. - El parámetro debe ser mayor que o igual a cero. - - The parameter value must be between '{0}' and '{1}'. El valor del parámetro debe estar comprendido entre "{0}" y "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index 4fcabed9599..2d569a0609f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2532,11 +2532,6 @@ Le paramètre ne peut pas avoir une valeur inférieure à '{0}'. - - Parameter must be greater than or equal to zero. - Le paramètre doit être supérieur ou égal à zéro. - - The parameter value must be between '{0}' and '{1}'. La valeur du paramètre doit être comprise entre '{0}' et '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index 32469a6b755..f202c87a276 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2532,11 +2532,6 @@ Il valore del parametro non può essere minore di '{0}'. - - Parameter must be greater than or equal to zero. - Il valore del parametro deve essere maggiore o uguale a zero. - - The parameter value must be between '{0}' and '{1}'. Il valore del parametro deve essere compreso tra '{0}' e '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index 0971412f68a..bdddab8d4e2 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2532,11 +2532,6 @@ パラメーター値は、'{0}' 未満にできません。 - - Parameter must be greater than or equal to zero. - パラメーターは 0 以上でなければなりません。 - - The parameter value must be between '{0}' and '{1}'. パラメーター値は、'{0}' と '{1}' の間である必要があります。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index 13fca4f8d61..68d2e717780 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2532,11 +2532,6 @@ 매개 변수 값이 '{0}'보다 작을 수 없습니다. - - Parameter must be greater than or equal to zero. - 매개 변수는 0보다 크거나 같아야 합니다. - - The parameter value must be between '{0}' and '{1}'. 매개 변수 값은 '{0}'과(와) '{1}' 사이에 있어야 합니다. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index 594cba579ec..42889adb1a0 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2532,11 +2532,6 @@ Wartość parametru nie może być mniejsza niż „{0}”. - - Parameter must be greater than or equal to zero. - Parametr musi być większy lub równy zeru. - - The parameter value must be between '{0}' and '{1}'. Wartość parametru musi należeć do przedziału od „{0}” do „{1}”. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index 1c51216d186..fd23af10c98 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2532,11 +2532,6 @@ O valor do parâmetro não pode ser menor que '{0}'. - - Parameter must be greater than or equal to zero. - O parâmetro deve ser maior ou igual a zero. - - The parameter value must be between '{0}' and '{1}'. O valor do parâmetro precisa estar entre '{0}' e '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index 8f583500704..a1c35fbfe74 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2532,11 +2532,6 @@ Значение параметра не может быть меньше "{0}". - - Parameter must be greater than or equal to zero. - Значение параметра должно быть больше или равно 0. - - The parameter value must be between '{0}' and '{1}'. Параметр должен принимать значения от "{0}" до "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index f4ef2395760..2af3d3a780f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2532,11 +2532,6 @@ Parametre değeri '{0}' değerinden küçük olamaz. - - Parameter must be greater than or equal to zero. - Parametre sıfıra eşit veya daha büyük olmalıdır. - - The parameter value must be between '{0}' and '{1}'. Parametre değeri '{0}' ile '{1}' arasında olmalıdır. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index 3d1ba2f33db..1c19311fa83 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2532,11 +2532,6 @@ 参数值不能小于“{0}”。 - - Parameter must be greater than or equal to zero. - 参数必须大于或等于零。 - - The parameter value must be between '{0}' and '{1}'. 参数值必须介于“{0}”到“{1}”之间。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 76414c9f948..440eba8e1c1 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2532,11 +2532,6 @@ 參數值不能小於 '{0}'。 - - Parameter must be greater than or equal to zero. - 參數必須大於或等於零。 - - The parameter value must be between '{0}' and '{1}'. 參數值必須介於 '{0}' 到 '{1}' 之間。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs index 776fbfe759f..9f5345d544a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs @@ -1275,8 +1275,7 @@ public double LineHeight { set { - if (value < 0) - throw new ArgumentOutOfRangeException("value", SR.ParameterCannotBeNegative); + ArgumentOutOfRangeException.ThrowIfNegative(value); _defaultParaProps.SetLineHeight(value); InvalidateMetrics(); @@ -1299,8 +1298,7 @@ public double MaxTextWidth { set { - if (value < 0) - throw new ArgumentOutOfRangeException("value", SR.ParameterCannotBeNegative); + ArgumentOutOfRangeException.ThrowIfNegative(value); _maxTextWidth = value; InvalidateMetrics(); } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs index 6649f49eba1..9903bb402ee 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs @@ -845,17 +845,9 @@ bool backwardsCompat // // Sanitize the source rect and assure it will fit within the back buffer. // - if (sourceRect.X < 0) - { - Debug.Assert(!backwardsCompat); - throw new ArgumentOutOfRangeException("sourceRect", SR.ParameterCannotBeNegative); - } - - if (sourceRect.Y < 0) - { - Debug.Assert(!backwardsCompat); - throw new ArgumentOutOfRangeException("sourceRect", SR.ParameterCannotBeNegative); - } + Debug.Assert(!(backwardsCompat && (sourceRect.X < 0 || sourceRect.Y < 0))); + ArgumentOutOfRangeException.ThrowIfNegative(sourceRect.X, nameof(sourceRect)); + ArgumentOutOfRangeException.ThrowIfNegative(sourceRect.Y, nameof(sourceRect)); if (sourceRect.Width < 0) { @@ -893,18 +885,18 @@ bool backwardsCompat } } - if (destinationX < 0) + if (!backwardsCompat) { - if (backwardsCompat) + ArgumentOutOfRangeException.ThrowIfNegative(destinationX); + } + else + { + if (destinationX < 0) { HRESULT.Check((int)WinCodecErrors.WINCODEC_ERR_VALUEOVERFLOW); } - else - { - throw new ArgumentOutOfRangeException("sourceRect", SR.ParameterCannotBeNegative); - } } - + if (destinationX > _pixelWidth - sourceRect.Width) { if (backwardsCompat) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/TextEffect.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/TextEffect.cs index 4ca8591d59c..ae23738e0e3 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/TextEffect.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/TextEffect.cs @@ -51,10 +51,7 @@ public TextEffect( int positionCount ) { - if (positionCount < 0) - { - throw new ArgumentOutOfRangeException("positionCount", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(positionCount); Transform = transform; Foreground = foreground; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs index 73c276cca2a..923fe3fe31a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs @@ -84,10 +84,7 @@ internal CharacterBufferReference( int offsetToFirstChar ) { - if (offsetToFirstChar < 0) - { - throw new ArgumentOutOfRangeException("offsetToFirstChar", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(offsetToFirstChar); // maximum offset is one less than CharacterBuffer.Count, except that zero is always a valid offset // even in the case of an empty or null character buffer diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs index 5e823504761..45c39685bad 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs @@ -95,10 +95,7 @@ internal CharacterBufferRange( int characterLength ) { - if (characterLength < 0) - { - throw new ArgumentOutOfRangeException("characterLength", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(characterLength); int maxLength = (characterBufferReference.CharacterBuffer != null) ? characterBufferReference.CharacterBuffer.Count - characterBufferReference.OffsetToFirstChar : diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/Strings.resx index 11e12a887bf..efafc5c7853 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/Strings.resx @@ -4002,9 +4002,6 @@ Do you want to replace it? Permission type is not valid. Expected '{0}'. - - Parameter must be greater than or equal to zero. - Cannot set SandboxExternalContent to true in partial trust. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.cs.xlf index 66ede047b25..9bb611bdc49 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.cs.xlf @@ -3608,11 +3608,6 @@ Chcete ho nahradit? Prvek {0} musí být poskytnut při vytváření instance {1}. - - Parameter must be greater than or equal to zero. - Hodnota tohoto parametru musí být větší nebo rovna nule. - - Parameter must be FrameworkElement or FrameworkContentElement. Parametr musí být FrameworkElement nebo FrameworkContentElement. @@ -6460,4 +6455,4 @@ Chcete ho nahradit? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.de.xlf index 5c89746b845..702ac2d7014 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.de.xlf @@ -3608,11 +3608,6 @@ Möchten Sie das Element ersetzen? "{0}" muss beim Instanziieren von "{1}" bereitgestellt werden. - - Parameter must be greater than or equal to zero. - Der Parameter muss größer oder gleich null sein. - - Parameter must be FrameworkElement or FrameworkContentElement. Bei dem Parameter muss es sich um "FrameworkElement" oder "FrameworkContentElement" handeln. @@ -6460,4 +6455,4 @@ Möchten Sie das Element ersetzen? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.es.xlf index c8ba9544163..6744cae454a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.es.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? "{0}" se debe proporcionar al crear la instancia de "{1}". - - Parameter must be greater than or equal to zero. - El parámetro debe ser mayor que o igual a cero. - - Parameter must be FrameworkElement or FrameworkContentElement. El parámetro debe ser FrameworkElement o FrameworkContentElement. @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.fr.xlf index b80b0c48355..b6c57395411 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.fr.xlf @@ -3608,11 +3608,6 @@ Voulez-vous le remplacer ? '{0}' doit être fourni durant l'instanciation de '{1}'. - - Parameter must be greater than or equal to zero. - Le paramètre doit être supérieur ou égal à zéro. - - Parameter must be FrameworkElement or FrameworkContentElement. Parameter doit être FrameworkElement ou FrameworkContentElement. @@ -6460,4 +6455,4 @@ Voulez-vous le remplacer ? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.it.xlf index 077a0dd6f75..570a42296dc 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.it.xlf @@ -3608,11 +3608,6 @@ Sostituirlo? È necessario specificare '{0}' quando si crea un'istanza di '{1}'. - - Parameter must be greater than or equal to zero. - Il valore del parametro deve essere maggiore o uguale a zero. - - Parameter must be FrameworkElement or FrameworkContentElement. Il parametro deve essere FrameworkElement o FrameworkContentElement. @@ -6460,4 +6455,4 @@ Sostituirlo? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ja.xlf index 2a82bcd46cc..04e3522e186 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ja.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? '{1}' をインスタンス化するには、'{0}' が必要です。 - - Parameter must be greater than or equal to zero. - パラメーターは 0 以上でなければなりません。 - - Parameter must be FrameworkElement or FrameworkContentElement. パラメーターは、FrameworkElement または FrameworkContentElement である必要があります。 @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ko.xlf index b0fdb912431..a4b0566b15e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ko.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? '{1}'의 인스턴스를 만들 때 '{0}'이(가) 제공되어야 합니다. - - Parameter must be greater than or equal to zero. - 매개 변수는 0보다 크거나 같아야 합니다. - - Parameter must be FrameworkElement or FrameworkContentElement. 매개 변수는 FrameworkElement 또는 FrameworkContentElement여야 합니다. @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pl.xlf index 7cd62601696..ac0c5c5da67 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pl.xlf @@ -3608,11 +3608,6 @@ Czy chcesz go zastąpić? Podczas tworzenia wystąpienia „{1}” należy dostarczyć „{0}”. - - Parameter must be greater than or equal to zero. - Parametr musi być większy lub równy zeru. - - Parameter must be FrameworkElement or FrameworkContentElement. Parametrem musi być FrameworkElement lub FrameworkContentElement. @@ -6460,4 +6455,4 @@ Czy chcesz go zastąpić? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pt-BR.xlf index 1b6d2b0995f..abd2c96b2f5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.pt-BR.xlf @@ -3608,11 +3608,6 @@ Deseja substituí-lo? '{0}' precisa ser fornecido durante a criação de uma instância de '{1}'. - - Parameter must be greater than or equal to zero. - O parâmetro deve ser maior ou igual a zero. - - Parameter must be FrameworkElement or FrameworkContentElement. O parâmetro deve ser FrameworkElement ou FrameworkContentElement. @@ -6460,4 +6455,4 @@ Deseja substituí-lo? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ru.xlf index add33bc9169..8156b1947bf 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.ru.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? При создании экземпляра "{1}" необходимо задать "{0}". - - Parameter must be greater than or equal to zero. - Значение параметра должно быть больше или равно 0. - - Parameter must be FrameworkElement or FrameworkContentElement. Параметр должен быть FrameworkElement или FrameworkContentElement. @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.tr.xlf index 7a43b1c10f9..7b3a0cb99de 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.tr.xlf @@ -3608,11 +3608,6 @@ Değiştirmek istiyor musunuz? '{1}' örneği oluşturulurken '{0}' sağlanmalıdır. - - Parameter must be greater than or equal to zero. - Parametre sıfıra eşit veya daha büyük olmalıdır. - - Parameter must be FrameworkElement or FrameworkContentElement. Parametre FrameworkElement veya FrameworkContentElement olmalıdır. @@ -6460,4 +6455,4 @@ Değiştirmek istiyor musunuz? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hans.xlf index 53c47c61685..7e4ffafce46 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hans.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? 安装“{1}”时必须提供“{0}”。 - - Parameter must be greater than or equal to zero. - 参数必须大于或等于零。 - - Parameter must be FrameworkElement or FrameworkContentElement. 参数必须是 FrameworkElement 或 FrameworkContentElement。 @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hant.xlf index f10c67620ca..8847ca286e5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/Resources/xlf/Strings.zh-Hant.xlf @@ -3608,11 +3608,6 @@ Do you want to replace it? 安裝 '{1}' 時必須提供 '{0}'。 - - Parameter must be greater than or equal to zero. - 參數必須大於或等於零。 - - Parameter must be FrameworkElement or FrameworkContentElement. 參數必須是 FrameworkElement 或 FrameworkContentElement。 @@ -6460,4 +6455,4 @@ Do you want to replace it? - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PasswordBox.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PasswordBox.cs index 28c26116a69..2eb7a6eb5e1 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PasswordBox.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/PasswordBox.cs @@ -1077,15 +1077,8 @@ private void Select(int start, int length) ITextPointer selectionEnd; // VerifyAccess(); - if (start < 0) - { - throw new ArgumentOutOfRangeException("start", SR.ParameterCannotBeNegative); - } - - if (length < 0) - { - throw new ArgumentOutOfRangeException("length", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(start); + ArgumentOutOfRangeException.ThrowIfNegative(length); // Identify new selection start position selectionStart = this.TextContainer.Start.CreatePointer(); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/TextBox.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/TextBox.cs index 8241bafbf46..059e93671ad 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/TextBox.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/TextBox.cs @@ -151,15 +151,8 @@ void IAddChild.AddText(string text) /// public void Select(int start, int length) { - if (start < 0) - { - throw new ArgumentOutOfRangeException("start", SR.ParameterCannotBeNegative); - } - - if (length < 0) - { - throw new ArgumentOutOfRangeException("length", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(start); + ArgumentOutOfRangeException.ThrowIfNegative(length); // Identify new position for selection Start int maxStart = TextContainer.SymbolCount; @@ -825,10 +818,7 @@ public int SelectionLength } set { - if (value < 0) - { - throw new ArgumentOutOfRangeException("value", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(value); // Identify new position for selection end int maxLength = TextSelectionInternal.Start.GetOffsetToPosition(TextContainer.End); @@ -869,10 +859,7 @@ public int SelectionStart } set { - if (value < 0) - { - throw new ArgumentOutOfRangeException("value", SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(value); // Store current length of the selection int selectionLength = TextSelectionInternal.Start.GetOffsetToPosition(TextSelectionInternal.End); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Localizer/BamlLocalizationDictionary.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Localizer/BamlLocalizationDictionary.cs index e6aec974191..b8ee63e4e69 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Localizer/BamlLocalizationDictionary.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/Localizer/BamlLocalizationDictionary.cs @@ -282,14 +282,7 @@ public int Count public void CopyTo(DictionaryEntry[] array, int arrayIndex) { ArgumentNullException.ThrowIfNull(array); - - if (arrayIndex < 0) - { - throw new ArgumentOutOfRangeException( - "arrayIndex", - SR.ParameterCannotBeNegative - ); - } + ArgumentOutOfRangeException.ThrowIfNegative(arrayIndex); if (arrayIndex >= array.Length) { diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/Strings.resx index 6282acc2cab..27f283ccf12 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/Strings.resx @@ -747,9 +747,6 @@ XAML Node Stream: Missing EndMember for '{0}.{1}' before StartMember '{2}'. - - Parameter must be greater than or equal to zero. - The property element '{0}' is not contained by an object element. diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.cs.xlf index e8c9e8e7729..c48204c55ad 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.cs.xlf @@ -1052,11 +1052,6 @@ Datový proud uzlu XAML: Nebyla nalezena metoda EndMember pro {0}.{1} před metodou StartMember {2}. - - Parameter must be greater than or equal to zero. - Hodnota tohoto parametru musí být větší nebo rovna nule. - - The property element '{0}' is not contained by an object element. Element vlastnosti {0} není obsažen v elementu objektu. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.de.xlf index 1b83e7c5ae3..12353e3bc0f 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.de.xlf @@ -1052,11 +1052,6 @@ XAML-Knotenstream: EndMember für "{0}.{1}" fehlt vor StartMember "{2}". - - Parameter must be greater than or equal to zero. - Der Parameter muss größer oder gleich null sein. - - The property element '{0}' is not contained by an object element. Das Eigenschaftenelement "{0}" ist nicht in einem Objektelement enthalten. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.es.xlf index ff365e6b066..d762f9fb08c 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.es.xlf @@ -1052,11 +1052,6 @@ Flujo de nodo XAML: falta EndMember para '{0}.{1}' delante de StartMember '{2}'. - - Parameter must be greater than or equal to zero. - El parámetro debe ser mayor que o igual a cero. - - The property element '{0}' is not contained by an object element. El elemento de propiedad '{0}' no está contenido en un elemento de objeto. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.fr.xlf index a8428dd1ead..0b975aa3ffc 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.fr.xlf @@ -1052,11 +1052,6 @@ Flux de nœud XAML : EndMember manquant pour '{0}.{1}' avant StartMember '{2}'. - - Parameter must be greater than or equal to zero. - Le paramètre doit être supérieur ou égal à zéro. - - The property element '{0}' is not contained by an object element. L'élément de propriété '{0}' n'est pas contenu dans un élément objet. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.it.xlf index 63e94ecb5e5..372d8098418 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.it.xlf @@ -1052,11 +1052,6 @@ Flusso del nodo XAML: EndMember mancante per '{0}.{1}' prima di StartMember '{2}'. - - Parameter must be greater than or equal to zero. - Il valore del parametro deve essere maggiore o uguale a zero. - - The property element '{0}' is not contained by an object element. L'elemento della proprietà '{0}' non è contenuto da un elemento dell'oggetto. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ja.xlf index 3250779dcc8..1d211e7e4d3 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ja.xlf @@ -1052,11 +1052,6 @@ XAML ノード ストリーム: StartMember '{2}' の前に '{0}.{1}' の EndMember がありません。 - - Parameter must be greater than or equal to zero. - パラメーターは 0 以上でなければなりません。 - - The property element '{0}' is not contained by an object element. プロパティ要素 '{0}' はオブジェクト要素に含まれていません。 @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ko.xlf index 78c05aed68e..449619bdfad 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ko.xlf @@ -1052,11 +1052,6 @@ XAML 노드 스트림: StartMember '{2}' 앞에 '{0}.{1}'에 대한 EndMember가 없습니다. - - Parameter must be greater than or equal to zero. - 매개 변수는 0보다 크거나 같아야 합니다. - - The property element '{0}' is not contained by an object element. 속성 요소 '{0}'이(가) 개체 요소에서 포함되지 않았습니다. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pl.xlf index 1c3dfc792d1..1c976a2f5a1 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pl.xlf @@ -1052,11 +1052,6 @@ Strumień węzłów XAML: brak metody EndMember dla elementu {0}.{1} przed metodą StartMember „{2}”. - - Parameter must be greater than or equal to zero. - Parametr musi być większy lub równy zeru. - - The property element '{0}' is not contained by an object element. Element właściwości „{0}” nie jest zawarty w elemencie obiektu. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pt-BR.xlf index 6a774ae3bdc..0a2db7b921d 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.pt-BR.xlf @@ -1052,11 +1052,6 @@ Fluxo do Nó XAML: EndMember ausente para '{0}.{1}' antes de StartMember '{2}'. - - Parameter must be greater than or equal to zero. - O parâmetro deve ser maior ou igual a zero. - - The property element '{0}' is not contained by an object element. O elemento de propriedade '{0}' não está contido em um elemento de objeto. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ru.xlf index b0575911fd1..5ef6bef939a 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.ru.xlf @@ -1052,11 +1052,6 @@ Поток узла XAML: отсутствует EndMember для "{0}.{1}" перед StartMember "{2}". - - Parameter must be greater than or equal to zero. - Значение параметра должно быть больше или равно 0. - - The property element '{0}' is not contained by an object element. Элемент свойства "{0}" не содержится в элементе объекта. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.tr.xlf index 8140af87002..6688d125120 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.tr.xlf @@ -1052,11 +1052,6 @@ XAML Düğüm Akışı: StartMember '{2}' öncesinde '{0}.{1}' için EndMember yok. - - Parameter must be greater than or equal to zero. - Parametre sıfıra eşit veya daha büyük olmalıdır. - - The property element '{0}' is not contained by an object element. '{0}' özellik öğesi bir nesne öğesinin içinde değil. @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hans.xlf index e6b73fcc31c..8374dbc8dc0 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hans.xlf @@ -1052,11 +1052,6 @@ XAML 节点流: StartMember“{2}”前面缺少“{0}.{1}”的 EndMember。 - - Parameter must be greater than or equal to zero. - 参数必须大于或等于零。 - - The property element '{0}' is not contained by an object element. 对象元素中未包含属性元素“{0}”。 @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hant.xlf index 831b7f1d646..3e99ae058fc 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/Resources/xlf/Strings.zh-Hant.xlf @@ -1052,11 +1052,6 @@ XAML 節點資料流: StartMember '{2}' 前面遺漏 '{0}.{1}' 的 EndMember。 - - Parameter must be greater than or equal to zero. - 參數必須大於或等於零。 - - The property element '{0}' is not contained by an object element. 屬性項目 '{0}' 未包含在物件項目中。 @@ -1659,4 +1654,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/Strings.resx index 6031e9ad732..36c1ffc869f 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/Strings.resx @@ -1767,9 +1767,6 @@ Parameter cannot be a zero-length string. - - Parameter must be greater than or equal to zero. - Specified value of type '{0}' must have IsFrozen set to false to modify. @@ -1803,4 +1800,4 @@ Failed WPF DLL consistency checks. Expected location: {0}. - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.cs.xlf index ae5c79f2f04..09b764d793f 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.cs.xlf @@ -1292,11 +1292,6 @@ Zadaný objekt odkazu je v konfliktu s předdefinovaným odkazem specifickým pro balíček. - - Parameter must be greater than or equal to zero. - Hodnota tohoto parametru musí být větší nebo rovna nule. - - The parameter value must be between '{0}' and '{1}'. Hodnota tohoto parametru musí být v rozsahu od {0} do {1}. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.de.xlf index 9bac58ebfc5..4f02c8dd9a6 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.de.xlf @@ -1292,11 +1292,6 @@ Das angegebene Verweisobjekt verursacht einen Konflikt mit dem vordefinierten Package-spezifischen Verweis. - - Parameter must be greater than or equal to zero. - Der Parameter muss größer oder gleich null sein. - - The parameter value must be between '{0}' and '{1}'. Der Parameterwert muss zwischen "{0}" und "{1}" liegen. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.es.xlf index 91991d01c2a..4a8c64fb204 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.es.xlf @@ -1292,11 +1292,6 @@ El objeto de referencia especificado entra en conflicto con la referencia específica de paquete predefinida. - - Parameter must be greater than or equal to zero. - El parámetro debe ser mayor que o igual a cero. - - The parameter value must be between '{0}' and '{1}'. El valor del parámetro debe estar comprendido entre "{0}" y "{1}". @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.fr.xlf index a8893df08f4..58a574c1a0b 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.fr.xlf @@ -1292,11 +1292,6 @@ L'objet de référence spécifié est en conflit avec la référence prédéfinie spécifique au package. - - Parameter must be greater than or equal to zero. - Le paramètre doit être supérieur ou égal à zéro. - - The parameter value must be between '{0}' and '{1}'. La valeur du paramètre doit être comprise entre '{0}' et '{1}'. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.it.xlf index 4399ff6cbac..2d45be21294 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.it.xlf @@ -1292,11 +1292,6 @@ L'oggetto di riferimento specificato è in conflitto con il riferimento predefinito specifico di Package. - - Parameter must be greater than or equal to zero. - Il valore del parametro deve essere maggiore o uguale a zero. - - The parameter value must be between '{0}' and '{1}'. Il valore del parametro deve essere compreso tra '{0}' e '{1}'. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ja.xlf index 2889baaefe8..ba54a56012a 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ja.xlf @@ -1292,11 +1292,6 @@ 指定された参照オブジェクトは、定義済みの Package 固有の参照と競合しています。 - - Parameter must be greater than or equal to zero. - パラメーターは 0 以上でなければなりません。 - - The parameter value must be between '{0}' and '{1}'. パラメーター値は、'{0}' と '{1}' の間である必要があります。 @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ko.xlf index aa3c2c161a1..2c5573e3fc7 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ko.xlf @@ -1292,11 +1292,6 @@ 지정한 참조 개체가 미리 정의된 Package 특정 참조와 충돌합니다. - - Parameter must be greater than or equal to zero. - 매개 변수는 0보다 크거나 같아야 합니다. - - The parameter value must be between '{0}' and '{1}'. 매개 변수 값은 '{0}'과(와) '{1}' 사이에 있어야 합니다. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pl.xlf index dd513061806..b5d62f4d382 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pl.xlf @@ -1292,11 +1292,6 @@ Określony obiekt odwołania wywołuje konflikt ze wstępnie zdefiniowanym odwołaniem specyficznym dla elementu Package. - - Parameter must be greater than or equal to zero. - Parametr musi być większy lub równy zeru. - - The parameter value must be between '{0}' and '{1}'. Wartość parametru musi należeć do przedziału od „{0}” do „{1}”. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pt-BR.xlf index 215c5112484..619e21ba325 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.pt-BR.xlf @@ -1292,11 +1292,6 @@ O objeto de referência especificado é conflitante com a referência específica do Pacote predefinida. - - Parameter must be greater than or equal to zero. - O parâmetro deve ser maior ou igual a zero. - - The parameter value must be between '{0}' and '{1}'. O valor do parâmetro precisa estar entre '{0}' e '{1}'. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ru.xlf index bf719feed7f..4bcb5a9b7dd 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.ru.xlf @@ -1292,11 +1292,6 @@ Указанный эталонный объект конфликтует с предопределенной ссылкой для заданного пакета. - - Parameter must be greater than or equal to zero. - Значение параметра должно быть больше или равно 0. - - The parameter value must be between '{0}' and '{1}'. Параметр должен принимать значения от "{0}" до "{1}". @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.tr.xlf index 1099be9c988..1506d768c62 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.tr.xlf @@ -1292,11 +1292,6 @@ Belirtilen başvuru nesnesi önceden tanımlı Pakete özgü başvuru ile çakışıyor. - - Parameter must be greater than or equal to zero. - Parametre sıfıra eşit veya daha büyük olmalıdır. - - The parameter value must be between '{0}' and '{1}'. Parametre değeri '{0}' ile '{1}' arasında olmalıdır. @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hans.xlf index 177a3b85e1a..76dce9f4e06 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hans.xlf @@ -1292,11 +1292,6 @@ 指定的引用对象与预定义的 Package 专属引用冲突。 - - Parameter must be greater than or equal to zero. - 参数必须大于或等于零。 - - The parameter value must be between '{0}' and '{1}'. 参数值必须介于“{0}”到“{1}”之间。 @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hant.xlf index af9b9f13728..dd3e7b78159 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/Resources/xlf/Strings.zh-Hant.xlf @@ -1292,11 +1292,6 @@ 指定的參考物件與預先定義的 Package 專屬參考相衝突。 - - Parameter must be greater than or equal to zero. - 參數必須大於或等於零。 - - The parameter value must be between '{0}' and '{1}'. 參數值必須介於 '{0}' 到 '{1}' 之間。 @@ -2814,4 +2809,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Int32Rect.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Int32Rect.cs index 8d3cc4a0164..d02044de87a 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Int32Rect.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Int32Rect.cs @@ -79,16 +79,9 @@ public bool HasArea // concerns prevent this until a side-by-side release. internal void ValidateForDirtyRect(string paramName, int width, int height) { - if (_x < 0) - { - throw new ArgumentOutOfRangeException(paramName, SR.ParameterCannotBeNegative); - } + ArgumentOutOfRangeException.ThrowIfNegative(_x, paramName); + ArgumentOutOfRangeException.ThrowIfNegative(_y, paramName); - if (_y < 0) - { - throw new ArgumentOutOfRangeException(paramName, SR.ParameterCannotBeNegative); - } - if (_width < 0 || _width > width) { throw new ArgumentOutOfRangeException(paramName, SR.Format(SR.ParameterMustBeBetween, 0, width)); From ca7bb66c74e3bb86579b852e698b178664380cef Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:36:45 +0100 Subject: [PATCH 3/7] get rid of SR.ParameterCannotBeGreaterThan --- .../MS/internal/TextFormatting/TextFormatterImp.cs | 7 ++----- .../src/PresentationCore/Resources/Strings.resx | 3 --- .../src/PresentationCore/Resources/xlf/Strings.cs.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.de.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.es.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.fr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.it.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ja.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ko.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pl.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ru.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.tr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf | 5 ----- .../PresentationCore/System/Windows/Media/FormattedText.cs | 4 +--- .../System/Windows/Media/Imaging/BitmapSource.cs | 7 ++----- .../Media/textformatting/CharacterBufferReference.cs | 5 +---- .../System/Windows/Media/textformatting/CharacterString.cs | 5 +---- 19 files changed, 7 insertions(+), 89 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs index cd6e5d82ce6..938501e9c0a 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/TextFormatterImp.cs @@ -497,11 +497,8 @@ TextRunCache textRunCache throw new ArgumentOutOfRangeException("paragraphProperties.DefaultTextRunProperties.FontRenderingEmSize", SR.Format(SR.ParameterMustBeBetween, 0, realMaxFontRenderingEmSize)); } - if (paragraphProperties.Indent > Constants.RealInfiniteWidth) - throw new ArgumentOutOfRangeException("paragraphProperties.Indent", SR.Format(SR.ParameterCannotBeGreaterThan, Constants.RealInfiniteWidth)); - - if (paragraphProperties.LineHeight > Constants.RealInfiniteWidth) - throw new ArgumentOutOfRangeException("paragraphProperties.LineHeight", SR.Format(SR.ParameterCannotBeGreaterThan, Constants.RealInfiniteWidth)); + ArgumentOutOfRangeException.ThrowIfGreaterThan(paragraphProperties.Indent, Constants.RealInfiniteWidth, "paragraphProperties.Indent"); + ArgumentOutOfRangeException.ThrowIfGreaterThan(paragraphProperties.LineHeight, Constants.RealInfiniteWidth, "paragraphProperties.LineHeight"); if ( paragraphProperties.DefaultIncrementalTab < 0 || paragraphProperties.DefaultIncrementalTab > Constants.RealInfiniteWidth) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index 317340c7d68..6af52cdaf5b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1822,9 +1822,6 @@ Page number cannot be negative. - - The parameter value cannot be greater than '{0}'. - The parameter value cannot be less than '{0}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index 270b7b358ad..7a4de6337f1 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2522,11 +2522,6 @@ Číslo stránky nemůže být záporné. - - The parameter value cannot be greater than '{0}'. - Hodnota tohoto parametru nemůže být větší než {0}. - - The parameter value cannot be less than '{0}'. Hodnota tohoto parametru nemůže být menší než {0}. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index 27a16035b71..9f2c8e4936f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2522,11 +2522,6 @@ Die Seitenzahl kann nicht negativ sein. - - The parameter value cannot be greater than '{0}'. - Der Parameterwert darf nicht größer sein als "{0}". - - The parameter value cannot be less than '{0}'. Der Parameterwert darf nicht kleiner sein als "{0}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index addd1634ea6..09a0c12b580 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2522,11 +2522,6 @@ El número de página no puede ser negativo. - - The parameter value cannot be greater than '{0}'. - El valor del parámetro no puede ser mayor que '{0}'. - - The parameter value cannot be less than '{0}'. El valor del parámetro no puede ser menor que '{0}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index 2d569a0609f..d191afaf165 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2522,11 +2522,6 @@ Le numéro de page ne peut pas être négatif. - - The parameter value cannot be greater than '{0}'. - Le paramètre ne peut pas avoir une valeur supérieure à '{0}'. - - The parameter value cannot be less than '{0}'. Le paramètre ne peut pas avoir une valeur inférieure à '{0}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index f202c87a276..b6444c0c7db 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2522,11 +2522,6 @@ Il numero di pagina non può essere negativo. - - The parameter value cannot be greater than '{0}'. - Il valore del parametro non può essere maggiore di '{0}'. - - The parameter value cannot be less than '{0}'. Il valore del parametro non può essere minore di '{0}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index bdddab8d4e2..cf4b12feb01 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2522,11 +2522,6 @@ ページ番号は負の数にできません。 - - The parameter value cannot be greater than '{0}'. - パラメーター値は、'{0}' より大きくできません。 - - The parameter value cannot be less than '{0}'. パラメーター値は、'{0}' 未満にできません。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index 68d2e717780..5277d80eef7 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2522,11 +2522,6 @@ 페이지 번호는 음수일 수 없습니다. - - The parameter value cannot be greater than '{0}'. - 매개 변수 값이 '{0}'보다 클 수 없습니다. - - The parameter value cannot be less than '{0}'. 매개 변수 값이 '{0}'보다 작을 수 없습니다. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index 42889adb1a0..e48065eb318 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2522,11 +2522,6 @@ Numer strony nie może być ujemny. - - The parameter value cannot be greater than '{0}'. - Wartość parametru nie może być większa niż „{0}”. - - The parameter value cannot be less than '{0}'. Wartość parametru nie może być mniejsza niż „{0}”. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index fd23af10c98..bb3e6f3dfd1 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2522,11 +2522,6 @@ O número da página não pode ser negativo. - - The parameter value cannot be greater than '{0}'. - O valor do parâmetro não pode ser maior que '{0}'. - - The parameter value cannot be less than '{0}'. O valor do parâmetro não pode ser menor que '{0}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index a1c35fbfe74..73c17860378 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2522,11 +2522,6 @@ Номер страницы не может быть отрицательным. - - The parameter value cannot be greater than '{0}'. - Значение параметра не может быть больше "{0}". - - The parameter value cannot be less than '{0}'. Значение параметра не может быть меньше "{0}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index 2af3d3a780f..a38a881052e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2522,11 +2522,6 @@ Sayfa numarası negatif olamaz. - - The parameter value cannot be greater than '{0}'. - Parametre değeri '{0}' değerinden büyük olamaz. - - The parameter value cannot be less than '{0}'. Parametre değeri '{0}' değerinden küçük olamaz. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index 1c19311fa83..ac226b74b8c 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2522,11 +2522,6 @@ 页码不能为负数。 - - The parameter value cannot be greater than '{0}'. - 参数值不能大于“{0}”。 - - The parameter value cannot be less than '{0}'. 参数值不能小于“{0}”。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 440eba8e1c1..47cb575d2f9 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2522,11 +2522,6 @@ 頁碼不能為負數。 - - The parameter value cannot be greater than '{0}'. - 參數值不能大於 '{0}'。 - - The parameter value cannot be less than '{0}'. 參數值不能小於 '{0}'。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs index 9f5345d544a..2002f5c6300 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/FormattedText.cs @@ -291,9 +291,7 @@ private static void ValidateCulture(CultureInfo culture) private static void ValidateFontSize(double emSize) { ArgumentOutOfRangeException.ThrowIfNegativeOrZero(emSize); - - if (emSize > MaxFontEmSize) - throw new ArgumentOutOfRangeException("emSize", SR.Format(SR.ParameterCannotBeGreaterThan, MaxFontEmSize)); + ArgumentOutOfRangeException.ThrowIfGreaterThan(emSize, MaxFontEmSize); if (double.IsNaN(emSize)) throw new ArgumentOutOfRangeException("emSize", SR.ParameterValueCannotBeNaN); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs index cc75b26f4a4..be629970c79 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs @@ -738,11 +738,8 @@ internal void CriticalCopyPixels(Int32Rect sourceRect, IntPtr buffer, int buffer if (sourceRect.Height <= 0) sourceRect.Height = PixelHeight; - if (sourceRect.Width > PixelWidth) - throw new ArgumentOutOfRangeException("sourceRect.Width", SR.Format(SR.ParameterCannotBeGreaterThan, PixelWidth)); - - if (sourceRect.Height > PixelHeight) - throw new ArgumentOutOfRangeException("sourceRect.Height", SR.Format(SR.ParameterCannotBeGreaterThan, PixelHeight)); + ArgumentOutOfRangeException.ThrowIfGreaterThan(sourceRect.Width, PixelWidth, "sourceRect.Width"); + ArgumentOutOfRangeException.ThrowIfGreaterThan(sourceRect.Height, PixelHeight, "sourceRect.Height"); int minStride = checked(((sourceRect.Width * Format.BitsPerPixel) + 7) / 8); if (stride < minStride) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs index 923fe3fe31a..6c11e353d40 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterBufferReference.cs @@ -89,10 +89,7 @@ int offsetToFirstChar // maximum offset is one less than CharacterBuffer.Count, except that zero is always a valid offset // even in the case of an empty or null character buffer int maxOffset = (charBuffer == null) ? 0 : Math.Max(0, charBuffer.Count - 1); - if (offsetToFirstChar > maxOffset) - { - throw new ArgumentOutOfRangeException("offsetToFirstChar", SR.Format(SR.ParameterCannotBeGreaterThan, maxOffset)); - } + ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetToFirstChar, maxOffset); _charBuffer = charBuffer; _offsetToFirstChar = offsetToFirstChar; diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs index 45c39685bad..d5cd47a4102 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/CharacterString.cs @@ -101,10 +101,7 @@ int characterLength characterBufferReference.CharacterBuffer.Count - characterBufferReference.OffsetToFirstChar : 0; - if (characterLength > maxLength) - { - throw new ArgumentOutOfRangeException("characterLength", SR.Format(SR.ParameterCannotBeGreaterThan, maxLength)); - } + ArgumentOutOfRangeException.ThrowIfGreaterThan(characterLength, maxLength); _charBufferRef = characterBufferReference; _length = characterLength; From 2e1fdabceb5c8e4007335432e0749cbcbf0b3555 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:41:07 +0100 Subject: [PATCH 4/7] get rid of SR.ParameterCannotBeLessThan --- .../PresentationCore/Resources/Strings.resx | 3 -- .../Resources/xlf/Strings.cs.xlf | 5 ---- .../Resources/xlf/Strings.de.xlf | 5 ---- .../Resources/xlf/Strings.es.xlf | 5 ---- .../Resources/xlf/Strings.fr.xlf | 5 ---- .../Resources/xlf/Strings.it.xlf | 5 ---- .../Resources/xlf/Strings.ja.xlf | 5 ---- .../Resources/xlf/Strings.ko.xlf | 5 ---- .../Resources/xlf/Strings.pl.xlf | 5 ---- .../Resources/xlf/Strings.pt-BR.xlf | 5 ---- .../Resources/xlf/Strings.ru.xlf | 5 ---- .../Resources/xlf/Strings.tr.xlf | 5 ---- .../Resources/xlf/Strings.zh-Hans.xlf | 5 ---- .../Resources/xlf/Strings.zh-Hant.xlf | 5 ---- .../Windows/Media/Imaging/BitmapSource.cs | 6 ++-- .../Windows/Media/Imaging/WriteableBitmap.cs | 29 ++++--------------- .../TextSimpleMarkerProperties.cs | 5 +--- 17 files changed, 9 insertions(+), 99 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index 6af52cdaf5b..e2dc0e09691 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1822,9 +1822,6 @@ Page number cannot be negative. - - The parameter value cannot be less than '{0}'. - The parameter value must be between '{0}' and '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index 7a4de6337f1..6097e77c666 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2522,11 +2522,6 @@ Číslo stránky nemůže být záporné. - - The parameter value cannot be less than '{0}'. - Hodnota tohoto parametru nemůže být menší než {0}. - - The parameter value must be between '{0}' and '{1}'. Hodnota tohoto parametru musí být v rozsahu od {0} do {1}. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index 9f2c8e4936f..9eec67ffb4e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2522,11 +2522,6 @@ Die Seitenzahl kann nicht negativ sein. - - The parameter value cannot be less than '{0}'. - Der Parameterwert darf nicht kleiner sein als "{0}". - - The parameter value must be between '{0}' and '{1}'. Der Parameterwert muss zwischen "{0}" und "{1}" liegen. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index 09a0c12b580..8369ff4c9af 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2522,11 +2522,6 @@ El número de página no puede ser negativo. - - The parameter value cannot be less than '{0}'. - El valor del parámetro no puede ser menor que '{0}'. - - The parameter value must be between '{0}' and '{1}'. El valor del parámetro debe estar comprendido entre "{0}" y "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index d191afaf165..cdb03450e66 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2522,11 +2522,6 @@ Le numéro de page ne peut pas être négatif. - - The parameter value cannot be less than '{0}'. - Le paramètre ne peut pas avoir une valeur inférieure à '{0}'. - - The parameter value must be between '{0}' and '{1}'. La valeur du paramètre doit être comprise entre '{0}' et '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index b6444c0c7db..f6030c48ce4 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2522,11 +2522,6 @@ Il numero di pagina non può essere negativo. - - The parameter value cannot be less than '{0}'. - Il valore del parametro non può essere minore di '{0}'. - - The parameter value must be between '{0}' and '{1}'. Il valore del parametro deve essere compreso tra '{0}' e '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index cf4b12feb01..bf3ddb59cad 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2522,11 +2522,6 @@ ページ番号は負の数にできません。 - - The parameter value cannot be less than '{0}'. - パラメーター値は、'{0}' 未満にできません。 - - The parameter value must be between '{0}' and '{1}'. パラメーター値は、'{0}' と '{1}' の間である必要があります。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index 5277d80eef7..0fb3c7a4ea1 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2522,11 +2522,6 @@ 페이지 번호는 음수일 수 없습니다. - - The parameter value cannot be less than '{0}'. - 매개 변수 값이 '{0}'보다 작을 수 없습니다. - - The parameter value must be between '{0}' and '{1}'. 매개 변수 값은 '{0}'과(와) '{1}' 사이에 있어야 합니다. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index e48065eb318..b91008c757b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2522,11 +2522,6 @@ Numer strony nie może być ujemny. - - The parameter value cannot be less than '{0}'. - Wartość parametru nie może być mniejsza niż „{0}”. - - The parameter value must be between '{0}' and '{1}'. Wartość parametru musi należeć do przedziału od „{0}” do „{1}”. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index bb3e6f3dfd1..1d6d75c844b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2522,11 +2522,6 @@ O número da página não pode ser negativo. - - The parameter value cannot be less than '{0}'. - O valor do parâmetro não pode ser menor que '{0}'. - - The parameter value must be between '{0}' and '{1}'. O valor do parâmetro precisa estar entre '{0}' e '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index 73c17860378..53432678997 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2522,11 +2522,6 @@ Номер страницы не может быть отрицательным. - - The parameter value cannot be less than '{0}'. - Значение параметра не может быть меньше "{0}". - - The parameter value must be between '{0}' and '{1}'. Параметр должен принимать значения от "{0}" до "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index a38a881052e..f442df76e99 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2522,11 +2522,6 @@ Sayfa numarası negatif olamaz. - - The parameter value cannot be less than '{0}'. - Parametre değeri '{0}' değerinden küçük olamaz. - - The parameter value must be between '{0}' and '{1}'. Parametre değeri '{0}' ile '{1}' arasında olmalıdır. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index ac226b74b8c..897b62fc942 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2522,11 +2522,6 @@ 页码不能为负数。 - - The parameter value cannot be less than '{0}'. - 参数值不能小于“{0}”。 - - The parameter value must be between '{0}' and '{1}'. 参数值必须介于“{0}”到“{1}”之间。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 47cb575d2f9..38860aadd13 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2522,11 +2522,6 @@ 頁碼不能為負數。 - - The parameter value cannot be less than '{0}'. - 參數值不能小於 '{0}'。 - - The parameter value must be between '{0}' and '{1}'. 參數值必須介於 '{0}' 到 '{1}' 之間。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs index be629970c79..0d3e0bedb2d 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSource.cs @@ -742,12 +742,10 @@ internal void CriticalCopyPixels(Int32Rect sourceRect, IntPtr buffer, int buffer ArgumentOutOfRangeException.ThrowIfGreaterThan(sourceRect.Height, PixelHeight, "sourceRect.Height"); int minStride = checked(((sourceRect.Width * Format.BitsPerPixel) + 7) / 8); - if (stride < minStride) - throw new ArgumentOutOfRangeException("stride", SR.Format(SR.ParameterCannotBeLessThan, minStride)); + ArgumentOutOfRangeException.ThrowIfLessThan(stride, minStride); int minRequiredDestSize = checked((stride * (sourceRect.Height - 1)) + minStride); - if (bufferSize < minRequiredDestSize) - throw new ArgumentOutOfRangeException("buffer", SR.Format(SR.ParameterCannotBeLessThan, minRequiredDestSize)); + ArgumentOutOfRangeException.ThrowIfLessThan(bufferSize, minRequiredDestSize); lock (_syncObject) { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs index 9903bb402ee..fed100eeecd 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs @@ -451,15 +451,8 @@ int stride { WritePreamble(); - if (bufferSize < 1) - { - throw new ArgumentOutOfRangeException("bufferSize", SR.Format(SR.ParameterCannotBeLessThan, 1)); - } - - if (stride < 1) - { - throw new ArgumentOutOfRangeException("stride", SR.Format(SR.ParameterCannotBeLessThan, 1)); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(bufferSize); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(stride); if (sourceRect.IsEmpty || sourceRect.Width <= 0 || sourceRect.Height <= 0) { @@ -518,15 +511,8 @@ int offset out sourceBufferSize, out elementType); - if (stride < 1) - { - throw new ArgumentOutOfRangeException("stride", SR.Format(SR.ParameterCannotBeLessThan, 1)); - } - - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset", SR.Format(SR.ParameterCannotBeLessThan, 0)); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(stride); + ArgumentOutOfRangeException.ThrowIfNegative(offset); // We accept arrays of arbitrary value types - but not reference types. if (elementType == null || !elementType.IsValueType) @@ -946,11 +932,8 @@ bool backwardsCompat throw new ArgumentNullException(backwardsCompat ? "buffer" : "sourceBuffer"); } - if (sourceBufferStride < 1) - { - Debug.Assert(!backwardsCompat); - throw new ArgumentOutOfRangeException("sourceBufferStride", SR.Format(SR.ParameterCannotBeLessThan, 1)); - } + Debug.Assert(!(backwardsCompat && sourceBufferStride < 1)); + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(sourceBufferStride); if (sourceRect.Width == 0 || sourceRect.Height == 0) { diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextSimpleMarkerProperties.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextSimpleMarkerProperties.cs index c88a065065d..19efa3f1095 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextSimpleMarkerProperties.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/textformatting/TextSimpleMarkerProperties.cs @@ -57,10 +57,7 @@ TextParagraphProperties textParagraphProperties else if (TextMarkerSource.IsKnownIndexMarkerStyle(style)) { // validate autoNumberingIndex - if (autoNumberingIndex < 1) - { - throw new ArgumentOutOfRangeException("autoNumberingIndex", SR.Format(SR.ParameterCannotBeLessThan, 1)); - } + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(autoNumberingIndex); } else { From a535cf0d5107f8ffddb9398d05ac965f122bac42 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:42:39 +0100 Subject: [PATCH 5/7] get rid of SR.ParameterValueMustBeGreaterThanZero --- .../src/PresentationCore/Resources/Strings.resx | 3 --- .../src/PresentationCore/Resources/xlf/Strings.cs.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.de.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.es.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.fr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.it.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ja.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ko.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pl.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ru.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.tr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf | 5 ----- .../src/Shared/MS/Internal/CharacterBuffer.cs | 7 ++----- 15 files changed, 2 insertions(+), 73 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index e2dc0e09691..b39556a3f5e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1834,9 +1834,6 @@ '{0}' parameter value cannot be negative. - - '{0}' parameter value must be greater than zero. - Token is not valid. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index 6097e77c666..d8a638a25e5 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2542,11 +2542,6 @@ Hodnota parametru {0} nemůže být záporná. - - '{0}' parameter value must be greater than zero. - Hodnota parametru {0} musí být větší než nula. - - Incorrect form '{0}' found parsing '{1}' string. Nalezena nesprávná forma {0} při analýze řetězce {1}. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index 9eec67ffb4e..a37381c29cb 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2542,11 +2542,6 @@ Der Parameterwert "{0}" darf nicht negativ sein. - - '{0}' parameter value must be greater than zero. - Der Parameterwert "{0}" muss größer Null sein. - - Incorrect form '{0}' found parsing '{1}' string. Beim Analysieren der Zeichenfolge "{1}" wurde die ungültige Form "{0}" gefunden. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index 8369ff4c9af..76a754cb2bb 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2542,11 +2542,6 @@ El valor del parámetro '{0}' no puede ser negativo. - - '{0}' parameter value must be greater than zero. - El valor del parámetro '{0}' debe ser mayor que cero. - - Incorrect form '{0}' found parsing '{1}' string. Se encontró un formato incorrecto "{0}" al analizar la cadena "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index cdb03450e66..2d670919993 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2542,11 +2542,6 @@ La valeur du paramètre '{0}' ne peut pas être négative. - - '{0}' parameter value must be greater than zero. - La valeur du paramètre '{0}' doit être supérieure à zéro. - - Incorrect form '{0}' found parsing '{1}' string. Forme '{0}' incorrecte trouvée durant l'analyse de la chaîne '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index f6030c48ce4..18a28c4e1c6 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2542,11 +2542,6 @@ Il valore del parametro '{0}' non può essere negativo. - - '{0}' parameter value must be greater than zero. - Il valore del parametro '{0}' deve essere maggiore di zero. - - Incorrect form '{0}' found parsing '{1}' string. È stato trovato un formato non corretto '{0}' durante l'analisi della stringa '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index bf3ddb59cad..87a6493ad68 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2542,11 +2542,6 @@ '{0}' パラメーター値を負の値にすることはできません。 - - '{0}' parameter value must be greater than zero. - '{0}' パラメーター値は、0 より大きい必要があります。 - - Incorrect form '{0}' found parsing '{1}' string. '{1}' 文字列の解析中に無効なフォーム '{0}' が見つかりました。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index 0fb3c7a4ea1..7132337d51f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2542,11 +2542,6 @@ '{0}' 매개 변수 값은 음수일 수 없습니다. - - '{0}' parameter value must be greater than zero. - '{0}' 매개 변수 값은 0보다 커야 합니다. - - Incorrect form '{0}' found parsing '{1}' string. '{1}' 문자열을 구문 분석하는 동안 잘못된 '{0}' 형식이 검색되었습니다. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index b91008c757b..29d333b79ca 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2542,11 +2542,6 @@ Wartość parametru „{0}” nie może być ujemna. - - '{0}' parameter value must be greater than zero. - Wartość parametru „{0}” musi być większa niż zero. - - Incorrect form '{0}' found parsing '{1}' string. Znaleziono nieprawidłową formę „{0}” podczas analizy ciągu „{1}”. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index 1d6d75c844b..63d3a774497 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2542,11 +2542,6 @@ O valor do parâmetro '{0}' não pode ser negativo. - - '{0}' parameter value must be greater than zero. - O valor do parâmetro '{0}' deve ser maior que zero. - - Incorrect form '{0}' found parsing '{1}' string. Forma incorreta de '{0}' encontrada na análise da cadeia de caracteres '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index 53432678997..fa9b79932ad 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2542,11 +2542,6 @@ Значение параметра "{0}" не может быть отрицательным. - - '{0}' parameter value must be greater than zero. - Значение параметра "{0}" должно быть больше 0. - - Incorrect form '{0}' found parsing '{1}' string. При синтаксическом анализе строки "{1}" обнаружена неправильная форма "{0}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index f442df76e99..3a7d5cfbe30 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2542,11 +2542,6 @@ '{0}' parametre değeri negatif olamaz. - - '{0}' parameter value must be greater than zero. - '{0}' parametre değeri sıfırdan büyük olmalıdır. - - Incorrect form '{0}' found parsing '{1}' string. '{1}' dizesi ayrıştırılırken yanlış '{0}' biçimi bulundu. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index 897b62fc942..42efc3c28e0 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2542,11 +2542,6 @@ “{0}”参数值不能为负数。 - - '{0}' parameter value must be greater than zero. - “{0}”参数值必须大于零。 - - Incorrect form '{0}' found parsing '{1}' string. 解析“{1}”字符串时发现格式“{0}”错误。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 38860aadd13..3c6a46fe2a7 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2542,11 +2542,6 @@ '{0}' 參數值不能為負數。 - - '{0}' parameter value must be greater than zero. - '{0}' 參數值必須大於零。 - - Incorrect form '{0}' found parsing '{1}' string. 剖析 '{1}' 字串時發現不正確的格式 '{0}'。 diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/CharacterBuffer.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/CharacterBuffer.cs index 4e26ce33477..dec5d4a7aa2 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/CharacterBuffer.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/CharacterBuffer.cs @@ -387,11 +387,8 @@ int length throw new ArgumentNullException("characterString"); } - if (length <= 0) - { - throw new ArgumentOutOfRangeException("length", SR.ParameterValueMustBeGreaterThanZero); - } - + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); + _unsafeString = characterString; _length = length; } From ed7e269b705b909ef173693f1931764a50497938 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 14:44:02 +0100 Subject: [PATCH 6/7] get rid of SR.ParameterValueCannotBeNegative --- .../src/PresentationCore/Resources/Strings.resx | 3 --- .../src/PresentationCore/Resources/xlf/Strings.cs.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.de.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.es.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.fr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.it.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ja.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ko.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pl.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.ru.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.tr.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf | 5 ----- .../src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf | 5 ----- .../src/PresentationCore/System/Windows/Media/GlyphRun.cs | 5 +---- 15 files changed, 1 insertion(+), 72 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx index b39556a3f5e..f140c96cb8b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/Strings.resx @@ -1831,9 +1831,6 @@ The parameter value must be a number. - - '{0}' parameter value cannot be negative. - Token is not valid. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf index d8a638a25e5..932ac4882c9 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.cs.xlf @@ -2537,11 +2537,6 @@ Hodnota tohoto parametru musí být číslo. - - '{0}' parameter value cannot be negative. - Hodnota parametru {0} nemůže být záporná. - - Incorrect form '{0}' found parsing '{1}' string. Nalezena nesprávná forma {0} při analýze řetězce {1}. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf index a37381c29cb..5548e6cd80f 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.de.xlf @@ -2537,11 +2537,6 @@ Der Parameterwert muss eine Zahl sein. - - '{0}' parameter value cannot be negative. - Der Parameterwert "{0}" darf nicht negativ sein. - - Incorrect form '{0}' found parsing '{1}' string. Beim Analysieren der Zeichenfolge "{1}" wurde die ungültige Form "{0}" gefunden. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf index 76a754cb2bb..28a0972f048 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.es.xlf @@ -2537,11 +2537,6 @@ El valor del parámetro debe ser un número. - - '{0}' parameter value cannot be negative. - El valor del parámetro '{0}' no puede ser negativo. - - Incorrect form '{0}' found parsing '{1}' string. Se encontró un formato incorrecto "{0}" al analizar la cadena "{1}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf index 2d670919993..ac298fdf804 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.fr.xlf @@ -2537,11 +2537,6 @@ La valeur du paramètre doit être numérique. - - '{0}' parameter value cannot be negative. - La valeur du paramètre '{0}' ne peut pas être négative. - - Incorrect form '{0}' found parsing '{1}' string. Forme '{0}' incorrecte trouvée durant l'analyse de la chaîne '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf index 18a28c4e1c6..904667253e4 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.it.xlf @@ -2537,11 +2537,6 @@ Il valore del parametro deve essere un numero. - - '{0}' parameter value cannot be negative. - Il valore del parametro '{0}' non può essere negativo. - - Incorrect form '{0}' found parsing '{1}' string. È stato trovato un formato non corretto '{0}' durante l'analisi della stringa '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf index 87a6493ad68..d70b6a78297 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ja.xlf @@ -2537,11 +2537,6 @@ パラメーター値は、数値である必要があります。 - - '{0}' parameter value cannot be negative. - '{0}' パラメーター値を負の値にすることはできません。 - - Incorrect form '{0}' found parsing '{1}' string. '{1}' 文字列の解析中に無効なフォーム '{0}' が見つかりました。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf index 7132337d51f..30aa6fae416 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ko.xlf @@ -2537,11 +2537,6 @@ 매개 변수 값은 숫자여야 합니다. - - '{0}' parameter value cannot be negative. - '{0}' 매개 변수 값은 음수일 수 없습니다. - - Incorrect form '{0}' found parsing '{1}' string. '{1}' 문자열을 구문 분석하는 동안 잘못된 '{0}' 형식이 검색되었습니다. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf index 29d333b79ca..7a0da67e3fc 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pl.xlf @@ -2537,11 +2537,6 @@ Wartość parametru musi być liczbą. - - '{0}' parameter value cannot be negative. - Wartość parametru „{0}” nie może być ujemna. - - Incorrect form '{0}' found parsing '{1}' string. Znaleziono nieprawidłową formę „{0}” podczas analizy ciągu „{1}”. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf index 63d3a774497..98c91f0574e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.pt-BR.xlf @@ -2537,11 +2537,6 @@ O valor do parâmetro deve ser um número. - - '{0}' parameter value cannot be negative. - O valor do parâmetro '{0}' não pode ser negativo. - - Incorrect form '{0}' found parsing '{1}' string. Forma incorreta de '{0}' encontrada na análise da cadeia de caracteres '{1}'. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf index fa9b79932ad..d55139f0945 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.ru.xlf @@ -2537,11 +2537,6 @@ Значение параметра должно быть числом. - - '{0}' parameter value cannot be negative. - Значение параметра "{0}" не может быть отрицательным. - - Incorrect form '{0}' found parsing '{1}' string. При синтаксическом анализе строки "{1}" обнаружена неправильная форма "{0}". diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf index 3a7d5cfbe30..58f5dba646e 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.tr.xlf @@ -2537,11 +2537,6 @@ Parametre değeri bir sayı olmalıdır. - - '{0}' parameter value cannot be negative. - '{0}' parametre değeri negatif olamaz. - - Incorrect form '{0}' found parsing '{1}' string. '{1}' dizesi ayrıştırılırken yanlış '{0}' biçimi bulundu. diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf index 42efc3c28e0..744f5f72318 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hans.xlf @@ -2537,11 +2537,6 @@ 参数值必须是一个数。 - - '{0}' parameter value cannot be negative. - “{0}”参数值不能为负数。 - - Incorrect form '{0}' found parsing '{1}' string. 解析“{1}”字符串时发现格式“{0}”错误。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf index 3c6a46fe2a7..1bc50bdb567 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/Resources/xlf/Strings.zh-Hant.xlf @@ -2537,11 +2537,6 @@ 參數值必須是數字。 - - '{0}' parameter value cannot be negative. - '{0}' 參數值不能為負數。 - - Incorrect form '{0}' found parsing '{1}' string. 剖析 '{1}' 字串時發現不正確的格式 '{0}'。 diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/GlyphRun.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/GlyphRun.cs index 6c3021c690f..0365e9116a7 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/GlyphRun.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/GlyphRun.cs @@ -456,11 +456,8 @@ TextFormattingMode textFormattingMode if (double.IsNaN(renderingEmSize)) throw new ArgumentOutOfRangeException("renderingEmSize", SR.ParameterValueCannotBeNaN); - if (renderingEmSize < 0.0) - throw new ArgumentOutOfRangeException("renderingEmSize", SR.ParameterValueCannotBeNegative); - + ArgumentOutOfRangeException.ThrowIfNegative(renderingEmSize); ArgumentNullException.ThrowIfNull(glyphTypeface); - ArgumentNullException.ThrowIfNull(glyphIndices); if (glyphIndices.Count <= 0) From fdae6c3a60fb154505e5e7b2e6d242de8cb5ea97 Mon Sep 17 00:00:00 2001 From: halgab <24685886+halgab@users.noreply.github.com> Date: Wed, 8 Nov 2023 23:15:18 +0100 Subject: [PATCH 7/7] get rid of SR.ShouldBeZero --- .../MS/Internal/AutomationProxies/WindowsButton.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsComboBox.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsContainer.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsEditBox.cs | 6 +----- .../Internal/AutomationProxies/WindowsFormsLinkLabel.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsIPAddress.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsNonControl.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsProgressbar.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsRebar.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsRichEdit.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsScrollBar.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsSlider.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsSpinner.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsStartMenu.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsStatic.cs | 5 ++--- .../MS/Internal/AutomationProxies/WindowsStatusBar.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsTooltip.cs | 6 +----- .../MS/Internal/AutomationProxies/WindowsUpDown.cs | 6 +----- .../UnsupportedAutomationProxies/WindowsDateTimePicker.cs | 6 +----- .../Internal/UnsupportedAutomationProxies/windowspager.cs | 8 ++------ .../Resources/Strings.resx | 5 +---- .../Resources/xlf/Strings.cs.xlf | 7 +------ .../Resources/xlf/Strings.de.xlf | 7 +------ .../Resources/xlf/Strings.es.xlf | 7 +------ .../Resources/xlf/Strings.fr.xlf | 7 +------ .../Resources/xlf/Strings.it.xlf | 7 +------ .../Resources/xlf/Strings.ja.xlf | 7 +------ .../Resources/xlf/Strings.ko.xlf | 7 +------ .../Resources/xlf/Strings.pl.xlf | 7 +------ .../Resources/xlf/Strings.pt-BR.xlf | 7 +------ .../Resources/xlf/Strings.ru.xlf | 7 +------ .../Resources/xlf/Strings.tr.xlf | 7 +------ .../Resources/xlf/Strings.zh-Hans.xlf | 7 +------ .../Resources/xlf/Strings.zh-Hant.xlf | 7 +------ 34 files changed, 36 insertions(+), 181 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsButton.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsButton.cs index 62c55e2f1b8..a9d940a236d 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsButton.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsButton.cs @@ -95,11 +95,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); ButtonType type; int style; diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsComboBox.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsComboBox.cs index fd2bfcb025f..38e0e3dd014 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsComboBox.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsComboBox.cs @@ -69,11 +69,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsComboBox(hwnd, null, HostedByComboEx(hwnd), idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsContainer.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsContainer.cs index ab7bbacfc7a..3133253b940 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsContainer.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsContainer.cs @@ -61,11 +61,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert(idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsContainer(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsEditBox.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsEditBox.cs index e6fbb135fd7..50451851d09 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsEditBox.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsEditBox.cs @@ -83,11 +83,7 @@ private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) // AutomationElement.LogicalMapping, BUT user still can get "edit" // from Hwnd // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsEditBox(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsFormsLinkLabel.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsFormsLinkLabel.cs index 646208b059f..76cc863f88d 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsFormsLinkLabel.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsFormsLinkLabel.cs @@ -49,11 +49,7 @@ internal FormsLink (IntPtr hwnd, ProxyFragment parent, int item) internal static IRawElementProviderSimple Create (IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new FormsLink(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsIPAddress.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsIPAddress.cs index 7963bb0440f..c8ce9f36c69 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsIPAddress.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsIPAddress.cs @@ -54,11 +54,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsIPAddress(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsNonControl.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsNonControl.cs index 35b3024320f..a75b0ac4629 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsNonControl.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsNonControl.cs @@ -45,11 +45,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert(idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsNonControl(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsProgressbar.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsProgressbar.cs index 934e253ecbe..0923127ace5 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsProgressbar.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsProgressbar.cs @@ -48,11 +48,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsProgressBar(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRebar.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRebar.cs index 2db7660dbe3..29a213e1c29 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRebar.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRebar.cs @@ -50,11 +50,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsRebar(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRichEdit.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRichEdit.cs index b020b93f2e0..ecd9e85cef0 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRichEdit.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsRichEdit.cs @@ -63,11 +63,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsRichEdit(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsScrollBar.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsScrollBar.cs index aaf4560404d..cb9d7d36e83 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsScrollBar.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsScrollBar.cs @@ -68,11 +68,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsScrollBar(hwnd, null, idChild, NativeMethods.SB_CTL); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSlider.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSlider.cs index 0f4c88698b3..4bbc3356f29 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSlider.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSlider.cs @@ -54,11 +54,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsSlider(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSpinner.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSpinner.cs index 9c21d13c97e..c26117a2216 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSpinner.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsSpinner.cs @@ -54,11 +54,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); IntPtr hwndBuddy; try diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStartMenu.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStartMenu.cs index 1aff8eb0b9c..67101c5d3f3 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStartMenu.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStartMenu.cs @@ -41,11 +41,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert(idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsStartMenu(hwnd, null, 0); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatic.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatic.cs index 5c3b3490f8d..8f69d457d05 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatic.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatic.cs @@ -59,10 +59,9 @@ private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // This proxy should not be created with idChild != 0, // unless it is a link label. - if (idChild != 0 && !IsLinkLabel(hwnd)) + if (!IsLinkLabel(hwnd)) { - System.Diagnostics.Debug.Assert(idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); } StaticType type; diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatusBar.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatusBar.cs index c34eef97864..107eb0bd938 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatusBar.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsStatusBar.cs @@ -55,11 +55,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsStatusBar(hwnd, null, idChild, null); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsTooltip.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsTooltip.cs index 891b391acbf..c5475b044cd 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsTooltip.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsTooltip.cs @@ -55,11 +55,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsTooltip(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsUpDown.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsUpDown.cs index bb88c3e61cd..6d2ad57eddf 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsUpDown.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/WindowsUpDown.cs @@ -55,11 +55,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsUpDown(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/WindowsDateTimePicker.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/WindowsDateTimePicker.cs index e5f19bf828f..aec17c7fad6 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/WindowsDateTimePicker.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/WindowsDateTimePicker.cs @@ -56,11 +56,7 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsDateTimePicker(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/windowspager.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/windowspager.cs index 3a86e9d5bfc..523acf99052 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/windowspager.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/UnsupportedAutomationProxies/windowspager.cs @@ -49,12 +49,8 @@ internal static IRawElementProviderSimple Create(IntPtr hwnd, int idChild, int i private static IRawElementProviderSimple Create(IntPtr hwnd, int idChild) { - // Something is wrong if idChild is not zero - if (idChild != 0) - { - System.Diagnostics.Debug.Assert (idChild == 0, "Invalid Child Id, idChild != 0"); - throw new ArgumentOutOfRangeException("idChild", idChild, SR.ShouldBeZero); - } + // Something is wrong if idChild is not zero + ArgumentOutOfRangeException.ThrowIfNotEqual(idChild, 0); return new WindowsPager(hwnd, null, idChild); } diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/Strings.resx b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/Strings.resx index 4446a38bb23..e5ac8a7240d 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/Strings.resx +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/Strings.resx @@ -330,10 +330,7 @@ Target element cannot receive focus. - - Must be zero. - Value is read-only. - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.cs.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.cs.xlf index 6dcf4c7662a..14e9117c072 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.cs.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.cs.xlf @@ -357,11 +357,6 @@ Cílový element nemůže být vybrán. - - Must be zero. - Musí mít hodnotu nula. - - Value is read-only. Hodnota je pouze pro čtení. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.de.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.de.xlf index 99b575612db..db04c40412c 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.de.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.de.xlf @@ -357,11 +357,6 @@ Das Zielelement kann keinen Fokus erhalten. - - Must be zero. - Muss Null sein. - - Value is read-only. Der Wert ist schreibgeschützt. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.es.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.es.xlf index 4cde8af716e..445932e1714 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.es.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.es.xlf @@ -357,11 +357,6 @@ El elemento de destino no puede recibir el foco. - - Must be zero. - Debe ser cero. - - Value is read-only. El valor es de solo lectura. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.fr.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.fr.xlf index 574dde9367f..bb8ef73dd5d 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.fr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.fr.xlf @@ -357,11 +357,6 @@ L'élément cible ne peut pas recevoir le focus. - - Must be zero. - Doit être égal à zéro. - - Value is read-only. La valeur est en lecture seule. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.it.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.it.xlf index 9884757f2c7..026ccbe76dc 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.it.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.it.xlf @@ -357,11 +357,6 @@ Impossibile spostare lo stato attivo sull'elemento di destinazione. - - Must be zero. - Deve essere zero. - - Value is read-only. Valore di sola lettura. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ja.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ja.xlf index a4e93203982..67f5aa650fe 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ja.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ja.xlf @@ -357,11 +357,6 @@ ターゲット要素は、フォーカスを受け取ることができません。 - - Must be zero. - ゼロを指定してください。 - - Value is read-only. 値は読み取り専用です。 @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ko.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ko.xlf index 2beeb690575..ba23872be61 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ko.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ko.xlf @@ -357,11 +357,6 @@ 대상 요소가 포커스를 받을 수 없습니다. - - Must be zero. - 0이어야 합니다. - - Value is read-only. 값이 읽기 전용입니다. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pl.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pl.xlf index 4bfb11c77ae..4ad338fded2 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pl.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pl.xlf @@ -357,11 +357,6 @@ Nie można ustawić fokusu na elemencie docelowym. - - Must be zero. - Musi mieć wartość zero. - - Value is read-only. Wartość jest tylko do odczytu. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pt-BR.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pt-BR.xlf index 5d167f63b84..ec864a8e792 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.pt-BR.xlf @@ -357,11 +357,6 @@ O elemento de destino não pode receber o foco. - - Must be zero. - Deve ser zero. - - Value is read-only. O valor é somente leitura. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ru.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ru.xlf index f43f098a6d3..cc956e17131 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ru.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.ru.xlf @@ -357,11 +357,6 @@ Конечному элементу не удается получить фокус. - - Must be zero. - Должно быть нулем. - - Value is read-only. Значение доступно только для чтения. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.tr.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.tr.xlf index c437da5c255..88d8b6658bc 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.tr.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.tr.xlf @@ -357,11 +357,6 @@ Hedef öğeye odaklanılamıyor. - - Must be zero. - Sıfır olmalıdır. - - Value is read-only. Değer salt okunur. @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hans.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hans.xlf index d76418df4b8..124b910ebd9 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hans.xlf @@ -357,11 +357,6 @@ 目标元素无法接收焦点。 - - Must be zero. - 必须为零。 - - Value is read-only. 值为只读。 @@ -369,4 +364,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hant.xlf b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hant.xlf index 944c5b5cdc3..d39833dd4d2 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/Resources/xlf/Strings.zh-Hant.xlf @@ -357,11 +357,6 @@ 目標項目無法接收焦點。 - - Must be zero. - 必須為零。 - - Value is read-only. 值是唯讀的。 @@ -369,4 +364,4 @@ - \ No newline at end of file +