132 references to MaxValue
mscorlib (30)
microsoft\win32\win32native.cs (1)
551BCLDebug.Assert((stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero),
system\convert.cs (6)
952if (value < 0 || value > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); 964if (value > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); 972if (value < 0 || value > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); 979if (value > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); 2017if (fromBase != 10 && r <= UInt16.MaxValue) 2036if (r < UInt16.MinValue || r > UInt16.MaxValue)
system\decimal.cs (1)
952if (temp < UInt16.MinValue || temp > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"));
system\diagnostics\eventing\eventdescriptor.cs (4)
81if (id > ushort.MaxValue) 83throw new ArgumentOutOfRangeException("id", Environment.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue)); 99if (task > ushort.MaxValue) 101throw new ArgumentOutOfRangeException("task", Environment.GetResourceString("ArgumentOutOfRange_NeedValidId", 1, ushort.MaxValue));
System\Diagnostics\Eventing\TraceLogging\DataCollector.cs (4)
110if (size > ushort.MaxValue) 112size = ushort.MaxValue - 1; 149if (length > ushort.MaxValue) 151length = ushort.MaxValue;
system\int16.cs (2)
148if ((i < 0) || (i > UInt16.MaxValue)) { 178if ((i < 0) || i > UInt16.MaxValue) {
system\security\accesscontrol\ace.cs (4)
136else if ( Length > ushort.MaxValue ) 778public static readonly int MaxOpaqueLength = ushort.MaxValue - HeaderLength; 1590return ushort.MaxValue - HeaderLength - AccessMaskLength - SecurityIdentifier.MaxBinaryLength; 2127return ushort.MaxValue - HeaderLength - AccessMaskLength - ObjectFlagsLength - 2 * GuidLength - SecurityIdentifier.MaxBinaryLength;
system\security\accesscontrol\acl.cs (5)
113public static readonly int MaxBinaryLength = ushort.MaxValue; 897result = 2 * ushort.MaxValue + ace._indexInAcl; 924result = ushort.MaxValue + ace._indexInAcl; 950result = 2 * ushort.MaxValue + ace._indexInAcl; 968result = ushort.MaxValue + ace._indexInAcl;
system\security\principal\ntaccount.cs (1)
288if (Names[currentName].Buffer.Length * 2 + 2 > ushort.MaxValue)
system\uint16.cs (2)
139if (i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); 161if (i > MaxValue) {
PresentationBuildTasks (1)
Framework\System\Windows\Markup\XamlInt32CollectionSerializer.cs (1)
161else if ( allPositive && max <= UInt16.MaxValue )
PresentationCore (8)
Core\CSharp\MS\Internal\Shaping\Context.cs (3)
94ushort lookupIndex = ushort.MaxValue; 95ushort sequenceIndex = ushort.MaxValue; 124if (lookupIndex == ushort.MaxValue)
Core\CSharp\MS\Internal\Shaping\OpenTypeLayoutCache.cs (2)
340if (maxCacheSize > ushort.MaxValue) 343maxCacheSize = ushort.MaxValue;
Core\CSharp\System\Windows\Media\FamilyMapCollection.cs (1)
273if (_count + 1 >= ushort.MaxValue)
Core\CSharp\System\Windows\Media\GlyphTypeface.cs (2)
297if (glyphs.Count > ushort.MaxValue) 298throw new ArgumentException(SR.Get(SRID.CollectionNumberOfElementsMustBeLessOrEqualTo, ushort.MaxValue), "glyphs");
PresentationFramework (1)
src\Framework\System\Windows\Markup\XamlInt32CollectionSerializer.cs (1)
161else if ( allPositive && max <= UInt16.MaxValue )
System (34)
net\System\Net\Configuration\HttpListenerTimeoutsElement.cs (1)
110if (seconds < 0 || seconds > ushort.MaxValue)
net\System\Net\HttpListenerTimeoutManager.cs (2)
44Debug.Assert(configTimeouts[i] <= ushort.MaxValue, "Timeout out of range: " + configTimeouts[i]); 83if (timeoutValue < 0 || timeoutValue > ushort.MaxValue)
net\System\Net\Sockets\Socket.cs (2)
2377if (lingerOption.LingerTime < 0 || lingerOption.LingerTime>(int)UInt16.MaxValue) { 2378throw new ArgumentException(SR.GetString(SR.ArgumentOutOfRange_Bounds_Lower_Upper, 0, (int)UInt16.MaxValue), "optionValue.LingerTime");
net\System\Net\WebHeaderCollection.cs (18)
308if (value!=null && value.Length>ushort.MaxValue) { 309throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 328if (value!=null && value.Length>ushort.MaxValue) { 329throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 347if (value!=null && value.Length>ushort.MaxValue) { 348throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 360if (value!=null && value.Length>ushort.MaxValue) { 361throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 393if (headerValue!=null && headerValue.Length>ushort.MaxValue) { 394throw new ArgumentOutOfRangeException("headerValue", headerValue, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 623if (value!=null && value.Length>ushort.MaxValue) { 624throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 666if (value!=null && value.Length>ushort.MaxValue) { 667throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 700if (value!=null && value.Length>ushort.MaxValue) { 701throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue)); 718if (value!=null && value.Length>ushort.MaxValue) { 719throw new ArgumentOutOfRangeException("value", value, SR.GetString(SR.net_headers_toolong, ushort.MaxValue));
net\System\URI.cs (4)
3370if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){ 3492if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){ 3550if (!ServicePointManager.AllowAllUriEncodingExpansion && m_String.Length > ushort.MaxValue){ 3986if (!ServicePointManager.AllowAllUriEncodingExpansion && newHost.Length > ushort.MaxValue){
services\monitoring\system\diagnosticts\EventData.cs (1)
24if (value > UInt16.MaxValue || value < 0)
services\monitoring\system\diagnosticts\EventLogInternal.cs (2)
1616if (eventID < 0 || eventID > ushort.MaxValue) 1617throw new ArgumentException(SR.GetString(SR.EventID, eventID, 0, (int)ushort.MaxValue));
services\monitoring\system\diagnosticts\EventLogTraceListener.cs (2)
209if (id > ushort.MaxValue) 210id = ushort.MaxValue;
services\monitoring\system\diagnosticts\EventSourceCreationData.cs (1)
73if (value > UInt16.MaxValue || value < 0)
services\monitoring\system\diagnosticts\Process.cs (1)
2775if (envBlock.Length > UInt16.MaxValue)
System.Core (4)
System\Diagnostics\Eventing\EventDescriptor.cs (4)
47if (id > ushort.MaxValue) 49throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); 64if (task > ushort.MaxValue) 66throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue));
System.Data (17)
fx\src\data\System\Data\Common\UInt16Storage.cs (1)
97UInt16 min = UInt16.MaxValue;
fx\src\data\System\Data\Sql\SqlNotificationRequest.cs (2)
36if ((null != value) && (UInt16.MaxValue < value.Length)) { 60if ((null != value) && (UInt16.MaxValue < value.Length)) {
fx\src\data\System\Data\SqlClient\SqlConnection.cs (1)
2280if (maxSize < -1 || maxSize >= UInt16.MaxValue) { // Do we need this? Is this the right place?
fx\src\data\System\Data\SqlClient\SqlSecurityUtility.cs (1)
274Debug.Assert(byteLength <= UInt16.MaxValue, @"Encrypted column encryption key cannot be larger than 65536 bytes");
fx\src\data\System\Data\SqlClient\TdsParser.cs (9)
8386if (size < 0 || (size >= UInt16.MaxValue && maxsize != -1)) 9693else if (UInt16.MaxValue < callbackId.Length) { 9700else if (UInt16.MaxValue < service.Length) { 9741Debug.Assert(UInt16.MaxValue >= callbackId.Length, "CallbackId length is out of range"); 9743Debug.Assert(UInt16.MaxValue >= service.Length, "Service length is out of range"); 10073if (0 > dt.DayTicks || dt.DayTicks > UInt16.MaxValue) 10658if (0 > dt.days || dt.days > UInt16.MaxValue) 10845if (0 > dt.days || dt.days > UInt16.MaxValue) 11016if (0 > dt.DayTicks || dt.DayTicks > UInt16.MaxValue)
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (1)
507Debug.Assert (0 <= dt.days && dt.days <= UInt16.MaxValue, "Invalid DateTime '" + value + "' for SmallDateTime");
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (2)
881System.Diagnostics.Debug.Assert( path.Length <= ( UInt16.MaxValue / sizeof(char) ) ); 1037if (transactionContext.Length >= UInt16.MaxValue)
System.Data.SqlXml (2)
System\Xml\Xsl\IlGen\GenerateHelper.cs (2)
685else if (paramPos <= ushort.MaxValue) { 701else if (paramPos <= ushort.MaxValue) {
System.Runtime.Serialization (1)
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
691if (value < UInt16.MinValue || value > UInt16.MaxValue)
System.ServiceModel.Internals (2)
System\Runtime\Diagnostics\EventDescriptor.cs (2)
43if (id > ushort.MaxValue) 60if (task > ushort.MaxValue)
System.Web (1)
WebSockets\AspNetWebSocket.cs (1)
483|| closeStatus > (WebSocketCloseStatus)UInt16.MaxValue
System.Windows.Forms (10)
winforms\Managed\System\WinForms\DataGridViewColumn.cs (2)
492if (value > (float)ushort.MaxValue) 494throw new ArgumentOutOfRangeException("FillWeight", SR.GetString(SR.InvalidHighBoundArgumentEx, "FillWeight", (value).ToString(CultureInfo.CurrentCulture), (ushort.MaxValue).ToString(CultureInfo.CurrentCulture)));
winforms\Managed\System\WinForms\DataGridViewMethods.cs (8)
10933if (weightSum > (float)ushort.MaxValue) 10935throw new InvalidOperationException(SR.GetString(SR.DataGridView_WeightSumCannotExceedLongMaxValue, (ushort.MaxValue).ToString(CultureInfo.CurrentCulture))); 11004Debug.Assert(weightSum <= (float)ushort.MaxValue); 11055if (weightSum > (float)ushort.MaxValue) 11057throw new InvalidOperationException(SR.GetString(SR.DataGridView_WeightSumCannotExceedLongMaxValue, (ushort.MaxValue).ToString(CultureInfo.CurrentCulture))); 11061Debug.Assert(weightSum <= (float)ushort.MaxValue); 13995if (weightSum > (float)ushort.MaxValue) 13997throw new InvalidOperationException(SR.GetString(SR.DataGridView_WeightSumCannotExceedLongMaxValue, (ushort.MaxValue).ToString(CultureInfo.CurrentCulture)));
System.Xml (6)
System\Xml\Cache\XPathNode.cs (3)
326Debug.Assert(info != null && idxParent <= UInt16.MaxValue); 395Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= UInt16.MaxValue, "Bad argument"); 412Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= UInt16.MaxValue, "Bad argument");
System\Xml\Cache\XPathNodeHelper.cs (1)
166Debug.Assert(idxNode <= UInt16.MaxValue);
System\Xml\Schema\DataTypeImplementation.cs (1)
3317static readonly FacetsChecker numeric10FacetsChecker = new Numeric10FacetsChecker(ushort.MinValue, ushort.MaxValue);
System\Xml\Schema\XmlValueConverter.cs (1)
852if (value < (int) UInt16.MinValue || value > (int) UInt16.MaxValue)
WindowsBase (15)
Base\MS\Internal\IO\Zip\ZipIOBlockManager.cs (1)
247return UInt16.MaxValue;
Base\MS\Internal\IO\Zip\ZipIOCentralDirectoryBlock.cs (1)
307return (Count >= UInt16.MaxValue) ||
Base\MS\Internal\IO\Zip\ZipIOCentralDirectoryFileHeader.cs (1)
96if (header._diskNumberStart == UInt16.MaxValue)
Base\MS\Internal\IO\Zip\ZipIOEndOfCentralDirectoryBlock.cs (5)
127UInt16 centralDirCount = UInt16.MaxValue; 284return ((_numberOfThisDisk == UInt16.MaxValue) || 285(_numberOfTheDiskWithTheStartOfTheCentralDirectory == UInt16.MaxValue) || 286(_totalNumberOfEntriesInTheCentralDirectoryOnThisDisk == UInt16.MaxValue) || 287(_totalNumberOfEntriesInTheCentralDirectory == UInt16.MaxValue) ||
Base\MS\Internal\IO\Zip\ZipIOExtraField.cs (2)
176if (Math.Abs(size) > UInt16.MaxValue) 221if ((_paddingElement.PaddingSize - size) > UInt16.MaxValue)
Base\MS\Internal\IO\Zip\ZipIOZip64EndOfCentralDirectoryBlock.cs (5)
281(_sizeOfZip64EndOfCentralDirectory > UInt16.MaxValue)) 334if (zipIoEocd.NumberOfThisDisk < UInt16.MaxValue) 337if (zipIoEocd.NumberOfTheDiskWithTheStartOfTheCentralDirectory < UInt16.MaxValue) 340if (zipIoEocd.TotalNumberOfEntriesInTheCentralDirectoryOnThisDisk < UInt16.MaxValue) 343if (zipIoEocd.TotalNumberOfEntriesInTheCentralDirectory < UInt16.MaxValue)