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