187 references to MaxValue
Aspire.Hosting.RemoteHost (1)
Ats\AtsMarshaller.cs (1)
882return decimal.ToInt16(ReadIntegralNumericValue(value, underlyingType, short.MinValue, short.MaxValue));
dotnet-suggest (1)
SuggestionDispatcher.cs (1)
97DefaultValueFactory = (_) => short.MaxValue
dotnet-svcutil-lib (13)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (1)
184Debug.Assert(pageNode[0].PageInfo.PageNumber <= Int16.MaxValue);
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (1)
3388private static readonly FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(short.MinValue, short.MaxValue);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (1)
919if (value < (int)Int16.MinValue || value > (int)Int16.MaxValue)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (1)
423if (value < short.MinValue || value > short.MaxValue)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (1)
963if (i < Int16.MinValue || i > Int16.MaxValue)
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (8)
527buffer = new XmlBuffer(short.MaxValue); 723buffer = new XmlBuffer(short.MaxValue); 803buffer = new XmlBuffer(short.MaxValue); 817buffer = new XmlBuffer(short.MaxValue); 831buffer = new XmlBuffer(short.MaxValue); 860buffer = new XmlBuffer(short.MaxValue); 928buffer = new XmlBuffer(short.MaxValue); 1336_metadataBuffer = new XmlBuffer(short.MaxValue);
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
ILCompiler.Compiler (3)
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (1)
516if (_bufferWriter.WrittenCount > short.MaxValue - sizeof(ushort))
Compiler\TypePreinit.cs (1)
943ValueTypeValue.FromInt32((short)(int)Math.Clamp(double.IsNaN(val) ? 0 : val, short.MinValue, short.MaxValue)));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
227Debug.Assert(addend >= short.MinValue && addend <= short.MaxValue);
ILCompiler.ReadyToRun (1)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (1)
227Debug.Assert(addend >= short.MinValue && addend <= short.MaxValue);
Microsoft.CodeAnalysis (6)
EnumConstantHelper.cs (1)
53overflowKind = CheckOverflow(short.MaxValue, previous, offset);
MetadataReader\MetadataHelpers.cs (1)
559if (intArity <= short.MaxValue)
MetadataReader\MetadataTypeName.cs (3)
95Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 126Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 155Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue);
Symbols\Attributes\MarshalPseudoCustomAttributeData.cs (1)
154Debug.Assert(_marshalType == UnmanagedType.LPArray && _marshalParameterIndex <= short.MaxValue);
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Conversions.cs (2)
4308case SpecialType.System_Int16: return (short.MinValue - 1D) < value && value < (short.MaxValue + 1D); 4338case SpecialType.System_Int16: return (short.MinValue - 1M) < value && value < (short.MaxValue + 1M);
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1391return short.MinValue <= value && value <= short.MaxValue;
Utilities\ValueSetFactory.ShortTC.cs (2)
20short INumericTC<short>.MaxValue => short.MaxValue; 45Debug.Assert(value != short.MaxValue);
Microsoft.CodeAnalysis.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (2)
313return UnmanagedHelper<long>.TryCreate(parameterSymbol, attributeData, short.MinValue, short.MaxValue, out parameter); 365return UnmanagedHelper<long>.Validate(parameterSymbol, attributeData, short.MinValue, short.MaxValue, helper, out diagnostics);
Microsoft.CodeAnalysis.VisualBasic (2)
Binding\Binder_InterpolatedString.vb (2)
54If constantValue.Int64Value < -Short.MaxValue Then 58If constantValue.UInt64Value > Short.MaxValue Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
118value >= Short.MinValue AndAlso value <= Short.MaxValue Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
118value >= Short.MinValue AndAlso value <= Short.MaxValue Then
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (1)
1531if (value <= (ulong)short.MaxValue)
Microsoft.Data.Analysis (3)
PrimitiveDataFrameColumnComputations.cs (3)
4256var ret = short.MaxValue; 4473var value = short.MaxValue; 4496var value = short.MaxValue;
Microsoft.Data.Analysis.PerformanceTests (1)
PerformanceTests.cs (1)
38var shortValues = values.Select(v => (short)(v % short.MaxValue + 1)).ToArray();
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
224InterimProperty = short.MaxValue
Microsoft.Gen.Metrics.Generated.Tests (1)
MetricTests.cs (1)
146const int Value = short.MaxValue + 2;
Microsoft.ML.Core (2)
Data\DataKind.cs (2)
175return (ulong)short.MaxValue; 202return (ulong)short.MaxValue;
Microsoft.ML.Core.Tests (1)
UnitTests\DataTypes.cs (1)
120short maxValue = short.MaxValue;
Microsoft.ML.Data (2)
Data\Conversion.cs (2)
1239TryParseSigned(I2.MaxValue, in src, out long? res); 1461TryParseSigned(I2.MaxValue, in src, out long? res);
Microsoft.ML.Tests (8)
CollectionsDataViewTest.cs (2)
122fShort = short.MaxValue - 1, 137fShort = short.MaxValue,
TextLoaderTests.cs (2)
36string.Format("{0},{1},{2},{3}", sbyte.MaxValue, short.MaxValue, int.MaxValue, long.MaxValue), 55short[] shortTargets = new short[] { short.MinValue, short.MaxValue, default };
Transformers\ConvertTests.cs (3)
159AG = new short[]{ short.MinValue, short.MaxValue}, 227AG = new short[]{ short.MinValue, short.MaxValue}, 239ConvG = new float[] { short.MinValue, short.MaxValue },
Transformers\HashTests.cs (1)
249if (value <= (ulong)short.MaxValue)
Microsoft.ML.Transforms (1)
Expression\IlGeneratorExtensions.cs (1)
214Contracts.Assert(0 <= arg && arg <= short.MaxValue);
Microsoft.VisualBasic.Core (10)
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (5)
1754If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 2068If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 2362ElseIf result >= Int16.MinValue AndAlso result <= Int16.MaxValue Then 2372If result >= Short.MinValue AndAlso result <= Short.MaxValue Then 3010If result < Int16.MinValue OrElse result > Int16.MaxValue Then
Microsoft\VisualBasic\CompilerServices\Operators.vb (4)
2840If result > Int16.MaxValue OrElse result < Int16.MinValue Then 3308If result < Int16.MinValue OrElse result > Int16.MaxValue Then 3723If result > Int16.MaxValue Then 3748If result > Int16.MaxValue OrElse result < Int16.MinValue Then
Microsoft\VisualBasic\VBFixedStringAttribute.vb (1)
18If (Length < 1 OrElse Length > Short.MaxValue) Then
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
351for (short i = 0; i < short.MaxValue; i++)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
TrxLogger.cs (1)
533for (short retries = 0; retries != short.MaxValue; retries++)
NuGet.Build.Tasks.Console (1)
Program.cs (1)
276if (count < 0 || count > short.MaxValue)
PresentationCore (1)
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (1)
262if (scaled > short.MaxValue || scaled < short.MinValue)
ReachFramework (10)
PrintConfig\PrintSchemaShim.cs (10)
555ticket.JobCopyCount.Value = Clamp(devModeCopies, 1, short.MaxValue); 560devMode.Copies = Clamp(copyCount, 1, short.MaxValue); 746w = LengthValueFromTenthOfMillimeterToDIP(Clamp(devModePaperWidth, 1, short.MaxValue)); 752h = LengthValueFromTenthOfMillimeterToDIP(Clamp(devModePaperHeight, 1, short.MaxValue)); 773devMode.PaperLength = Clamp(LengthValueFromDIPToTenthOfMillimeter(pageHeightInDIPs), 1, short.MaxValue); 778devMode.PaperWidth = Clamp(LengthValueFromDIPToTenthOfMillimeter(pageWidthInDIPs), 1, short.MaxValue); 990short devModXResolution = Clamp(dpiX, 1, short.MaxValue); 1000short devModYResolution = Clamp(dpiY, 1, short.MaxValue); 1011short devModYResolution = Clamp(dpiY, 1, short.MaxValue); 1072devMode.Scale = Clamp(scale, short.MinValue, short.MaxValue);
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\LiteralSpecialValues.cs (2)
48{ short.MaxValue, nameof(short.MaxValue) },
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (1)
118value >= Short.MinValue AndAlso value <= Short.MaxValue Then
ScenarioTests.Common.Tests (2)
ScenarioTestHelpers.cs (2)
125ShortValue = short.MaxValue, 167ShortValue = short.MaxValue,
System.Console (2)
System\Console.cs (2)
553if (left < 0 || left >= short.MaxValue) 555if (top < 0 || top >= short.MaxValue)
System.Data.Common (6)
System\Data\Common\Int16Storage.cs (1)
106short min = short.MaxValue;
System\Data\SQLTypes\SQLInt16.cs (5)
206if (value > short.MaxValue || value < short.MinValue) 219if (value > short.MaxValue || value < short.MinValue) 232if (value < short.MinValue || value > short.MaxValue) 245if (value < short.MinValue || value > short.MaxValue) 527public static readonly SqlInt16 MaxValue = new SqlInt16(short.MaxValue);
System.Drawing.Common (2)
System\Drawing\Bitmap.cs (2)
167if (Width >= short.MaxValue || Height >= short.MaxValue)
System.Linq (1)
System\Linq\Sequence.cs (1)
88if (typeof(T) == typeof(short) && (range = TryUseRange<int>(start, endInclusive, step, short.MaxValue)) is not null) return range;
System.Net.Security (2)
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (2)
391if (length is < 0 or > short.MaxValue) 515if (spnSize > short.MaxValue)
System.Private.CoreLib (43)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Integer.Signed.D.cs (1)
171if ((uint)answer > (uint)short.MaxValue + (-1 * sign + 1) / 2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Integer.Signed.N.cs (1)
155if (answer > short.MaxValue + (-1 * sign + 1) / 2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (2)
1852short actualResult = (value >= short.MaxValue) ? short.MaxValue : (short)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (7)
774if (value > short.MaxValue) ThrowInt16OverflowException(); 792if (value > short.MaxValue) ThrowInt16OverflowException(); 798if (value < short.MinValue || value > short.MaxValue) ThrowInt16OverflowException(); 805if (value > (uint)short.MaxValue) ThrowInt16OverflowException(); 816if (value < short.MinValue || value > short.MaxValue) ThrowInt16OverflowException(); 823if (value > (ulong)short.MaxValue) ThrowInt16OverflowException(); 2114if (r < short.MinValue || r > short.MaxValue)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1724short actualResult = (value >= short.MaxValue) ? short.MaxValue :
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
117if ((long)uint64Value < short.MinValue || (long)uint64Value > short.MaxValue) return null;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (12)
576static short IMinMaxValue<short>.MaxValue => MaxValue; 956result = (actualValue >= BitConverter.UInt16BitsToHalf(0x7800)) ? MaxValue : 963result = (actualValue >= MaxValue) ? MaxValue : 970result = (actualValue >= MaxValue) ? MaxValue : 977result = (actualValue >= MaxValue) ? MaxValue : 984result = (actualValue >= MaxValue) ? MaxValue : 1043result = (actualValue >= BitConverter.UInt16BitsToHalf(0x7800)) ? MaxValue : 1419static short IBinaryIntegerParseAndFormatInfo<short>.MaxValueDiv10 => MaxValue / 10;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (2)
1847short actualResult = ((float)value >= short.MaxValue) ? short.MaxValue :
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (2)
1620short actualResult = (value >= short.MaxValue) ? short.MaxValue :
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Scalar.cs (2)
358result = (result < 0) ? short.MaxValue : short.MinValue; 1848result = (result < 0) ? short.MaxValue : short.MinValue;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
18private const short MaxPossibleThreadCount = short.MaxValue;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerTracking.cs (1)
88Debug.Assert(Current != short.MaxValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1903short actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x0000_0000_0000_7FFF)) ? short.MaxValue : (short)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (2)
985short actualResult = (value >= short.MaxValue) ? short.MaxValue : (short)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (2)
1050short actualResult = (value >= (uint)short.MaxValue) ? short.MaxValue : (short)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (2)
1057short actualResult = (value >= (ulong)short.MaxValue) ? short.MaxValue : (short)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (2)
1056short actualResult = (value >= (nuint)short.MaxValue) ? short.MaxValue : (short)value;
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
636if (value < short.MinValue || value > short.MaxValue)
System\Xml\XmlBinaryWriter.cs (1)
724if (f >= short.MinValue && f <= short.MaxValue && (i = (int)f) == f)
System\Xml\XmlDictionaryReader.cs (1)
1075if (i < short.MinValue || i > short.MaxValue)
System.Private.Xml (3)
System\Xml\Cache\XPathNodeHelper.cs (1)
181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue);
System\Xml\Schema\DataTypeImplementation.cs (1)
3322private static readonly Numeric10FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(short.MinValue, short.MaxValue);
System\Xml\Schema\XmlValueConverter.cs (1)
834if (value < (int)short.MinValue || value > (int)short.MaxValue)
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (3)
4830actualResult = IsNegative(value) ? short.MinValue : short.MaxValue; 4834actualResult = (value._sign >= short.MaxValue) ? short.MaxValue :
System.ServiceModel.Primitives (8)
System\ServiceModel\EndpointAddress.cs (8)
497buffer = new XmlBuffer(short.MaxValue); 647buffer = new XmlBuffer(short.MaxValue); 730buffer = new XmlBuffer(short.MaxValue); 747buffer = new XmlBuffer(short.MaxValue); 764buffer = new XmlBuffer(short.MaxValue); 796buffer = new XmlBuffer(short.MaxValue); 875buffer = new XmlBuffer(short.MaxValue); 1263_metadataBuffer = new XmlBuffer(short.MaxValue);
System.Speech (2)
Internal\Synthesis\PcmConverter.cs (2)
173if (dtmp > short.MaxValue) 175dtmp = short.MaxValue;
System.Text.Json (1)
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (1)
377/// than <see cref="short.MaxValue"/>.
System.Threading (3)
System\Threading\Barrier.cs (3)
199/// or greater than <see cref="short.MaxValue"/>.</exception> 280/// exceed <see cref="short.MaxValue"/>. 312/// barrier's participant count to exceed <see cref="short.MaxValue"/>.</exception>
System.Windows.Forms (11)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
865Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine); 876Size textSize = TextRenderer.MeasureText(LayoutUtils.TestString, Font, new Size(short.MaxValue, (int)(FontHeight * 1.25)), TextFormatFlags.SingleLine);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
796ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, short.MaxValue);
System\Windows\Forms\Layout\LayoutUtils.cs (2)
50Size textSize = TextRenderer.MeasureText(obj.ToString(), font, new Size(short.MaxValue, short.MaxValue), TextFormatFlags.SingleLine);
System\Windows\Forms\Layout\TableLayout.cs (2)
693if (dontHonorConstraint && (proposedConstraints.Width < short.MaxValue)) 821if (dontHonorConstraint && (proposedConstraints.Height < short.MaxValue))
System\Windows\Forms\NativeWindow.cs (2)
434if (cp.Caption is not null && cp.Caption.Length > short.MaxValue) 436cp.Caption = cp.Caption[..short.MaxValue];
System\Windows\Forms\ToolTip\ToolTip.cs (1)
27private const int InfiniteDelay = short.MaxValue;
System\Windows\Forms\VisualStylesMode.cs (1)
65Latest = short.MaxValue
System.Windows.Forms.Primitives (3)
Windows\Win32\PInvoke.GetModuleFileNameLongPath.cs (3)
34if (buffer.Length >= short.MaxValue) 37Debug.Fail($"Module File Name is greater than {short.MaxValue}."); 41buffer.EnsureCapacity(Math.Min(buffer.Length * 2, short.MaxValue));