8422 references to Contract
mscorlib (6476)
microsoft\win32\oavariantlib.cs (1)
104Contract.Requires(ctype != null);
microsoft\win32\registrykey.cs (2)
1732Contract.Requires(path != null); 2152Contract.Ensures(name != null);
system\_localdatastore.cs (2)
220Contract.Assert(capacity >= m_DataTable.Length, "LocalDataStore corrupted: capacity >= m_DataTable.Length"); 233Contract.Assert(slotIdx < m_DataTable.Length, "LocalDataStore corrupted: slotIdx < m_DataTable.Length");
system\_localdatastoremgr.cs (1)
324Contract.EndContractBlock();
system\activationarguments.cs (3)
58Contract.EndContractBlock(); 70Contract.EndContractBlock(); 83Contract.EndContractBlock();
system\activationcontext.cs (5)
81Contract.EndContractBlock(); 113Contract.Assert(_definitionIdentities.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey"); 126Contract.EndContractBlock(); 182Contract.Assert(_manifests.Count == 2, "An application must have exactly 1 deployment component and 1 application component in Whidbey"); 496Contract.EndContractBlock();
system\activator.cs (10)
75Contract.EndContractBlock(); 185Contract.EndContractBlock(); 433Contract.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled || securityInfo == null); 468Contract.EndContractBlock(); 486Contract.EndContractBlock(); 511Contract.EndContractBlock(); 537Contract.EndContractBlock(); 557Contract.EndContractBlock(); 584Contract.EndContractBlock(); 686Contract.EndContractBlock();
system\appdomain.cs (71)
391Contract.Assert(s_flags != 0); 498Contract.Assert(_domainManager == null, "_domainManager == null"); 610Contract.Assert(!_compatFlagsInitialized); 635Contract.Assert(attrs.Length == 1); 825Contract.Assert(assembly != null, "assembly != null"); 826Contract.Assert(type != null, "type != null"); 885Contract.Requires(fullName != null, "fullName != null"); 1036Contract.Requires(providedSecurityInfo != null); 1054Contract.Requires(activationContext != null); 1157Contract.Requires(args != null); 1175Contract.Requires(args != null); 1218Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1232Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1249Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1267Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1287Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1309Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1332Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1352Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1377Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1404Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1433Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1462Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1486Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 1561Contract.EndContractBlock(); 1582Contract.EndContractBlock(); 1607Contract.EndContractBlock(); 1623Contract.EndContractBlock(); 1644Contract.EndContractBlock(); 1661Contract.EndContractBlock(); 1685Contract.EndContractBlock(); 1722Contract.EndContractBlock(); 1746Contract.Assert(IsLegacyCasPolicyEnabled || securityAttributes == null); 1772Contract.EndContractBlock(); 1806Contract.EndContractBlock(); 1832Contract.Assert(IsLegacyCasPolicyEnabled || securityAttributes == null); 2106Contract.Ensures(Contract.Result<AppDomain>() != null); 2362Contract.EndContractBlock(); 2478Contract.EndContractBlock(); 2542Contract.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()"); 2584Contract.EndContractBlock(); 2609Contract.EndContractBlock(); 2673Contract.EndContractBlock(); 2713Contract.EndContractBlock(); 2902Contract.Assert( !(obj is IPermission), "IPermission should be xml deserialized" ); 2903Contract.Assert( !(obj is PermissionSet), "PermissionSet should be xml deserialized" ); 3222Contract.Assert(_FusionStore != null, 3419Contract.EndContractBlock(); 3467Contract.EndContractBlock(); 3517Contract.Requires(info != null); 3729Contract.Requires(arg != null && arg is Object[]); 3730Contract.Requires(((Object[])arg).Length >= 8); 4210Contract.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified, 4471Contract.Assert(evidence != null); 4472Contract.Assert(IsHomogenous); 4473Contract.Assert(evidence.GetHostEvidence<GacInstalled>() == null); 4703Contract.Assert(i != -1, "invalid image location");
system\appdomainmanager.cs (1)
65Contract.EndContractBlock();
system\AppDomainSetup.cs (19)
216Contract.EndContractBlock(); 221Contract.Assert(activationArguments.ActivationContext != null, "Cannot set base directory without activation context"); 651Contract.EndContractBlock(); 1339Contract.Assert('A' == ACTAG_APP_CONFIG_FILE[0] , "Assumption violated"); 1340Contract.Assert('A' == ACTAG_APP_NAME[0] , "Assumption violated"); 1341Contract.Assert('A' == ACTAG_APP_BASE_URL[0] , "Assumption violated"); 1342Contract.Assert('B' == ACTAG_BINPATH_PROBE_ONLY[0] , "Assumption violated"); 1343Contract.Assert('C' == ACTAG_APP_CACHE_BASE[0] , "Assumption violated"); 1344Contract.Assert('D' == ACTAG_DEV_PATH[0] , "Assumption violated"); 1345Contract.Assert('D' == ACTAG_APP_DYNAMIC_BASE[0] , "Assumption violated"); 1346Contract.Assert('F' == ACTAG_FORCE_CACHE_INSTALL[0] , "Assumption violated"); 1347Contract.Assert('L' == LICENSE_FILE[0] , "Assumption violated"); 1348Contract.Assert('P' == ACTAG_APP_PRIVATE_BINPATH[0] , "Assumption violated"); 1349Contract.Assert('S' == ACTAG_APP_SHADOW_COPY_DIRS[0], "Assumption violated"); 1350Contract.Assert('D' == ACTAG_DISALLOW_APPLYPUBLISHERPOLICY[0], "Assumption violated"); 1351Contract.Assert('C' == ACTAG_CODE_DOWNLOAD_DISABLED[0], "Assumption violated"); 1352Contract.Assert('D' == ACTAG_DISALLOW_APP_BINDING_REDIRECTS[0], "Assumption violated"); 1353Contract.Assert('D' == ACTAG_DISALLOW_APP_BASE_PROBING[0], "Assumption violated"); 1354Contract.Assert('A' == ACTAG_APP_CONFIG_BLOB[0], "Assumption violated");
system\applicationactivator.cs (2)
132Contract.EndContractBlock(); 154Contract.EndContractBlock();
system\applicationid.cs (1)
45Contract.EndContractBlock();
system\argumentexception.cs (1)
92Contract.EndContractBlock();
system\argumentoutofrangeexception.cs (1)
99Contract.EndContractBlock();
system\array.cs (166)
43Contract.Ensures(Contract.Result<ReadOnlyCollection<T>>() != null); 53Contract.Ensures(Contract.ValueAtReturn(out array) != null); 54Contract.Ensures(Contract.ValueAtReturn(out array).Length == newSize); 55Contract.EndContractBlock(); 78Contract.Ensures(Contract.Result<Array>() != null); 79Contract.Ensures(Contract.Result<Array>().Length == length); 80Contract.Ensures(Contract.Result<Array>().Rank == 1); 81Contract.EndContractBlock(); 96Contract.Ensures(Contract.Result<Array>() != null); 97Contract.Ensures(Contract.Result<Array>().Rank == 2); 98Contract.Ensures(Contract.Result<Array>().GetLength(0) == length1); 99Contract.Ensures(Contract.Result<Array>().GetLength(1) == length2); 121Contract.Ensures(Contract.Result<Array>() != null); 122Contract.Ensures(Contract.Result<Array>().Rank == 3); 123Contract.Ensures(Contract.Result<Array>().GetLength(0) == length1); 124Contract.Ensures(Contract.Result<Array>().GetLength(1) == length2); 125Contract.Ensures(Contract.Result<Array>().GetLength(2) == length3); 146Contract.Ensures(Contract.Result<Array>() != null); 147Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length); 148Contract.EndContractBlock(); 173Contract.Ensures(Contract.Result<Array>() != null); 174Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length); 175Contract.EndContractBlock(); 204Contract.Ensures(Contract.Result<Array>() != null); 205Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length); 206Contract.EndContractBlock(); 282Contract.EndContractBlock(); 359Contract.EndContractBlock(); 372Contract.EndContractBlock(); 384Contract.EndContractBlock(); 400Contract.EndContractBlock(); 417Contract.EndContractBlock(); 429Contract.EndContractBlock(); 443Contract.EndContractBlock(); 455Contract.EndContractBlock(); 476Contract.EndContractBlock(); 488Contract.EndContractBlock(); 504Contract.EndContractBlock(); 523Contract.EndContractBlock(); 536Contract.EndContractBlock(); 548Contract.EndContractBlock(); 562Contract.EndContractBlock(); 574Contract.EndContractBlock(); 614Contract.Requires(low <= hi); 615Contract.Assert( hi - low >= 0, "Length overflow!"); 815Contract.EndContractBlock(); 844Contract.Ensures((Contract.Result<int>() >= array.GetLowerBound(0) && Contract.Result<int>() <= array.GetUpperBound(0)) || (Contract.Result<int>() < array.GetLowerBound(0) && ~Contract.Result<int>() <= array.GetUpperBound(0) + 1)); 845Contract.EndContractBlock(); 888Contract.EndContractBlock(); 914Contract.EndContractBlock(); 990Contract.EndContractBlock(); 999Contract.EndContractBlock(); 1018Contract.EndContractBlock(); 1039Contract.Ensures(Contract.Result<TOutput[]>() != null); 1040Contract.Ensures(Contract.Result<TOutput[]>().Length == array.Length); 1041Contract.EndContractBlock(); 1062Contract.EndContractBlock(); 1073Contract.EndContractBlock(); 1082Contract.Ensures(Contract.Result<T[]>() != null); 1083Contract.Ensures(Contract.Result<T[]>().Length == 0); 1084Contract.EndContractBlock(); 1101Contract.EndContractBlock(); 1119Contract.EndContractBlock(); 1134Contract.Ensures(Contract.Result<int>() < array.Length); 1135Contract.EndContractBlock(); 1144Contract.Ensures(Contract.Result<int>() < array.Length); 1145Contract.EndContractBlock(); 1166Contract.Ensures(Contract.Result<int>() < array.Length); 1167Contract.EndContractBlock(); 1184Contract.EndContractBlock(); 1198Contract.EndContractBlock(); 1207Contract.EndContractBlock(); 1220Contract.EndContractBlock(); 1257Contract.EndContractBlock(); 1285Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1286Contract.EndContractBlock(); 1301Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1302Contract.EndContractBlock(); 1320Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1321Contract.EndContractBlock(); 1374Contract.Ensures((Contract.Result<int>() < 0) || 1375(Contract.Result<int>() >= 0 && Contract.Result<int>() < array.Length && EqualityComparer<T>.Default.Equals(value, array[Contract.Result<int>()]))); 1376Contract.EndContractBlock(); 1385Contract.Ensures(Contract.Result<int>() < array.Length); 1386Contract.EndContractBlock(); 1403Contract.Ensures(Contract.Result<int>() < array.Length); 1404Contract.EndContractBlock(); 1425Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1426Contract.EndContractBlock(); 1440Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1441Contract.EndContractBlock(); 1457Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length); 1458Contract.EndContractBlock(); 1513Contract.Ensures(Contract.Result<int>() < array.Length); 1514Contract.EndContractBlock(); 1523Contract.Ensures(Contract.Result<int>() < array.Length); 1524Contract.EndContractBlock(); 1533Contract.Ensures(Contract.Result<int>() < array.Length); 1534Contract.EndContractBlock(); 1582Contract.EndContractBlock(); 1603Contract.EndContractBlock(); 1646Contract.EndContractBlock(); 1660Contract.EndContractBlock(); 1694Contract.EndContractBlock(); 1710Contract.EndContractBlock(); 1747Contract.EndContractBlock(); 1782Contract.EndContractBlock(); 1790Contract.EndContractBlock(); 1808Contract.EndContractBlock(); 1816Contract.EndContractBlock(); 1829Contract.EndContractBlock(); 1862Contract.EndContractBlock(); 1897Contract.EndContractBlock(); 1911Contract.EndContractBlock(); 2063Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 2380Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 2578Contract.Assert(array.Rank == 1 && array.GetLowerBound(0) == 0, "SZArrayEnumerator only works on single dimension arrays w/ a lower bound of zero."); 2738Contract.Assert(false, "Hey! How'd I get here?"); 2763Contract.EndContractBlock(); 2863Contract.Assert((array == null && endIndex == -1) || (array.Rank == 1 && array.GetLowerBound(0) == 0),
system\arraysegment.cs (23)
41Contract.EndContractBlock(); 58Contract.EndContractBlock(); 69Contract.Assert( (null == _array && 0 == _offset && 0 == _count) 86Contract.Ensures(Contract.Result<int>() >= 0); 88Contract.Assert( (null == _array && 0 == _offset && 0 == _count) 105Contract.Ensures(Contract.Result<int>() >= 0); 107Contract.Assert( (null == _array && 0 == _offset && 0 == _count) 154Contract.EndContractBlock(); 165Contract.EndContractBlock(); 175Contract.EndContractBlock(); 179Contract.Assert(index == -1 || 205Contract.EndContractBlock(); 237Contract.EndContractBlock(); 241Contract.Assert(index == -1 || 251Contract.EndContractBlock(); 267Contract.EndContractBlock(); 278Contract.EndContractBlock(); 294Contract.Requires(arraySegment.Array != null); 295Contract.Requires(arraySegment.Offset >= 0); 296Contract.Requires(arraySegment.Count >= 0); 297Contract.Requires(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
system\attribute.cs (28)
30Contract.Requires(element != null); 31Contract.Requires(type != null); 32Contract.Requires(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 95Contract.Requires(property != null); 138Contract.Requires(element != null); 139Contract.Requires(type != null); 140Contract.Requires(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 169Contract.Requires(ev != null); 187Contract.Requires(element != null); 218Contract.Requires(param != null); 239Contract.Requires(param != null); 329Contract.Requires(param != null); 330Contract.Requires(type != null); 465Contract.EndContractBlock(); 489Contract.EndContractBlock(); 520Contract.EndContractBlock(); 581Contract.EndContractBlock(); 598Contract.EndContractBlock(); 623Contract.EndContractBlock(); 639Contract.Assert(false, "Invalid type for ParameterInfo member in Attribute class"); 684Contract.EndContractBlock(); 699Contract.EndContractBlock(); 720Contract.EndContractBlock(); 763Contract.EndContractBlock(); 777Contract.EndContractBlock(); 798Contract.EndContractBlock(); 889Contract.Assert(thisValueArray.Rank == 1 && thatValueArray.Rank == 1); 903Contract.Assert(!(thisValue is Attribute));
system\bitconverter.cs (60)
42Contract.Ensures(Contract.Result<byte[]>() != null); 43Contract.Ensures(Contract.Result<byte[]>().Length == 1); 53Contract.Ensures(Contract.Result<byte[]>() != null); 54Contract.Ensures(Contract.Result<byte[]>().Length == 2); 64Contract.Ensures(Contract.Result<byte[]>() != null); 65Contract.Ensures(Contract.Result<byte[]>().Length == 2); 78Contract.Ensures(Contract.Result<byte[]>() != null); 79Contract.Ensures(Contract.Result<byte[]>().Length == 4); 92Contract.Ensures(Contract.Result<byte[]>() != null); 93Contract.Ensures(Contract.Result<byte[]>().Length == 8); 105Contract.Ensures(Contract.Result<byte[]>() != null); 106Contract.Ensures(Contract.Result<byte[]>().Length == 2); 115Contract.Ensures(Contract.Result<byte[]>() != null); 116Contract.Ensures(Contract.Result<byte[]>().Length == 4); 125Contract.Ensures(Contract.Result<byte[]>() != null); 126Contract.Ensures(Contract.Result<byte[]>().Length == 8); 136Contract.Ensures(Contract.Result<byte[]>() != null); 137Contract.Ensures(Contract.Result<byte[]>().Length == 4); 147Contract.Ensures(Contract.Result<byte[]>() != null); 148Contract.Ensures(Contract.Result<byte[]>().Length == 8); 167Contract.EndContractBlock(); 186Contract.EndContractBlock(); 218Contract.EndContractBlock(); 249Contract.EndContractBlock(); 282Contract.EndContractBlock(); 298Contract.EndContractBlock(); 314Contract.EndContractBlock(); 329Contract.EndContractBlock(); 345Contract.EndContractBlock(); 352Contract.Assert( i >=0 && i <16, "i is out of range."); 377Contract.EndContractBlock(); 408Contract.Ensures(Contract.Result<String>() != null); 409Contract.EndContractBlock(); 417Contract.Ensures(Contract.Result<String>() != null); 418Contract.EndContractBlock(); 438Contract.EndContractBlock(); 450Contract.Assert(IsLittleEndian, "This method is implemented assuming little endian with an ambiguous spec."); 461Contract.Assert(IsLittleEndian, "This method is implemented assuming little endian with an ambiguous spec.");
system\boolean.cs (1)
160Contract.EndContractBlock();
system\buffer.cs (12)
73Contract.Assert(src != null, "src should not be null"); 245Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 246Contract.Assert(dest.Length - destIndex >= len, "not enough bytes in dest"); 260Contract.Assert( (srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); 261Contract.Assert(src.Length - srcIndex >= len, "not enough bytes in src"); 290Contract.Assert(len >= 0, "Negative length in memcopy!"); 330Contract.Assert(len > 16 && len <= 64); 369Contract.Assert(len > 16 && len <= 64); 386Contract.Assert(len >= 8 && len <= 16); 401Contract.Assert(len >= 4 && len < 8); 408Contract.Assert(len < 4); 423Contract.Assert(len > 64 && len <= CopyThreshold);
system\byte.cs (8)
154Contract.Ensures(Contract.Result<String>() != null); 161Contract.Ensures(Contract.Result<String>() != null); 168Contract.Ensures(Contract.Result<String>() != null); 175Contract.Ensures(Contract.Result<String>() != null);
system\cfgparser.cs (1)
260Contract.EndContractBlock();
system\char.cs (30)
93Contract.Assert(IsLatin1(ch), "Char.GetLatin1UnicodeCategory(): ch should be <= 007f"); 151Contract.Ensures(Contract.Result<String>() != null); 157Contract.Ensures(Contract.Result<String>() != null); 171Contract.Ensures(Contract.Result<String>() != null); 179Contract.EndContractBlock(); 375Contract.EndContractBlock(); 404Contract.EndContractBlock(); 522Contract.EndContractBlock(); 538Contract.EndContractBlock(); 553Contract.EndContractBlock(); 572Contract.EndContractBlock(); 587Contract.EndContractBlock(); 631Contract.EndContractBlock(); 657Contract.EndContractBlock(); 702Contract.EndContractBlock(); 725Contract.EndContractBlock(); 759Contract.EndContractBlock(); 774Contract.EndContractBlock(); 793Contract.EndContractBlock(); 817Contract.EndContractBlock(); 836Contract.EndContractBlock(); 857Contract.EndContractBlock(); 877Contract.EndContractBlock(); 892Contract.EndContractBlock(); 928Contract.EndContractBlock(); 954Contract.EndContractBlock(); 974Contract.EndContractBlock();
system\charenumerator.cs (1)
30Contract.Requires(str != null);
system\collections\arraylist.cs (118)
74Contract.EndContractBlock(); 89Contract.EndContractBlock(); 108Contract.Ensures(Contract.Result<int>() >= Count); 115Contract.Ensures(Capacity >= 0); 116Contract.EndContractBlock(); 137Contract.Ensures(Contract.Result<int>() >= 0); 172Contract.EndContractBlock(); 177Contract.EndContractBlock(); 194Contract.Ensures(Contract.Result<ArrayList>() != null); 195Contract.EndContractBlock(); 204Contract.Ensures(Contract.Result<int>() >= 0); 246Contract.Ensures(Contract.Result<int>() < Count); 247Contract.Ensures(Contract.Result<int>() < index + count); 248Contract.EndContractBlock(); 255Contract.Ensures(Contract.Result<int>() < Count); 261Contract.Ensures(Contract.Result<int>() < Count); 281Contract.Ensures(Contract.Result<Object>() != null); 322Contract.EndContractBlock(); 336Contract.EndContractBlock(); 362Contract.Ensures(Contract.Result<IList>() != null); 363Contract.EndContractBlock(); 373Contract.Ensures(Contract.Result<ArrayList>() != null); 374Contract.EndContractBlock(); 384Contract.Ensures(Contract.Result<IEnumerator>() != null); 400Contract.Ensures(Contract.Result<IEnumerator>() != null); 401Contract.EndContractBlock(); 415Contract.Ensures(Contract.Result<int>() < Count); 431Contract.Ensures(Contract.Result<int>() < Count); 432Contract.EndContractBlock(); 449Contract.Ensures(Contract.Result<int>() < Count); 450Contract.EndContractBlock(); 462Contract.EndContractBlock(); 483Contract.EndContractBlock(); 511Contract.Ensures(Contract.Result<int>() < _size); 528Contract.Ensures(Contract.Result<int>() < Count); 529Contract.EndContractBlock(); 545Contract.Ensures(Contract.Result<int>() < Count); 546Contract.EndContractBlock(); 565Contract.Ensures(Contract.Result<IList>() != null); 566Contract.EndContractBlock(); 575Contract.Ensures(Contract.Result<ArrayList>() != null); 576Contract.EndContractBlock(); 584Contract.Ensures(Count >= 0); 597Contract.Ensures(Count >= 0); 599Contract.EndContractBlock(); 618Contract.Ensures(Count >= 0); 620Contract.EndContractBlock(); 638Contract.Ensures(Contract.Result<ArrayList>() != null); 639Contract.EndContractBlock(); 667Contract.EndContractBlock(); 677Contract.EndContractBlock(); 692Contract.Ensures(Contract.Result<ArrayList>() != null); 693Contract.EndContractBlock(); 726Contract.EndContractBlock(); 738Contract.Ensures(Contract.Result<IList>() != null); 739Contract.EndContractBlock(); 749Contract.Ensures(Contract.Result<ArrayList>() != null); 750Contract.EndContractBlock(); 757Contract.Ensures(Contract.Result<Object[]>() != null); 773Contract.Ensures(Contract.Result<Array>() != null); 774Contract.EndContractBlock(); 810Contract.EndContractBlock(); 862Contract.EndContractBlock(); 920Contract.EndContractBlock(); 936Contract.EndContractBlock(); 955Contract.EndContractBlock(); 980Contract.EndContractBlock(); 1045Contract.EndContractBlock(); 1061Contract.EndContractBlock(); 1080Contract.EndContractBlock(); 1098Contract.EndContractBlock(); 1107Contract.EndContractBlock(); 1132Contract.EndContractBlock(); 1814Contract.EndContractBlock(); 2070Contract.EndContractBlock(); 2198Contract.EndContractBlock(); 2215Contract.EndContractBlock(); 2230Contract.EndContractBlock(); 2277Contract.EndContractBlock(); 2294Contract.EndContractBlock(); 2328Contract.EndContractBlock(); 2339Contract.EndContractBlock(); 2364Contract.EndContractBlock(); 2378Contract.EndContractBlock(); 2388Contract.EndContractBlock(); 2401Contract.EndContractBlock(); 2444Contract.EndContractBlock(); 2457Contract.EndContractBlock(); 2474Contract.EndContractBlock(); 2496Contract.EndContractBlock(); 2528Contract.EndContractBlock();
system\collections\bitarray.cs (23)
49Contract.EndContractBlock(); 74Contract.EndContractBlock(); 95Contract.Assert(bytes.Length - j >= 0, "BitArray byteLength problem"); 96Contract.Assert(bytes.Length - j < 4, "BitArray byteLength problem #2"); 119Contract.EndContractBlock(); 145Contract.EndContractBlock(); 168Contract.EndContractBlock(); 198Contract.EndContractBlock(); 213Contract.EndContractBlock(); 248Contract.EndContractBlock(); 270Contract.EndContractBlock(); 292Contract.EndContractBlock(); 320Contract.Ensures(Contract.Result<int>() >= 0); 327Contract.EndContractBlock(); 366Contract.EndContractBlock(); 399Contract.Ensures(Contract.Result<int>() >= 0); 407Contract.Ensures(Contract.Result<Object>() != null); 408Contract.Ensures(((BitArray)Contract.Result<Object>()).Length == this.Length); 469Contract.Assert(div > 0, "GetArrayLength: div arg must be greater than 0");
system\collections\caseinsensitivecomparer.cs (5)
36Contract.EndContractBlock(); 44Contract.Ensures(Contract.Result<CaseInsensitiveComparer>() != null); 54Contract.Ensures(Contract.Result<CaseInsensitiveComparer>() != null);
system\collections\caseinsensitivehashcodeprovider.cs (6)
42Contract.EndContractBlock(); 50Contract.Ensures(Contract.Result<CaseInsensitiveHashCodeProvider>() != null); 60Contract.Ensures(Contract.Result<CaseInsensitiveHashCodeProvider>() != null); 73Contract.EndContractBlock();
system\collections\collectionbase.cs (5)
68Contract.EndContractBlock(); 107Contract.EndContractBlock(); 113Contract.EndContractBlock(); 169Contract.EndContractBlock(); 200Contract.EndContractBlock();
system\collections\comparer.cs (2)
43Contract.EndContractBlock(); 93Contract.EndContractBlock();
system\collections\compatiblecomparer.cs (1)
46Contract.EndContractBlock();
system\Collections\Concurrent\ConcurrentDictionary.cs (1)
2106Contract.Assert(condition);
system\Collections\Concurrent\ConcurrentQueue.cs (7)
83Contract.Assert(index >= 0 && index < SEGMENT_SIZE); 131Contract.Assert(m_serializationArray != null); 695Contract.Assert(index >= 0); 727Contract.Assert(m_high < SEGMENT_SIZE - 1); 743Contract.Assert(m_high >= SEGMENT_SIZE - 1); 759Contract.Assert(m_source.m_tail == this); 866Contract.Assert(m_source.m_head == this);
system\Collections\Concurrent\ConcurrentStack.cs (1)
147Contract.Assert(m_serializationArray != null);
system\collections\concurrent\PartitionerStatic.cs (29)
439Contract.Assert(m_currentChunkSize == null); 457Contract.Assert(m_localOffset.Value == m_currentChunkSize.Value - 1 || m_currentChunkSize.Value == 0); 478Contract.Assert(requestedChunkSize > 0 && requestedChunkSize <= m_maxChunkSize); 482Contract.Assert(m_currentChunkSize.Value <= requestedChunkSize && m_currentChunkSize.Value > 0); 723Contract.Assert(m_useSingleChunking, "Expected m_useSingleChecking to be true"); 724Contract.Assert(requestedChunkSize == 1, "Got requested chunk size of " + requestedChunkSize + " when single-chunking was on"); 725Contract.Assert(actualNumElementsGrabbed == 0, "Expected actualNumElementsGrabbed == 0, instead it is " + actualNumElementsGrabbed); 726Contract.Assert(destArray.Length == 1, "Expected destArray to be of length 1, instead its length is " + destArray.Length); 772Contract.Assert(requestedChunkSize > 0); 773Contract.Assert(!m_useSingleChunking, "Did not expect to be in single-chunking mode"); 811Contract.Assert(m_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk 948Contract.Assert(requestedChunkSize > 0); 981Contract.Assert(value); 982Contract.Assert(!m_hasNoElementsLeft.Value); 996Contract.Assert(m_localList != null); 997Contract.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value); 1135Contract.Assert(requestedChunkSize > 0); 1139Contract.Assert(m_sharedIndex != null); 1181Contract.Assert(m_sharedIndex != null); 1187Contract.Assert(false); 1276Contract.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value); 1360Contract.Assert(m_localOffset.Value >= 0 && m_localOffset.Value < m_currentChunkSize.Value); 1547Contract.Assert(list != null); 1573Contract.Assert(startIndex >= 0 && endIndex <= list.Count - 1); 1587Contract.Assert(m_offset >= m_startIndex && m_offset <= m_endIndex); 1605Contract.Assert(array != null); 1630Contract.Assert(startIndex >= 0 && endIndex <= array.Length - 1); 1644Contract.Assert(m_offset >= m_startIndex && m_offset <= m_endIndex); 1731Contract.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
system\collections\emptyreadonlydictionaryinternal.cs (4)
51Contract.EndContractBlock(); 81Contract.EndContractBlock(); 94Contract.EndContractBlock(); 126Contract.EndContractBlock();
system\collections\generic\arraysorthelper.cs (154)
130Contract.Assert(keys != null, "Check the arguments in the caller!"); 131Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 190Contract.Requires(array != null, "Check the arguments in the caller!"); 191Contract.Requires(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 263Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 295Contract.Requires(keys != null); 296Contract.Requires(comparer != null); 297Contract.Requires(left >= 0); 298Contract.Requires(length >= 0); 299Contract.Requires(length <= keys.Length); 300Contract.Requires(length + left <= keys.Length); 310Contract.Requires(keys != null); 311Contract.Requires(comparer != null); 312Contract.Requires(lo >= 0); 313Contract.Requires(hi < keys.Length); 357Contract.Requires(keys != null); 358Contract.Requires(comparer != null); 359Contract.Requires(lo >= 0); 360Contract.Requires(hi > lo); 361Contract.Requires(hi < keys.Length); 362Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi); 394Contract.Requires(keys != null); 395Contract.Requires(comparer != null); 396Contract.Requires(lo >= 0); 397Contract.Requires(hi > lo); 398Contract.Requires(hi < keys.Length); 414Contract.Requires(keys != null); 415Contract.Requires(comparer != null); 416Contract.Requires(lo >= 0); 417Contract.Requires(lo < keys.Length); 438Contract.Requires(keys != null); 439Contract.Requires(lo >= 0); 440Contract.Requires(hi >= lo); 441Contract.Requires(hi <= keys.Length); 470Contract.Assert(keys != null, "Check the arguments in the caller!"); 471Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 535Contract.Assert(array != null, "Check the arguments in the caller!"); 536Contract.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 597Contract.Requires(keys != null); 598Contract.Requires(0 <= a && a < keys.Length); 599Contract.Requires(0 <= b && b < keys.Length); 624Contract.Requires(keys != null); 625Contract.Requires(0 <= left && left < keys.Length); 626Contract.Requires(0 <= right && right < keys.Length); 664Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 696Contract.Requires(keys != null); 697Contract.Requires(left >= 0); 698Contract.Requires(length >= 0); 699Contract.Requires(length <= keys.Length); 700Contract.Requires(length + left <= keys.Length); 710Contract.Requires(keys != null); 711Contract.Requires(lo >= 0); 712Contract.Requires(hi < keys.Length); 756Contract.Requires(keys != null); 757Contract.Requires(lo >= 0); 758Contract.Requires(hi > lo); 759Contract.Requires(hi < keys.Length); 760Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi); 800Contract.Requires(keys != null); 801Contract.Requires(lo >= 0); 802Contract.Requires(hi > lo); 803Contract.Requires(hi < keys.Length); 819Contract.Requires(keys != null); 820Contract.Requires(lo >= 0); 821Contract.Requires(lo < keys.Length); 842Contract.Requires(keys != null); 843Contract.Requires(lo >= 0); 844Contract.Requires(hi >= lo); 845Contract.Requires(hi <= keys.Length); 906Contract.Assert(keys != null, "Check the arguments in the caller!"); // Precondition on interface method 907Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 947Contract.Requires(keys != null); 948Contract.Requires(values == null || values.Length >= keys.Length); 949Contract.Requires(comparer != null); 950Contract.Requires(0 <= a && a < keys.Length); 951Contract.Requires(0 <= b && b < keys.Length); 1012Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 1050Contract.Requires(keys != null); 1051Contract.Requires(values != null); 1052Contract.Requires(comparer != null); 1053Contract.Requires(left >= 0); 1054Contract.Requires(length >= 0); 1055Contract.Requires(length <= keys.Length); 1056Contract.Requires(length + left <= keys.Length); 1057Contract.Requires(length + left <= values.Length); 1067Contract.Requires(keys != null); 1068Contract.Requires(values != null); 1069Contract.Requires(comparer != null); 1070Contract.Requires(lo >= 0); 1071Contract.Requires(hi < keys.Length); 1115Contract.Requires(keys != null); 1116Contract.Requires(values != null); 1117Contract.Requires(comparer != null); 1118Contract.Requires(lo >= 0); 1119Contract.Requires(hi > lo); 1120Contract.Requires(hi < keys.Length); 1121Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi); 1153Contract.Requires(keys != null); 1154Contract.Requires(values != null); 1155Contract.Requires(comparer != null); 1156Contract.Requires(lo >= 0); 1157Contract.Requires(hi > lo); 1158Contract.Requires(hi < keys.Length); 1174Contract.Requires(keys != null); 1175Contract.Requires(comparer != null); 1176Contract.Requires(lo >= 0); 1177Contract.Requires(lo < keys.Length); 1203Contract.Requires(keys != null); 1204Contract.Requires(values != null); 1205Contract.Requires(comparer != null); 1206Contract.Requires(lo >= 0); 1207Contract.Requires(hi >= lo); 1208Contract.Requires(hi <= keys.Length); 1238Contract.Assert(keys != null, "Check the arguments in the caller!"); 1239Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!"); 1369Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?"); 1407Contract.Requires(keys != null); 1408Contract.Requires(values != null); 1409Contract.Requires(left >= 0); 1410Contract.Requires(length >= 0); 1411Contract.Requires(length <= keys.Length); 1412Contract.Requires(length + left <= keys.Length); 1413Contract.Requires(length + left <= values.Length); 1423Contract.Requires(keys != null); 1424Contract.Requires(values != null); 1425Contract.Requires(lo >= 0); 1426Contract.Requires(hi < keys.Length); 1470Contract.Requires(keys != null); 1471Contract.Requires(values != null); 1472Contract.Requires(lo >= 0); 1473Contract.Requires(hi > lo); 1474Contract.Requires(hi < keys.Length); 1475Contract.Ensures(Contract.Result<int>() >= lo && Contract.Result<int>() <= hi); 1515Contract.Requires(keys != null); 1516Contract.Requires(values != null); 1517Contract.Requires(lo >= 0); 1518Contract.Requires(hi > lo); 1519Contract.Requires(hi < keys.Length); 1535Contract.Requires(keys != null); 1536Contract.Requires(lo >= 0); 1537Contract.Requires(lo < keys.Length); 1563Contract.Requires(keys != null); 1564Contract.Requires(values != null); 1565Contract.Requires(lo >= 0); 1566Contract.Requires(hi >= lo); 1567Contract.Requires(hi <= keys.Length);
system\collections\generic\comparer.cs (4)
26Contract.Ensures(Contract.Result<Comparer<T>>() != null); 33Contract.Ensures(Contract.Result<Comparer<T>>() != null);
system\collections\generic\debugview.cs (1)
116Contract.EndContractBlock();
system\collections\generic\dictionary.cs (5)
137Contract.Ensures(Contract.Result<KeyCollection>() != null); 159Contract.Ensures(Contract.Result<ValueCollection>() != null); 444Contract.Assert(newSize >= entries.Length);
system\collections\generic\equalitycomparer.cs (5)
30Contract.Ensures(Contract.Result<EqualityComparer<T>>() != null); 41Contract.Ensures(Contract.Result<EqualityComparer<T>>() != null); 357Contract.EndContractBlock();
system\collections\generic\list.cs (104)
62Contract.EndContractBlock(); 77Contract.EndContractBlock(); 112Contract.Ensures(Contract.Result<int>() >= 0); 119Contract.EndContractBlock(); 139Contract.Ensures(Contract.Result<int>() >= 0); 180Contract.EndContractBlock(); 188Contract.EndContractBlock(); 246Contract.Ensures(Count >= Contract.OldValue(Count)); 252Contract.Ensures(Contract.Result<ReadOnlyCollection<T>>() != null); 283Contract.Ensures(Contract.Result<int>() <= index + count); 284Contract.EndContractBlock(); 291Contract.Ensures(Contract.Result<int>() <= Count); 297Contract.Ensures(Contract.Result<int>() <= Count); 347Contract.EndContractBlock(); 371Contract.EndContractBlock(); 390Contract.EndContractBlock(); 424Contract.EndContractBlock(); 438Contract.EndContractBlock(); 450Contract.Ensures(Contract.Result<int>() >= -1); 451Contract.Ensures(Contract.Result<int>() < Count); 456Contract.Ensures(Contract.Result<int>() >= -1); 457Contract.Ensures(Contract.Result<int>() < startIndex + Count); 473Contract.Ensures(Contract.Result<int>() >= -1); 474Contract.Ensures(Contract.Result<int>() < startIndex + count); 475Contract.EndContractBlock(); 488Contract.EndContractBlock(); 499Contract.Ensures(Contract.Result<int>() >= -1); 500Contract.Ensures(Contract.Result<int>() < Count); 505Contract.Ensures(Contract.Result<int>() >= -1); 506Contract.Ensures(Contract.Result<int>() <= startIndex); 514Contract.Ensures(Contract.Result<int>() >= -1); 515Contract.Ensures(Contract.Result<int>() <= startIndex); 516Contract.EndContractBlock(); 549Contract.EndContractBlock(); 594Contract.Ensures(Contract.Result<List<T>>() != null); 595Contract.EndContractBlock(); 613Contract.Ensures(Contract.Result<int>() >= -1); 614Contract.Ensures(Contract.Result<int>() < Count); 638Contract.Ensures(Contract.Result<int>() >= -1); 639Contract.Ensures(Contract.Result<int>() < Count); 640Contract.EndContractBlock(); 658Contract.Ensures(Contract.Result<int>() >= -1); 659Contract.Ensures(Contract.Result<int>() < Count); 660Contract.EndContractBlock(); 674Contract.EndContractBlock(); 709Contract.EndContractBlock(); 755Contract.Ensures(Contract.Result<int>() >= -1); 756Contract.Ensures(Contract.Result<int>() < Count); 778Contract.Ensures(Contract.Result<int>() >= -1); 779Contract.Ensures(((Count == 0) && (Contract.Result<int>() == -1)) || ((Count > 0) && (Contract.Result<int>() <= index))); 780Contract.EndContractBlock(); 801Contract.Ensures(Contract.Result<int>() >= -1); 802Contract.Ensures(((Count == 0) && (Contract.Result<int>() == -1)) || ((Count > 0) && (Contract.Result<int>() <= index))); 803Contract.EndContractBlock(); 846Contract.Ensures(Contract.Result<int>() >= 0); 847Contract.Ensures(Contract.Result<int>() <= Contract.OldValue(Count)); 848Contract.EndContractBlock(); 881Contract.EndContractBlock(); 903Contract.EndContractBlock(); 940Contract.EndContractBlock(); 978Contract.EndContractBlock(); 988Contract.EndContractBlock(); 999Contract.Ensures(Contract.Result<T[]>() != null); 1000Contract.Ensures(Contract.Result<T[]>().Length == Count); 1027Contract.EndContractBlock();
system\collections\hashtable.cs (33)
277Contract.EndContractBlock(); 293Contract.Assert( loadsize < hashsize, "Invalid hashtable loadsize!"); 379Contract.EndContractBlock(); 389Contract.EndContractBlock(); 447Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 506Contract.EndContractBlock(); 559Contract.Requires(array != null); 560Contract.Requires(array.Rank == 1); 575Contract.Requires(array != null); 576Contract.Requires(array.Rank == 1); 600Contract.EndContractBlock(); 628Contract.Requires(array != null); 629Contract.Requires(array.Rank == 1); 648Contract.EndContractBlock(); 771Contract.Assert(loadsize < newsize, "Our current implementaion means this is not possible."); 823Contract.Assert(key != null, "key can't be null here!"); 880Contract.EndContractBlock(); 1041Contract.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect."); 1047Contract.Assert(hashcode >= 0, "hashcode >= 0"); // make sure collision bit (sign bit) wasn't set. 1078Contract.EndContractBlock(); 1079Contract.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 1142Contract.EndContractBlock(); 1155Contract.EndContractBlock(); 1314Contract.EndContractBlock(); 1355Contract.EndContractBlock(); 1411Contract.EndContractBlock(); 1470Contract.EndContractBlock(); 1639Contract.EndContractBlock(); 1721Contract.EndContractBlock(); 1753Contract.Assert( MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 1772Contract.Assert(comparer == null || comparer == System.Collections.Generic.EqualityComparer<string>.Default || comparer is IWellKnownStringEqualityComparer); 1788Contract.Assert(false, "Missing case in GetRandomizedEqualityComparer!"); 1827Contract.Assert(bufferSize % 8 == 0, "We increment our current index by 8, so our buffer size must be a multiple of 8");
system\collections\listdictionaryinternal.cs (7)
39Contract.EndContractBlock(); 54Contract.EndContractBlock(); 141Contract.EndContractBlock(); 188Contract.EndContractBlock(); 209Contract.EndContractBlock(); 229Contract.EndContractBlock(); 340Contract.EndContractBlock();
system\collections\objectmodel\keyedcollection.cs (1)
229Contract.Assert(key != null, "key shouldn't be null!");
system\collections\objectmodel\readonlydictionary.cs (5)
41Contract.EndContractBlock(); 51Contract.Ensures(Contract.Result<KeyCollection>() != null); 61Contract.Ensures(Contract.Result<ValueCollection>() != null);
system\collections\queue.cs (7)
63Contract.EndContractBlock(); 79Contract.EndContractBlock(); 144Contract.EndContractBlock(); 189Contract.EndContractBlock(); 205Contract.EndContractBlock(); 219Contract.EndContractBlock(); 459Contract.EndContractBlock();
system\collections\sortedlist.cs (18)
113Contract.EndContractBlock(); 170Contract.EndContractBlock(); 182Contract.EndContractBlock(); 203Contract.EndContractBlock(); 218Contract.Assert( _size == 0, "Size is not zero"); 337Contract.EndContractBlock(); 374Contract.EndContractBlock(); 400Contract.EndContractBlock(); 448Contract.EndContractBlock(); 469Contract.EndContractBlock(); 502Contract.EndContractBlock(); 528Contract.EndContractBlock(); 539Contract.EndContractBlock(); 683Contract.EndContractBlock(); 868Contract.EndContractBlock(); 894Contract.EndContractBlock(); 955Contract.EndContractBlock(); 1000Contract.EndContractBlock();
system\collections\stack.cs (17)
50Contract.EndContractBlock(); 65Contract.EndContractBlock(); 73Contract.Ensures(Contract.Result<int>() >= 0); 99Contract.Ensures(Contract.Result<Object>() != null); 133Contract.EndContractBlock(); 153Contract.Ensures(Contract.Result<IEnumerator>() != null); 162Contract.EndContractBlock(); 172Contract.EndContractBlock(); 198Contract.Ensures(Contract.Result<Stack>() != null); 199Contract.EndContractBlock(); 207Contract.Ensures(Contract.Result<Object[]>() != null); 369Contract.EndContractBlock();
system\console.cs (40)
115Contract.Ensures(Contract.Result<Object>() != null); 133Contract.Ensures(Contract.Result<Object>() != null); 272Contract.Ensures(Contract.Result<TextReader>() != null); 306Contract.Ensures(Contract.Result<TextWriter>() != null); 317Contract.Ensures(Contract.Result<TextWriter>() != null); 381Contract.Assert((stdout && _out != null) || (!stdout && _error != null), "Didn't set Console::_out or _error appropriately!"); 464Contract.Assert(false, "Unexpected handleType value (" + handleType + ")"); 545Contract.Ensures(Contract.Result<Encoding>() != null); 569Contract.EndContractBlock(); 598Contract.Ensures(Contract.Result<Encoding>() != null); 620Contract.EndContractBlock(); 669Contract.EndContractBlock(); 722Contract.EndContractBlock(); 771Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 812Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 837Contract.Assert(_haveReadDefaultColors, "Setting the foreground color before we've read the default foreground color!"); 865Contract.EndContractBlock(); 927Contract.Assert(numWritten == sourceWidth, "FillConsoleOutputCharacter wrote the wrong number of chars!"); 995Contract.Assert((int)Win32Native.Color.ColorMask == 0xff, "Make sure one byte is large enough to store a Console color value!"); 1097Contract.EndContractBlock(); 1281Contract.EndContractBlock(); 1323Contract.EndContractBlock(); 1396Contract.Assert(title.Length == titleLength); 1409Contract.EndContractBlock(); 1759Contract.Assert(false, "ThreadPool.QueueUserWorkItem returned false without throwing. Unable to execute ControlC handler"); 1769Contract.Assert(false, "ThreadPool.QueueUserWorkItem did not execute the handler within 30 seconds."); 1829Contract.Assert(_cancelCallbacks == null || _cancelCallbacks.GetInvocationList().Length > 0, "Teach Console::CancelKeyPress to handle a non-null but empty list of callbacks"); 1852Contract.EndContractBlock(); 1873Contract.EndContractBlock(); 1894Contract.EndContractBlock(); 1909Contract.EndContractBlock(); 1930Contract.EndContractBlock(); 1953Contract.EndContractBlock();
system\consolekeyinfo.cs (1)
32Contract.EndContractBlock();
system\convert.cs (150)
262Contract.Requires(value != null, "[Convert.DefaultToType]value!=null"); 266Contract.EndContractBlock(); 329Contract.EndContractBlock(); 498Contract.EndContractBlock(); 508Contract.EndContractBlock(); 519Contract.EndContractBlock(); 526Contract.EndContractBlock(); 532Contract.EndContractBlock(); 539Contract.EndContractBlock(); 554Contract.EndContractBlock(); 617Contract.EndContractBlock(); 624Contract.EndContractBlock(); 631Contract.EndContractBlock(); 638Contract.EndContractBlock(); 645Contract.EndContractBlock(); 652Contract.EndContractBlock(); 659Contract.EndContractBlock(); 666Contract.EndContractBlock(); 726Contract.EndContractBlock(); 733Contract.EndContractBlock(); 739Contract.EndContractBlock(); 746Contract.EndContractBlock(); 752Contract.EndContractBlock(); 759Contract.EndContractBlock(); 765Contract.EndContractBlock(); 772Contract.EndContractBlock(); 825Contract.EndContractBlock(); 841Contract.EndContractBlock(); 847Contract.EndContractBlock(); 854Contract.EndContractBlock(); 864Contract.EndContractBlock(); 871Contract.EndContractBlock(); 934Contract.EndContractBlock(); 946Contract.EndContractBlock(); 953Contract.EndContractBlock(); 965Contract.EndContractBlock(); 973Contract.EndContractBlock(); 980Contract.EndContractBlock(); 1062Contract.EndContractBlock(); 1072Contract.EndContractBlock(); 1079Contract.EndContractBlock(); 1159Contract.EndContractBlock(); 1171Contract.EndContractBlock(); 1183Contract.EndContractBlock(); 1195Contract.EndContractBlock(); 1202Contract.EndContractBlock(); 1299Contract.EndContractBlock(); 1366Contract.EndContractBlock(); 1378Contract.EndContractBlock(); 1390Contract.EndContractBlock(); 1402Contract.EndContractBlock(); 1812Contract.Ensures(Contract.Result<string>() != null); 1817Contract.Ensures(Contract.Result<string>() != null); 1822Contract.Ensures(Contract.Result<string>() != null); 1827Contract.Ensures(Contract.Result<string>() != null); 1833Contract.Ensures(Contract.Result<string>() != null); 1839Contract.Ensures(Contract.Result<string>() != null); 1844Contract.Ensures(Contract.Result<string>() != null); 1849Contract.Ensures(Contract.Result<string>() != null); 1854Contract.Ensures(Contract.Result<string>() != null); 1859Contract.Ensures(Contract.Result<string>() != null); 1865Contract.Ensures(Contract.Result<string>() != null); 1871Contract.Ensures(Contract.Result<string>() != null); 1876Contract.Ensures(Contract.Result<string>() != null); 1881Contract.Ensures(Contract.Result<string>() != null); 1887Contract.Ensures(Contract.Result<string>() != null); 1893Contract.Ensures(Contract.Result<string>() != null); 1898Contract.Ensures(Contract.Result<string>() != null); 1903Contract.Ensures(Contract.Result<string>() != null); 1909Contract.Ensures(Contract.Result<string>() != null); 1915Contract.Ensures(Contract.Result<string>() != null); 1920Contract.Ensures(Contract.Result<string>() != null); 1925Contract.Ensures(Contract.Result<string>() != null); 1930Contract.Ensures(Contract.Result<string>() != null); 1935Contract.Ensures(Contract.Result<string>() != null); 1940Contract.Ensures(Contract.Result<string>() != null); 1945Contract.Ensures(Contract.Result<string>() != null); 1950Contract.Ensures(Contract.Result<string>() != null); 1955Contract.Ensures(Contract.Result<string>() != null); 1960Contract.Ensures(Contract.Result<string>() == value); // We were always skipping the null check here. 1965Contract.Ensures(Contract.Result<string>() == value); // We were always skipping the null check here. 1981Contract.EndContractBlock(); 1997Contract.EndContractBlock(); 2015Contract.EndContractBlock(); 2034Contract.EndContractBlock(); 2049Contract.EndContractBlock(); 2062Contract.EndContractBlock(); 2074Contract.EndContractBlock(); 2087Contract.EndContractBlock(); 2097Contract.EndContractBlock(); 2107Contract.EndContractBlock(); 2117Contract.EndContractBlock(); 2127Contract.EndContractBlock(); 2135Contract.Ensures(Contract.Result<string>() != null); 2136Contract.EndContractBlock(); 2145Contract.Ensures(Contract.Result<string>() != null); 2146Contract.EndContractBlock(); 2166Contract.Ensures(Contract.Result<string>() != null); 2167Contract.EndContractBlock(); 2194Contract.Ensures(Contract.Result<int>() >= 0); 2195Contract.Ensures(Contract.Result<int>() <= outArray.Length); 2196Contract.EndContractBlock(); 2219Contract.Ensures(Contract.Result<int>() >= 0); 2220Contract.Ensures(Contract.Result<int>() <= outArray.Length); 2221Contract.EndContractBlock(); 2352Contract.EndContractBlock(); 2397Contract.EndContractBlock(); 2424Contract.Assert(0 <= inputLength); 2439Contract.Assert(0 <= resultLength); 2579Contract.Assert(currCode == intEq); 2659Contract.Assert(0 <= inputLength); 2682Contract.Assert(0 <= usefulInputLength); 2686Contract.Assert(0 <= padding);
system\currenttimezone.cs (1)
176Contract.EndContractBlock();
system\datetime.cs (78)
149Contract.EndContractBlock(); 164Contract.EndContractBlock(); 172Contract.Requires(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); 173Contract.EndContractBlock(); 211Contract.EndContractBlock(); 232Contract.EndContractBlock(); 260Contract.EndContractBlock(); 285Contract.EndContractBlock(); 312Contract.EndContractBlock(); 346Contract.EndContractBlock(); 375Contract.EndContractBlock(); 504Contract.EndContractBlock(); 558Contract.EndContractBlock(); 632Contract.EndContractBlock(); 765Contract.EndContractBlock(); 789Contract.EndContractBlock(); 947Contract.Ensures(Contract.Result<int>() >= 1); 948Contract.Ensures(Contract.Result<int>() <= 31); 960Contract.Ensures(Contract.Result<DayOfWeek>() >= DayOfWeek.Sunday); 961Contract.Ensures(Contract.Result<DayOfWeek>() <= DayOfWeek.Saturday); 971Contract.Ensures(Contract.Result<int>() >= 1); 972Contract.Ensures(Contract.Result<int>() <= 366); // leap year 989Contract.Ensures(Contract.Result<int>() >= 0); 990Contract.Ensures(Contract.Result<int>() < 24); 1018Contract.Ensures(Contract.Result<int>() >= 0); 1019Contract.Ensures(Contract.Result<int>() < 1000); 1029Contract.Ensures(Contract.Result<int>() >= 0); 1030Contract.Ensures(Contract.Result<int>() < 60); 1040Contract.Ensures(Contract.Result<int>() >= 1); 1053Contract.Ensures(Contract.Result<DateTime>().Kind == DateTimeKind.Local); 1072Contract.Ensures(Contract.Result<DateTime>().Kind == DateTimeKind.Utc); 1233Contract.Ensures(Contract.Result<int>() >= 0); 1234Contract.Ensures(Contract.Result<int>() < 60); 1273Contract.Ensures(Contract.Result<int>() >= 1 && Contract.Result<int>() <= 9999); 1285Contract.EndContractBlock(); 1423Contract.Ensures(Contract.Result<String>() != null); 1428Contract.Ensures(Contract.Result<String>() != null); 1433Contract.Ensures(Contract.Result<String>() != null); 1438Contract.Ensures(Contract.Result<String>() != null); 1443Contract.Ensures(Contract.Result<String>() != null); 1448Contract.Ensures(Contract.Result<String>() != null); 1453Contract.Ensures(Contract.Result<String>() != null); 1458Contract.Ensures(Contract.Result<String>() != null); 1537Contract.Ensures(Contract.Result<String[]>() != null); 1546Contract.Ensures(Contract.Result<String[]>() != null); 1556Contract.Ensures(Contract.Result<String[]>() != null); 1565Contract.Ensures(Contract.Result<String[]>() != null);
system\datetimeoffset.cs (48)
190Contract.Ensures(Contract.Result<DateTime>().Kind == DateTimeKind.Utc); 198Contract.Ensures(Contract.Result<DateTime>().Kind == DateTimeKind.Local); 236Contract.Ensures(Contract.Result<int>() >= 1); 237Contract.Ensures(Contract.Result<int>() <= 31); 249Contract.Ensures(Contract.Result<DayOfWeek>() >= DayOfWeek.Sunday); 250Contract.Ensures(Contract.Result<DayOfWeek>() <= DayOfWeek.Saturday); 260Contract.Ensures(Contract.Result<int>() >= 1); 261Contract.Ensures(Contract.Result<int>() <= 366); // leap year 271Contract.Ensures(Contract.Result<int>() >= 0); 272Contract.Ensures(Contract.Result<int>() < 24); 283Contract.Ensures(Contract.Result<int>() >= 0); 284Contract.Ensures(Contract.Result<int>() < 1000); 294Contract.Ensures(Contract.Result<int>() >= 0); 295Contract.Ensures(Contract.Result<int>() < 60); 305Contract.Ensures(Contract.Result<int>() >= 1); 321Contract.Ensures(Contract.Result<int>() >= 0); 322Contract.Ensures(Contract.Result<int>() < 60); 357Contract.Ensures(Contract.Result<int>() >= 1 && Contract.Result<int>() <= 9999); 565Contract.EndContractBlock(); 704Contract.Ensures(Contract.Result<String>() != null); 709Contract.Ensures(Contract.Result<String>() != null); 714Contract.Ensures(Contract.Result<String>() != null); 719Contract.Ensures(Contract.Result<String>() != null); 798Contract.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated."); 821Contract.EndContractBlock();
system\decimal.cs (13)
282Contract.EndContractBlock(); 301Contract.EndContractBlock(); 500Contract.Ensures(Contract.Result<String>() != null); 506Contract.Ensures(Contract.Result<String>() != null); 512Contract.Ensures(Contract.Result<String>() != null); 518Contract.Ensures(Contract.Result<String>() != null); 572Contract.Requires((buffer != null && buffer.Length >= 16), "[GetBytes]buffer != null && buffer.Length >= 16"); 595Contract.Requires((buffer != null && buffer.Length >= 16), "[ToDecimal]buffer != null && buffer.Length >= 16"); 793Contract.EndContractBlock();
system\defaultbinder.cs (6)
44Contract.EndContractBlock(); 598if (indexes != null && !Contract.ForAll(indexes, delegate(Type t) { return t != null; })) 611Contract.EndContractBlock(); 744Contract.EndContractBlock(); 784Contract.EndContractBlock(); 998Contract.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
system\delegate.cs (9)
54Contract.EndContractBlock(); 82Contract.EndContractBlock(); 380Contract.EndContractBlock(); 443Contract.EndContractBlock(); 491Contract.EndContractBlock(); 542Contract.EndContractBlock(); 611Contract.EndContractBlock(); 649Contract.EndContractBlock(); 685Contract.Assert((flags & DelegateBindingFlags.SkipSecurityChecks) == 0);
system\delegateserializationholder.cs (3)
29Contract.EndContractBlock(); 125Contract.EndContractBlock(); 187Contract.EndContractBlock();
system\diagnostics\contracts\contracts.cs (6)
295/// At runtime this is equivalent to an <seealso cref="System.Diagnostics.Contracts.Contract.Assert(bool)"/>. 316/// At runtime this is equivalent to an <seealso cref="System.Diagnostics.Contracts.Contract.Assert(bool)"/>. 663Contract.EndContractBlock(); 690Contract.EndContractBlock(); 725Contract.EndContractBlock(); 751Contract.EndContractBlock();
system\diagnostics\contracts\contractsbcl.cs (5)
66Assembly thisAssembly = typeof(Contract).Assembly; // In case we refactor mscorlib, use Contract class instead of Object. 106Contract.EndContractBlock(); 164Contract.Requires(originalException == null || failureKind == ContractFailureKind.PostconditionOnException); 344Contract.EndContractBlock(); 468Contract.Assume(false, "Unreachable code");
system\diagnostics\debuggerattributes.cs (9)
148Contract.EndContractBlock(); 173Contract.EndContractBlock(); 193Contract.EndContractBlock(); 264Contract.EndContractBlock(); 309Contract.EndContractBlock(); 318Contract.EndContractBlock(); 329Contract.EndContractBlock(); 338Contract.EndContractBlock(); 363Contract.EndContractBlock();
system\diagnostics\eventing\activitytracker.cs (5)
5using Contract = System.Diagnostics.Contracts.Contract; 76Contract.Assert((options & EventActivityOptions.Disable) == 0); 196Contract.Assert(orphan.m_stopped != 0); 527Contract.Assert(0 <= value && value < 16); 528Contract.Assert(ptr < endPtr);
system\diagnostics\eventing\eventdescriptor.cs (1)
15using Contract = System.Diagnostics.Contracts.Contract;
system\diagnostics\eventing\eventprovider.cs (4)
18using Contract = System.Diagnostics.Contracts.Contract; 495Contract.Assert(0 <= providerInstance->NextOffset && providerInstance->NextOffset < buffSize); 1110Contract.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1180Contract.Assert(bitcount(n) == 1);
system\diagnostics\eventing\eventsource.cs (49)
198using Contract = System.Diagnostics.Contracts.Contract; 396Contract.EndContractBlock(); 463Contract.EndContractBlock(); 1183Contract.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 1413Contract.Assert(listener == null || (uint)m == (uint)SessionMask.FromId(0)); 1534Contract.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. 1565Contract.EndContractBlock(); 1898Contract.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 2182Contract.Assert(dispatcher.m_EventEnabled != null); 2609Contract.Assert(m_completelyInited); 2619Contract.Assert(m_eventData != null); 2676Contract.Assert(commandArgs.perEventSourceSessionId >= -1 && commandArgs.perEventSourceSessionId <= SessionMask.MAX); 2731Contract.Assert(m_eventData != null); 3017Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 3021Contract.Assert(m_rawManifest == null); 3023Contract.Assert(m_eventData != null); 3065Contract.Assert(!SelfDescribingEvents); 3168Contract.Assert(data.ConstructorArguments.Count <= 1); 3461Contract.Assert(0 <= startEventId); // Since we reserve id 0, we know that id-1 is <= 0 3721Contract.Assert(eventAttribute.Task != EventTask.None || eventAttribute.Opcode != EventOpcode.Info); 3982Contract.Assert(((m_config & EventSourceSettings.EtwManifestEventFormat) != 0) != 4004Contract.Assert(listener == null || (uint)sessions == (uint)SessionMask.FromId(0)); 4015Contract.Assert(etwSession != null); 4243Contract.Assert(s_Listeners != null); 4325Contract.EndContractBlock(); 4340Contract.EndContractBlock(); 4484Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 4504Contract.Assert(false, "EventSource did not have a registered EventListener!"); 4544Contract.Assert(eventSource.m_id == id, "Unexpected event source ID."); 4550Contract.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 4560Contract.Assert(dispatcher != null, "Listener is not on all eventSources."); 4831Contract.Assert(EventId != -1); 5261Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 5329Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 5424Contract.Assert(filterList != null && filterList.m_activeActivities != null); 5517Contract.Assert(childActivityID != null); 5520Contract.Assert(activeActivities != null); 5577Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 5604Contract.Assert(existingFilter == null || 5678Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 5680Contract.Assert(samplingFreq > 0); 5681Contract.Assert(eventId >= 0); 5812Contract.Assert(etwSession != null); 5893Contract.Assert(perEventSourceSessionId < MAX); 5911Contract.Assert(perEventSourceSessionId < MAX); 5916Contract.Assert(perEventSourceSessionId < MAX); 6133Contract.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug); 6176Contract.Assert(numParams == 0); 6177Contract.Assert(this.eventName == null);
System\Diagnostics\Eventing\TraceLogging\EventPayload.cs (2)
5using Contract = System.Diagnostics.Contracts.Contract; 25Contract.Assert(payloadNames.Count == payloadValues.Count);
System\Diagnostics\Eventing\TraceLogging\EventSourceActivity.cs (2)
4using Contract = System.Diagnostics.Contracts.Contract; 35Contract.EndContractBlock();
System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventSource.cs (4)
25using Contract = System.Diagnostics.Contracts.Contract; 96Contract.EndContractBlock(); 112Contract.EndContractBlock(); 141Contract.EndContractBlock();
System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventTypes.cs (6)
6using Contract = System.Diagnostics.Contracts.Contract; 96Contract.EndContractBlock(); 134Contract.EndContractBlock(); 214Contract.EndContractBlock(); 233Contract.EndContractBlock(); 253Contract.EndContractBlock();
System\Diagnostics\Eventing\TraceLogging\TraceLoggingTypeInfo.cs (3)
4using Contract = System.Diagnostics.Contracts.Contract; 36Contract.EndContractBlock(); 60Contract.EndContractBlock();
system\diagnostics\log.cs (1)
147Contract.EndContractBlock();
system\diagnostics\logswitch.cs (1)
42Contract.EndContractBlock();
system\diagnostics\stackframe.cs (2)
177Contract.Ensures(Contract.Result<MethodBase>() != null);
system\diagnostics\stacktrace.cs (6)
352Contract.EndContractBlock(); 372Contract.EndContractBlock(); 386Contract.EndContractBlock(); 402Contract.EndContractBlock(); 423Contract.EndContractBlock(); 445Contract.EndContractBlock();
system\double.cs (8)
213Contract.Ensures(Contract.Result<String>() != null); 219Contract.Ensures(Contract.Result<String>() != null); 225Contract.Ensures(Contract.Result<String>() != null); 231Contract.Ensures(Contract.Result<String>() != null);
system\empty.cs (1)
36Contract.EndContractBlock();
system\enum.cs (38)
129Contract.Assert(false, "Invalid Object type in Format"); 136Contract.Requires(eT != null); 137Contract.Requires(value != null); 156Contract.Requires(eT != null); 157Contract.Requires(value != null); 165Contract.Assert(names.Length == values.Length); 236Contract.Assert(false, "Invalid Object type in ToUInt64"); 327Contract.Assert(false, "Unknown EnumParseFailure: " + m_failure); 371Contract.EndContractBlock(); 488Contract.Ensures(Contract.Result<Type>() != null); 489Contract.EndContractBlock(); 499Contract.Ensures(Contract.Result<Array>() != null); 500Contract.EndContractBlock(); 516Contract.EndContractBlock(); 526Contract.Ensures(Contract.Result<String[]>() != null); 527Contract.EndContractBlock(); 543Contract.EndContractBlock(); 600Contract.EndContractBlock(); 619Contract.EndContractBlock(); 726Contract.Assert(false, "Invalid primitive type"); 789Contract.Assert(false, "Invalid primitive type"); 823Contract.EndContractBlock(); 843Contract.Assert(ret == retInvalidEnumType, "Enum.InternalCompareTo return code was invalid"); 880Contract.EndContractBlock(); 947Contract.Assert(false, "Unknown underlying type."); 1052Contract.EndContractBlock(); 1067Contract.EndContractBlock(); 1082Contract.EndContractBlock(); 1097Contract.EndContractBlock(); 1113Contract.EndContractBlock(); 1129Contract.EndContractBlock(); 1144Contract.EndContractBlock(); 1160Contract.EndContractBlock(); 1174Contract.EndContractBlock(); 1188Contract.EndContractBlock();
system\environment.cs (22)
100Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); 110Contract.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); 213Contract.Assert(s!=null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called Environment.GetResourceString. Resource name was: \""+key+"\""); 413Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH"); 436Contract.Assert(r < Path.MAX_PATH, "r < Path.MAX_PATH"); 449Contract.EndContractBlock(); 619Contract.EndContractBlock(); 659Contract.EndContractBlock(); 673Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!"); 686Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!"); 954Contract.EndContractBlock(); 985Contract.Assert(environmentKey != null, @"HKLM\System\CurrentControlSet\Control\Session Manager\Environment is missing!"); 1002Contract.Assert(environmentKey != null, @"HKCU\Environment is missing!"); 1069Contract.Ensures(Contract.Result<String>() != null); 1122Contract.Ensures(Contract.Result<OperatingSystem>() != null); 1148Contract.Assert(m_os != null, "m_os != null"); 1233Contract.Ensures(Contract.Result<String>() != null); 1448Contract.EndContractBlock(); 1461Contract.EndContractBlock();
system\exception.cs (5)
86Contract.EndContractBlock(); 497Contract.Assert(methBase is MethodInfo, "[Exception.GetExceptionMethodString]methBase is MethodInfo"); 519Contract.Assert(_exceptionMethodString != null, "Method string cannot be NULL!"); 555Contract.EndContractBlock(); 601Contract.Assert(((_safeSerializationManager != null) || (this.GetType().Assembly == typeof(object).Assembly)),
system\gc.cs (7)
154Contract.EndContractBlock(); 170Contract.EndContractBlock(); 230Contract.EndContractBlock(); 262Contract.EndContractBlock(); 275Contract.EndContractBlock(); 358Contract.EndContractBlock(); 375Contract.EndContractBlock();
system\globalization\calendar.cs (6)
197Contract.EndContractBlock(); 233Contract.Assert(BaseCalendarID > 0, "[Calendar.CurrentEraValue] Expected ID > 0"); 252Contract.EndContractBlock(); 533Contract.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0"); 658Contract.EndContractBlock(); 822Contract.EndContractBlock();
system\globalization\calendardata.cs (1)
129Contract.Assert(false, "[CalendarData] nativeGetCalendarData call isn't expected to fail for calendar " + calendarId + " locale " +localeName);
system\globalization\CalendricalCalculationsHelper.cs (8)
157Contract.Assert(gregorianYear < 1620 || 2020 <= gregorianYear); 166Contract.Assert(1988 <= gregorianYear && gregorianYear <= 2019); 172Contract.Assert(1900 <= gregorianYear && gregorianYear <= 1987); 179Contract.Assert(1800 <= gregorianYear && gregorianYear <= 1899); 186Contract.Assert(1700 <= gregorianYear && gregorianYear <= 1799); 193Contract.Assert(1620 <= gregorianYear && gregorianYear <= 1699); 220Contract.Assert(false, "Not expected to come here"); 409Contract.Assert(day != upperBoundNewYearDay);
system\globalization\charunicodeinfo.cs (21)
151Contract.Assert(s != null, "s != null"); 152Contract.Assert(index >= 0 && index < s.Length, "index < s.Length"); 189Contract.Assert(s != null, "s != null"); 190Contract.Assert(s.Length > 0, "s.Length > 0"); 191Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); 217Contract.Assert(s != null, "s!=null"); 218Contract.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); 255Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 288Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 339Contract.EndContractBlock(); 374Contract.EndContractBlock(); 411Contract.EndContractBlock(); 427Contract.EndContractBlock(); 451Contract.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); 479Contract.EndContractBlock(); 497Contract.Assert(value != null, "value can not be null"); 498Contract.Assert(index < value.Length, "index < value.Length"); 511Contract.Assert(str != null, "str can not be null"); 512Contract.Assert(str.Length > 0, "str.Length > 0");; 513Contract.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); 519Contract.Assert(uc >= 0, "uc >= 0");
system\globalization\chineselunisolarcalendar.cs (2)
324Contract.EndContractBlock(); 345Contract.EndContractBlock();
system\globalization\compareinfo.cs (28)
151Contract.EndContractBlock(); 174Contract.EndContractBlock(); 222Contract.EndContractBlock(); 299Contract.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 329Contract.Assert(m_name != null, "CompareInfo.Name Expected m_name to be set"); 361Contract.Assert(options != CompareOptions.OrdinalIgnoreCase, "[CompareInfo.GetNativeCompareFlags]CompareOptions.OrdinalIgnoreCase should be handled separately"); 376Contract.Assert(((options & ~(CompareOptions.IgnoreCase | 384Contract.Assert((nativeCompareFlags & RESERVED_FIND_ASCII_STRING) == 0, "[CompareInfo.GetNativeCompareFlags] RESERVED_FIND_ASCII_STRING shouldn't be set here"); 575Contract.EndContractBlock(); 630Contract.EndContractBlock(); 682Contract.EndContractBlock(); 692Contract.EndContractBlock(); 702Contract.EndContractBlock(); 712Contract.EndContractBlock(); 722Contract.EndContractBlock(); 732Contract.EndContractBlock(); 742Contract.EndContractBlock(); 752Contract.EndContractBlock(); 783Contract.EndContractBlock(); 818Contract.EndContractBlock(); 875Contract.EndContractBlock(); 887Contract.EndContractBlock(); 899Contract.EndContractBlock(); 910Contract.EndContractBlock(); 962Contract.EndContractBlock(); 1014Contract.EndContractBlock(); 1084Contract.EndContractBlock(); 1253Contract.EndContractBlock();
system\globalization\culturedata.cs (25)
1028Contract.Assert(arrayLength == cultureNames.Length + 2, "CultureData.nativeEnumCultureNames() Incorrect array size"); 1074Contract.Assert(name != null, "IsReplacementCultureName(): name should not be null"); 1084Contract.Assert(name != null, "IsReplacementCultureName(): replacementCultureNames should not be null"); 1109Contract.Assert(this.sRealName != null, "[CultureData.CultureName] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 1162Contract.Assert(this.sName != "zh-CHS" && this.sName != "zh-CHT", 1339Contract.Assert(this.sSpecificCulture != null, "[CultureData.SSPECIFICCULTURE] Expected this.sSpecificCulture to be populated by COMNlsInfo::nativeInitCultureData already"); 2311Contract.Assert(this.sWindowsName != null, "[CultureData.CalendarIds] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 2386Contract.Assert(calendarId > 0 && calendarId <= CalendarData.MAX_CALENDARS, 2409Contract.Assert(this.sWindowsName != null, "[CultureData.GetCalendar] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 2462Contract.Assert(this.sRealName != null, "[CultureData.IsRightToLeft] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 2673Contract.Assert(this.sRealName != null, "[CultureData.ILANGUAGE] Expected this.sRealName to be populated by COMNlsInfo::nativeInitCultureData already"); 2730Contract.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 2737Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2744Contract.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2820Contract.Requires(str != null); 2821Contract.Requires(start >= 0); 2822Contract.Requires(end >= 0); 3017Contract.Assert(startIndex >= 0, "startIndex cannot be negative"); 3018Contract.Assert(timeParts.IndexOfAny(new char[] { '\'', '\\' }) == -1, "timeParts cannot include quote characters"); 3056Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3072Contract.Assert(localeName != null, "[CultureData.DoGetLocaleInfo] Expected localeName to be not be null"); 3093Contract.Assert(this.sWindowsName != null, "[CultureData.DoGetLocaleInfoInt] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3102Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3111Contract.Assert(this.sWindowsName != null, "[CultureData.DoEnumShortTimeFormats] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already"); 3176Contract.Assert(this.sWindowsName != null, "[CultureData.GetNFIValues] Expected this.sWindowsName to be populated by COMNlsInfo::nativeInitCultureData already");
system\globalization\cultureinfo.cs (85)
334Contract.EndContractBlock(); 363Contract.Assert(cultureData != null); 371Contract.Assert(name != null); 391Contract.EndContractBlock(); 436Contract.EndContractBlock(); 454Contract.Assert(cultureID >=0, "[CultureInfo.OnDeserialized] cultureID >= 0"); 460Contract.Assert(m_name != null, "[CultureInfo.OnDeserialized] m_name != null"); 528Contract.Assert(m_createdDomainID != 0, "[CultureInfo.IsSafeCrossDomain] m_createdDomainID != 0"); 535Contract.Assert(m_createdDomainID != 0, "[CultureInfo.CreatedDomain] m_createdDomainID != 0"); 585Contract.EndContractBlock(); 625Contract.Ensures(Contract.Result<CultureInfo>() != null); 689Contract.Assert(culture!=null, "[CultureInfo.VerifyCultureName]culture!=null"); 715Contract.Ensures(Contract.Result<CultureInfo>() != null); 766Contract.Ensures(Contract.Result<CultureInfo>() != null); 790Contract.Ensures(Contract.Result<CultureInfo>() != null); 813Contract.Ensures(Contract.Result<CultureInfo>() != null); 865Contract.Ensures(Contract.Result<CultureInfo>() != null); 960Contract.Ensures(Contract.Result<CultureInfo>() != null); 979Contract.Ensures(Contract.Result<CultureInfo>() != null); 1049Contract.Ensures(Contract.Result<CultureInfo[]>() != null); 1070Contract.Ensures(Contract.Result<String>() != null); 1104Contract.Ensures(Contract.Result<String>() != null); 1134Contract.Ensures(Contract.Result<String>() != null); 1135Contract.Assert(m_name != null, "[CultureInfo.DisplayName]Always expect m_name to be set"); 1153Contract.Ensures(Contract.Result<String>() != null); 1170Contract.Ensures(Contract.Result<String>() != null); 1179Contract.Ensures(Contract.Result<String>() != null); 1189Contract.Ensures(Contract.Result<String>() != null); 1205Contract.Ensures(Contract.Result<String>() != null); 1222Contract.Ensures(Contract.Result<CompareInfo>() != null); 1280Contract.Ensures(Contract.Result<TextInfo>() != null); 1358Contract.Ensures(Contract.Result<String>() != null); 1360Contract.Assert(m_name != null, "[CultureInfo.ToString]Always expect m_name to be set"); 1412Contract.Ensures(Contract.Result<NumberFormatInfo>() != null); 1426Contract.EndContractBlock(); 1444Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null); 1462Contract.EndContractBlock(); 1504Contract.Assert(calType!=Calendar.CAL_GREGORIAN, "calType!=Calendar.CAL_GREGORIAN"); 1554Contract.Ensures(Contract.Result<Calendar>() != null); 1556Contract.Assert(this.m_cultureData.CalendarIds.Length > 0, "this.m_cultureData.CalendarIds.Length > 0"); 1579Contract.Ensures(Contract.Result<Calendar[]>() != null); 1605Contract.Ensures(Contract.Result<CultureInfo>() != null); 1620Contract.Ensures(Contract.Result<Object>() != null); 1663Contract.Ensures(Contract.Result<CultureInfo>() != null); 1664Contract.EndContractBlock(); 1717Contract.EndContractBlock(); 1896Contract.Ensures(Contract.Result<CultureInfo>() != null); 1897Contract.EndContractBlock(); 1917Contract.Ensures(Contract.Result<CultureInfo>() != null); 1918Contract.EndContractBlock(); 1944Contract.Ensures(Contract.Result<CultureInfo>() != null); 1945Contract.EndContractBlock(); 1965Contract.Ensures(Contract.Result<CultureInfo>() != null); 2028Contract.Assert(localeType == LOCALE_USER_DEFAULT || localeType == LOCALE_SYSTEM_DEFAULT, "[CultureInfo.GetDefaultLocaleName] localeType must be LOCALE_USER_DEFAULT or LOCALE_SYSTEM_DEFAULT");
system\globalization\culturenotfoundexception.cs (1)
80Contract.EndContractBlock();
system\globalization\datetimeformat.cs (7)
175Contract.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 181Contract.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 227Contract.Assert(dayOfWeek >= 0 && dayOfWeek <= 6, "dayOfWeek >= 0 && dayOfWeek <= 6"); 239Contract.Assert(month >=1 && month <= 12, "month >=1 && month <= 12"); 280Contract.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4"); 914Contract.Requires(dtfi != null); 1069Contract.Requires(dtfi != null);
system\globalization\datetimeformatinfo.cs (82)
253Contract.Assert(this.abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 276Contract.Assert(this.m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.internalGetSuperShortDayNames] Expected 7 day names in a week"); 293Contract.Assert(this.dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 310Contract.Assert(this.abbreviatedMonthNames.Length == 12 || this.abbreviatedMonthNames.Length == 13, 329Contract.Assert(this.monthNames.Length == 12 || this.monthNames.Length == 13, 348Contract.Requires(cultureData != null); 349Contract.Requires(cal != null); 366Contract.Requires(cultureData != null); 367Contract.Assert(calendarID > 0, "[DateTimeFormatInfo.Populate] Expected Calendar.ID > 0"); 378Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 381Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 384Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 387Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 390Contract.Assert(this.allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 501Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null); 518Contract.Ensures(Contract.Result<DateTimeFormatInfo>() != null); 586Contract.Assert(this.amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 599Contract.EndContractBlock(); 608Contract.Ensures(Contract.Result<Calendar>() != null); 610Contract.Assert(this.calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 621Contract.EndContractBlock(); 735Contract.EndContractBlock(); 846Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 866Contract.Assert(this.dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 878Contract.EndContractBlock(); 896Contract.Assert(this.firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 925Contract.Assert(this.calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 962Contract.EndContractBlock(); 994Contract.EndContractBlock(); 1033Contract.EndContractBlock(); 1056Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 1059Contract.Assert(this.monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 1070Contract.EndContractBlock(); 1090Contract.Assert(this.pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 1101Contract.EndContractBlock(); 1144Contract.EndContractBlock(); 1185Contract.EndContractBlock(); 1311Contract.Assert(this.timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 1323Contract.EndContractBlock(); 1365Contract.EndContractBlock(); 1379Contract.Requires(values != null, "value != null"); 1380Contract.Requires(values.Length >= length); 1407Contract.EndContractBlock(); 1436Contract.EndContractBlock(); 1461Contract.EndContractBlock(); 1486Contract.EndContractBlock(); 1512Contract.EndContractBlock(); 1588Contract.Assert(this.m_genitiveAbbreviatedMonthNames.Length == 13, 1597Contract.Assert(this.genitiveMonthNames.Length == 13, 1613Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.internalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1615Contract.Assert(this.leapYearMonthNames.Length == 13, 1630Contract.EndContractBlock(); 1649Contract.EndContractBlock(); 1660Contract.Requires(patterns1 != null); 1661Contract.Requires(patterns2 != null); 1700Contract.Ensures(Contract.Result<String[]>() != null); 1766Contract.EndContractBlock(); 1781Contract.EndContractBlock(); 1794Contract.EndContractBlock(); 1808Contract.Assert(patterns != null && patterns.Length > 0, 1810Contract.Assert(defaultPattern != null, 1907Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1909Contract.Assert(this.allYearMonthPatterns.Length > 0, 1926Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1928Contract.Assert(this.allShortDatePatterns.Length > 0, 1944Contract.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1946Contract.Assert(this.allLongDatePatterns.Length > 0, 1963Contract.Assert(this.allShortTimePatterns.Length > 0, 1980Contract.Assert(this.allLongTimePatterns.Length > 0, 1993Contract.EndContractBlock(); 2059Contract.EndContractBlock(); 2129Contract.EndContractBlock(); 2157Contract.EndContractBlock(); 2234Contract.EndContractBlock(); 2727Contract.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2774Contract.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length"); 2884Contract.Assert(true, "The hashtable is full. This should not happen."); 2977Contract.Assert(true, "The hashtable is full. This should not happen.");
system\globalization\datetimeparse.cs (19)
119Contract.Assert(dtfi != null, "dtfi == null"); 201Contract.Assert(dtfi != null, "dtfi == null"); 554Contract.Assert(hourOffset >= 0 && hourOffset <= 99, "hourOffset >= 0 && hourOffset <= 99"); 555Contract.Assert(minuteOffset >= 0 && minuteOffset <= 99, "minuteOffset >= 0 && minuteOffset <= 99"); 1949Contract.Assert(raw.numCount >= 2, "raw.numCount >= 2"); 1969Contract.Assert(raw.numCount >= 3, "raw.numCount >= 3"); 2340Contract.Assert(dtfi != null, "dtfi == null"); 2610Contract.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified"); 2900Contract.Assert(minDigitLen > 0, "minDigitLen > 0"); 2901Contract.Assert(maxDigitLen < 9, "maxDigitLen < 9"); 2902Contract.Assert(minDigitLen <= maxDigitLen, "minDigitLen <= maxDigitLen"); 4188Contract.Assert(false, "Unkown DateTimeParseFailure: " + result); 4417Contract.Assert(Index + count <= len, "__DTString::Advance: Index + count <= len"); 4712Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len"); 4720Contract.Assert(Index >= 0 && Index < len, "Index >= 0 && Index < len"); 4721Contract.Assert(DateTimeParse.IsDigit(Value[Index]), "IsDigit(Value[Index])"); 4854Contract.Assert(number >= 0 && number <= 9, "number >= 0 && number <= 9"); 4873Contract.Assert(sub.index == Index, "sub.index == Index"); 4874Contract.Assert(sub.index + sub.length <= len, "sub.index + sub.length <= len");
system\globalization\eastasianlunisolarcalendar.cs (5)
72Contract.EndContractBlock(); 87Contract.EndContractBlock(); 163Contract.EndContractBlock(); 406Contract.EndContractBlock(); 637Contract.EndContractBlock();
system\globalization\encodingtable.cs (1)
142Contract.EndContractBlock();
system\globalization\globalizationassembly.cs (3)
41Contract.Assert(assembly != null, "assembly can not be null. This should be generally the mscorlib.dll assembly."); 42Contract.Assert(tableName != null, "table name can not be null"); 53Contract.Assert(
system\globalization\gregoriancalendar.cs (6)
140Contract.EndContractBlock(); 296Contract.EndContractBlock(); 471Contract.EndContractBlock(); 514Contract.EndContractBlock(); 540Contract.EndContractBlock(); 617Contract.EndContractBlock();
system\globalization\gregoriancalendarhelper.cs (5)
232Contract.EndContractBlock(); 363Contract.EndContractBlock(); 394Contract.EndContractBlock(); 576Contract.EndContractBlock(); 646Contract.EndContractBlock();
system\globalization\hebrewcalendar.cs (3)
609Contract.Assert(NumDays >= 1, "NumDays >= 1"); 813Contract.Assert(hebrewYearType>= 1 && hebrewYearType <= 6, 1056Contract.EndContractBlock();
system\globalization\hebrewnumber.cs (1)
102Contract.Assert(Number > 0 && Number <= 999, "Number is out of range.");;
system\globalization\hijricalendar.cs (3)
235Contract.EndContractBlock(); 510Contract.EndContractBlock(); 739Contract.EndContractBlock();
system\globalization\idnmapping.cs (20)
99Contract.EndContractBlock(); 115Contract.EndContractBlock(); 133Contract.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii]Expected 0 length strings to fail before now."); 222Contract.EndContractBlock(); 245Contract.EndContractBlock(); 343Contract.EndContractBlock(); 482Contract.Assert(d >= 0 && d < punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase"); 519Contract.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 527Contract.Assert(delta + skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 565Contract.EndContractBlock(); 577Contract.Assert(iNextDot <= unicode.Length, "[IdnMapping.punycode_encode]IndexOfAny is broken"); 627Contract.Assert(Char.IsLowSurrogate(unicode, basicCount) == false, 711Contract.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 725Contract.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 737Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_encode]Expected punycodeBase (36) to be != t"); 756Contract.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 813Contract.EndContractBlock(); 947Contract.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 956Contract.Assert(punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != punycodeBase (36)"); 968Contract.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0,
system\globalization\japanesecalendar.cs (1)
490Contract.EndContractBlock();
system\globalization\japaneselunisolarcalendar.cs (1)
213Contract.EndContractBlock();
system\globalization\juliancalendar.cs (2)
241Contract.EndContractBlock(); 427Contract.EndContractBlock();
system\globalization\koreancalendar.cs (1)
261Contract.EndContractBlock();
system\globalization\koreanlunisolarcalendar.cs (2)
1259Contract.EndContractBlock(); 1281Contract.EndContractBlock();
system\globalization\numberformatinfo.cs (26)
171Contract.EndContractBlock(); 180Contract.EndContractBlock(); 193Contract.EndContractBlock(); 263Contract.EndContractBlock(); 333Contract.EndContractBlock(); 389Contract.EndContractBlock(); 410Contract.EndContractBlock(); 429Contract.EndContractBlock(); 456Contract.EndContractBlock(); 488Contract.EndContractBlock(); 508Contract.EndContractBlock(); 530Contract.EndContractBlock(); 552Contract.EndContractBlock(); 574Contract.EndContractBlock(); 590Contract.EndContractBlock(); 604Contract.EndContractBlock(); 623Contract.EndContractBlock(); 662Contract.EndContractBlock(); 678Contract.EndContractBlock(); 692Contract.EndContractBlock(); 711Contract.EndContractBlock(); 747Contract.EndContractBlock(); 761Contract.EndContractBlock(); 802Contract.EndContractBlock(); 823Contract.EndContractBlock(); 836Contract.EndContractBlock();
system\globalization\Persiancalendar.cs (10)
189Contract.Assert(ordinalDay <= 366); 199Contract.Assert(1 <= month && month <= 12); 229Contract.Assert(y >= 1); 248Contract.Assert(ordinalDay >= 1); 249Contract.Assert(m >= 1 && m <= 12); 256Contract.Assert(1 <= d); 257Contract.Assert(d <= 31); 301Contract.EndContractBlock(); 381Contract.Assert(daysInMonth == 30); 560Contract.EndContractBlock();
system\globalization\regioninfo.cs (3)
75Contract.EndContractBlock(); 319Contract.Assert(m_dataItem >= 0, "[RegionInfo.OnDeserialized] null name and invalid dataItem"); 391Contract.Assert(m_name != null, "Expected RegionInfo.m_name to be populated already");
system\globalization\sortkey.cs (3)
138Contract.EndContractBlock(); 143Contract.Assert(key1Data!=null, "key1Data!=null"); 144Contract.Assert(key2Data!=null, "key2Data!=null");
system\globalization\stringinfo.cs (6)
102Contract.EndContractBlock(); 213Contract.Assert(index >= 0 && len >= 0, "StringInfo.GetCurrentTextElementLen() : index = " + index + ", len = " + len); 214Contract.Assert(index < len, "StringInfo.GetCurrentTextElementLen() : index = " + index + ", len = " + len); 277Contract.EndContractBlock(); 306Contract.EndContractBlock(); 335Contract.EndContractBlock();
system\globalization\taiwancalendar.cs (1)
248Contract.EndContractBlock();
system\globalization\taiwanlunisolarcalendar.cs (1)
269Contract.EndContractBlock();
system\globalization\textelementenumerator.cs (3)
49Contract.Assert(str != null, "TextElementEnumerator(): str != null"); 50Contract.Assert(startIndex >= 0 && strLen >= 0, "TextElementEnumerator(): startIndex >= 0 && strLen >= 0"); 51Contract.Assert(strLen >= startIndex, "TextElementEnumerator(): strLen >= startIndex");
system\globalization\textinfo.cs (19)
267Contract.Assert(strA.Length >= indexA + lengthA, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strA.Length >= indexA + lengthA"); 268Contract.Assert(strB.Length >= indexB + lengthB, "[TextInfo.CompareOrdinalIgnoreCaseEx] Caller should've validated strB.Length >= indexB + lengthB"); 276Contract.Assert(source != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated source != null"); 277Contract.Assert(value != null, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated value != null"); 278Contract.Assert(startIndex + count <= source.Length, "[TextInfo.IndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex + count <= source.Length"); 305Contract.Assert(end - startIndex >= value.Length); 321Contract.Assert(source != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated source != null"); 322Contract.Assert(value != null, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated value != null"); 323Contract.Assert(startIndex - count+1 >= 0, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex - count+1 >= 0"); 324Contract.Assert(startIndex <= source.Length, "[TextInfo.LastIndexOfStringOrdinalIgnoreCase] Caller should've validated startIndex <= source.Length"); 480Contract.EndContractBlock(); 495Contract.EndContractBlock(); 531Contract.EndContractBlock(); 560Contract.EndContractBlock(); 599Contract.EndContractBlock(); 716Contract.EndContractBlock(); 803Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 817Contract.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 953Contract.EndContractBlock();
system\globalization\thaibuddhistcalendar.cs (1)
220Contract.EndContractBlock();
system\globalization\timespanformat.cs (14)
148Contract.Assert(dtfi != null, "dtfi == null"); 376Contract.Assert(field >= 0 && field <= 5, "field >= 0 && field <= 5"); 396Contract.Assert(false, "Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 406Contract.Assert((field == 0 && sb.Length == 0) || field == 1, 414Contract.Assert((field == 1 && sb.Length == 0) || field == 2, 422Contract.Assert((field == 2 && sb.Length == 0) || field == 3, 430Contract.Assert((field == 3 && sb.Length == 0) || field == 4, 439Contract.Assert((field == 4 && sb.Length == 0) || field == 5, 451Contract.Assert(field == 5); 454Contract.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 455Contract.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 456Contract.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 457Contract.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 458Contract.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
system\globalization\timespanparse.cs (10)
139Contract.Assert(ttt == TTT.Num); 140Contract.Assert(num > -1); 141Contract.Assert(maxValue > 0); 142Contract.Assert(maxPrecision == maxFractionDigits || maxPrecision == unlimitedDigits); 176Contract.Assert(m_pos > -1); 387Contract.Assert(dtfi != null); 429Contract.Assert(tokenCount == (SepCount + NumCount), "tokenCount == (SepCount + NumCount)"); 499Contract.Assert(false, "Unknown TimeSpanParseFailure: " + m_failure); 1171Contract.Assert(input != null, "input != null"); 1172Contract.Assert(format != null, "format != null");
system\globalization\umalquracalendar.cs (9)
342Contract.Assert( (HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 343Contract.Assert( HijriMonth >= 1, "Hijri month is out of range."); 344Contract.Assert( HijriDay >= 1, "Hijri day is out of range."); 432Contract.Assert((time.Ticks >= minDate.Ticks) && (time.Ticks <= maxDate.Ticks), "Gregorian date is out of range."); 537Contract.EndContractBlock(); 633Contract.Assert( (year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 642Contract.Assert((days == 354)||(days == 355), "Hijri year has to be 354 or 355 days."); 815Contract.EndContractBlock(); 829Contract.EndContractBlock();
system\guid.cs (8)
56Contract.EndContractBlock(); 97Contract.EndContractBlock(); 191Contract.Assert(failure != ParseFailureKind.NativeException, "ParseFailureKind.NativeException should not be used with this overload"); 220Contract.Assert(false, "Unknown GuidParseFailure: " + m_failure); 239Contract.EndContractBlock(); 258Contract.EndContractBlock(); 1149Contract.Ensures(Contract.Result<Guid>() != Guid.Empty);
system\iappdomainpausemanager.cs (2)
71Contract.Assert(!isPaused); 89Contract.Assert(isPaused);
system\int16.cs (10)
86Contract.Ensures(Contract.Result<String>() != null); 92Contract.Ensures(Contract.Result<String>() != null); 97Contract.Ensures(Contract.Result<String>() != null); 102Contract.Ensures(Contract.Result<String>() != null); 108Contract.Ensures(Contract.Result<String>() != null);
system\int32.cs (8)
93Contract.Ensures(Contract.Result<String>() != null); 100Contract.Ensures(Contract.Result<String>() != null); 107Contract.Ensures(Contract.Result<String>() != null); 114Contract.Ensures(Contract.Result<String>() != null);
system\int64.cs (8)
91Contract.Ensures(Contract.Result<String>() != null); 97Contract.Ensures(Contract.Result<String>() != null); 103Contract.Ensures(Contract.Result<String>() != null); 109Contract.Ensures(Contract.Result<String>() != null);
system\intptr.cs (3)
95Contract.EndContractBlock(); 152Contract.Ensures(Contract.Result<String>() != null);
system\io\__consolestream.cs (13)
52Contract.Assert(handle != null && !handle.IsInvalid, "__ConsoleStream expects a valid handle!"); 130Contract.EndContractBlock(); 157Contract.EndContractBlock(); 176Contract.Requires(offset >= 0, "offset >= 0"); 177Contract.Requires(count >= 0, "count >= 0"); 178Contract.Requires(bytes != null, "bytes != null"); 183Contract.EndContractBlock(); 238Contract.Requires(offset >= 0, "offset >= 0"); 239Contract.Requires(count >= 0, "count >= 0"); 240Contract.Requires(bytes != null, "bytes != null"); 241Contract.Requires(bytes.Length >= offset + count, "bytes.Length >= offset + count"); 256Contract.Assert(!writeSuccess || count == numBytesWritten); 269Contract.Assert(!writeSuccess || count / BytesPerWChar == charsWritten);
system\io\binaryreader.cs (38)
60Contract.EndContractBlock(); 78Contract.Assert(m_decoder!=null, "[BinaryReader.ctor]m_decoder!=null"); 112Contract.Ensures(Contract.Result<int>() >= -1); 125Contract.Ensures(Contract.Result<int>() >= -1); 178Contract.Assert(mStream != null, "m_stream as MemoryStream != null"); 245Contract.Ensures(Contract.Result<String>() != null); 313Contract.Ensures(Contract.Result<int>() >= 0); 314Contract.Ensures(Contract.Result<int>() <= count); 315Contract.EndContractBlock(); 326Contract.Requires(buffer != null); 327Contract.Requires(index >= 0 && count >= 0); 328Contract.Assert(m_stream != null); 360Contract.Assert(mStream != null, "m_stream as MemoryStream != null"); 376Contract.Assert(byteBuffer != null, "expected byteBuffer to be non-null"); 402Contract.Assert(charsRemaining >= 0, "We read too many characters."); 451Contract.Assert(numBytes == 1 || numBytes == 2, "BinaryReader::InternalReadOneChar assumes it's reading one or 2 bytes only."); 468Contract.Assert(charsRead < 2, "InternalReadOneChar - assuming we only got 0 or 1 char, not 2!"); 481Contract.Ensures(Contract.Result<char[]>() != null); 482Contract.Ensures(Contract.Result<char[]>().Length <= count); 483Contract.EndContractBlock(); 513Contract.Ensures(Contract.Result<int>() >= 0); 514Contract.Ensures(Contract.Result<int>() <= count); 515Contract.EndContractBlock(); 523Contract.Ensures(Contract.Result<byte[]>() != null); 524Contract.Ensures(Contract.Result<byte[]>().Length <= Contract.OldValue(count)); 525Contract.EndContractBlock();
system\io\binarywriter.cs (6)
83Contract.EndContractBlock(); 172Contract.EndContractBlock(); 194Contract.EndContractBlock(); 196Contract.Assert(_encoding.GetMaxByteCount(1) <= 16, "_encoding.GetMaxByteCount(1) <= 16)"); 213Contract.EndContractBlock(); 359Contract.EndContractBlock();
system\io\bufferedstream.cs (78)
108Contract.EndContractBlock(); 134Contract.Requires(_stream != null); 143Contract.Requires(_stream != null); 152Contract.Requires(_stream != null); 175Contract.Assert(_buffer != null); 176Contract.Assert(_bufferSize > 0); 190Contract.Assert(_bufferSize > 0); 247Contract.Assert(! (_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 253Contract.EndContractBlock(); 299Contract.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 320Contract.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 350Contract.Assert(stream != null); 359Contract.Assert(_this._writePos == 0 && _this._readPos == 0 && _this._readLen == 0); 379Contract.Assert(_this._writePos == 0 && _this._readPos == 0 && _this._readLen == 0); 388Contract.Assert(_this._writePos == 0 && _this._readPos == _this._readLen); 402Contract.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 416Contract.Assert(_readPos <= _readLen, "_readPos <= _readLen [" + _readPos +" <= " + _readLen + "]"); 426Contract.Assert(_readPos < _readLen); 440Contract.Assert(_readPos == 0 && _readLen == 0, 442Contract.Assert(_buffer != null && _bufferSize >= _writePos, 454Contract.Assert(_readPos == 0 && _readLen == 0, 456Contract.Assert(_buffer != null && _bufferSize >= _writePos, 469Contract.Assert(readBytes >= 0); 474Contract.Assert(readBytes > 0); 510Contract.EndContractBlock(); 535Contract.Assert(_readLen == _readPos); 576Contract.EndContractBlock(); 641Contract.Ensures(Contract.Result<Int32>() >= 0); 642Contract.EndContractBlock(); 654Contract.Assert(t == null || t.Status == TaskStatus.RanToCompletion); 675Contract.EndContractBlock(); 738Contract.Assert(array != null); 739Contract.Assert(offset >= 0); 740Contract.Assert(count >= 0); 741Contract.Assert(array.Length - offset >= count); 742Contract.Assert(_stream != null); 743Contract.Assert(_stream.CanRead); 744Contract.Assert(_bufferSize > 0); 745Contract.Assert(semaphoreLockTask != null); 763Contract.Assert(_readLen == _readPos); 865Contract.EndContractBlock(); 933Contract.Assert(_writePos < _bufferSize); 948Contract.Assert(count == 0); 952Contract.Assert(count >= 0); 953Contract.Assert(_writePos == _bufferSize); 954Contract.Assert(_buffer != null); 961Contract.Assert(count == 0); 962Contract.Assert(_writePos < _bufferSize); 969Contract.Assert(_buffer != null); 970Contract.Assert(totalUserBytes >= _bufferSize); 1005Contract.EndContractBlock(); 1025Contract.Assert(_writePos < _bufferSize); 1032Contract.Assert(count == 0); 1065Contract.EndContractBlock(); 1087Contract.EndContractBlock(); 1109Contract.Assert(_writePos < _bufferSize); 1118Contract.Assert(count == 0); 1146Contract.Assert(array != null); 1147Contract.Assert(offset >= 0); 1148Contract.Assert(count >= 0); 1149Contract.Assert(array.Length - offset >= count); 1150Contract.Assert(_stream != null); 1151Contract.Assert(_stream.CanWrite); 1152Contract.Assert(_bufferSize > 0); 1153Contract.Assert(semaphoreLockTask != null); 1179Contract.Assert(count == 0); 1183Contract.Assert(count >= 0); 1184Contract.Assert(_writePos == _bufferSize); 1185Contract.Assert(_buffer != null); 1198Contract.Assert(count == 0); 1199Contract.Assert(_writePos < _bufferSize); 1206Contract.Assert(_buffer != null); 1207Contract.Assert(totalUserBytes >= _bufferSize); 1269Contract.Assert(_writePos < _bufferSize); 1297Contract.Assert(oldPos == _stream.Position + (_readPos - _readLen)); 1318Contract.Assert(newPos == Position, "newPos (=" + newPos + ") == Position (=" + Position + ")"); 1327Contract.EndContractBlock();
system\io\directory.cs (105)
50Contract.EndContractBlock(); 68Contract.EndContractBlock(); 97Contract.EndContractBlock(); 107Contract.Requires(path != null); 108Contract.Requires(path.Length != 0); 166Contract.EndContractBlock(); 422Contract.Assert(false, "Ignore this assert and send a repro to Microsoft. This assert was tracking purposes only."); 584Contract.EndContractBlock(); 598Contract.Ensures(Contract.Result<String[]>() != null); 599Contract.EndContractBlock(); 614Contract.Ensures(Contract.Result<String[]>() != null); 615Contract.EndContractBlock(); 632Contract.Ensures(Contract.Result<String[]>() != null); 633Contract.EndContractBlock(); 644Contract.Requires(path != null); 645Contract.Requires(searchPattern != null); 646Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 656Contract.Requires(path != null); 657Contract.Requires(searchPattern != null); 658Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 670Contract.Ensures(Contract.Result<String[]>() != null); 671Contract.EndContractBlock(); 686Contract.Ensures(Contract.Result<String[]>() != null); 687Contract.EndContractBlock(); 704Contract.Ensures(Contract.Result<String[]>() != null); 705Contract.EndContractBlock(); 716Contract.Requires(path != null); 717Contract.Requires(searchPattern != null); 718Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 719Contract.Ensures(Contract.Result<String[]>() != null); 729Contract.Requires(path != null); 730Contract.Requires(searchPattern != null); 731Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 732Contract.Ensures(Contract.Result<String[]>() != null); 744Contract.Ensures(Contract.Result<String[]>() != null); 745Contract.EndContractBlock(); 760Contract.Ensures(Contract.Result<String[]>() != null); 761Contract.EndContractBlock(); 778Contract.Ensures(Contract.Result<String[]>() != null); 779Contract.EndContractBlock(); 788Contract.Requires(path != null); 789Contract.Requires(searchPattern != null); 790Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 802Contract.Requires(fullPath != null && fullPath.Length > 0); 803Contract.Requires(userPath != null && userPath.Length > 0); 804Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 826Contract.Requires(path != null); 827Contract.Requires(userPathOriginal != null); 828Contract.Requires(searchPattern != null); 829Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 844Contract.EndContractBlock(); 857Contract.EndContractBlock(); 872Contract.EndContractBlock(); 881Contract.Requires(path != null); 882Contract.Requires(searchPattern != null); 883Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 894Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 895Contract.EndContractBlock(); 908Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 909Contract.EndContractBlock(); 924Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 925Contract.EndContractBlock(); 934Contract.Requires(path != null); 935Contract.Requires(searchPattern != null); 936Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 937Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 948Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 949Contract.EndContractBlock(); 962Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 963Contract.EndContractBlock(); 978Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 979Contract.EndContractBlock(); 988Contract.Requires(path != null); 989Contract.Requires(searchPattern != null); 990Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 991Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 999Contract.Requires(path != null); 1000Contract.Requires(searchPattern != null); 1001Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 1002Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); 1016Contract.Ensures(Contract.Result<String[]>() != null); 1052Contract.EndContractBlock(); 1178Contract.EndContractBlock(); 1229Contract.EndContractBlock();
system\io\directoryinfo.cs (32)
79Contract.EndContractBlock(); 113Contract.Assert(Path.GetRootLength(fullPath) > 0, "fullPath must be fully qualified!"); 205Contract.EndContractBlock(); 239Contract.Requires(path != null); 336Contract.EndContractBlock(); 351Contract.EndContractBlock(); 362Contract.Requires(searchPattern != null); 363Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 394Contract.EndContractBlock(); 409Contract.EndContractBlock(); 420Contract.Requires(searchPattern != null); 421Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 446Contract.EndContractBlock(); 462Contract.EndContractBlock(); 474Contract.Requires(searchPattern != null); 475Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 495Contract.EndContractBlock(); 508Contract.EndContractBlock(); 517Contract.Requires(searchPattern != null); 518Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 536Contract.EndContractBlock(); 549Contract.EndContractBlock(); 558Contract.Requires(searchPattern != null); 559Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 577Contract.EndContractBlock(); 590Contract.EndContractBlock(); 599Contract.Requires(searchPattern != null); 600Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 645Contract.EndContractBlock(); 723Contract.Assert(originalPath != null); 724Contract.Assert(fullPath != null); 746Contract.Assert(fullPath != null);
system\io\driveinfo.cs (1)
60Contract.EndContractBlock();
system\io\file.cs (59)
49Contract.EndContractBlock(); 59Contract.EndContractBlock(); 69Contract.EndContractBlock(); 94Contract.EndContractBlock(); 119Contract.EndContractBlock(); 136Contract.EndContractBlock(); 148Contract.Requires(sourceFileName != null); 149Contract.Requires(destFileName != null); 150Contract.Requires(sourceFileName.Length > 0); 151Contract.Requires(destFileName.Length > 0); 253Contract.EndContractBlock(); 280Contract.EndContractBlock(); 321Contract.EndContractBlock(); 352Contract.EndContractBlock(); 429Contract.Assert(path != null, "File.Exists: GetFullPathInternal returned null"); 741Contract.EndContractBlock(); 789Contract.EndContractBlock(); 805Contract.EndContractBlock(); 819Contract.EndContractBlock(); 829Contract.Requires(path != null); 830Contract.Requires(encoding != null); 831Contract.Requires(path.Length > 0); 846Contract.EndContractBlock(); 862Contract.EndContractBlock(); 876Contract.EndContractBlock(); 886Contract.Requires(path != null); 887Contract.Requires(encoding != null); 888Contract.Requires(path.Length > 0); 948Contract.EndContractBlock(); 964Contract.EndContractBlock(); 974Contract.Requires(path != null); 975Contract.Requires(path.Length != 0); 976Contract.Requires(bytes != null); 993Contract.EndContractBlock(); 1008Contract.EndContractBlock(); 1017Contract.Requires(path != null); 1018Contract.Requires(encoding != null); 1019Contract.Requires(path.Length != 0); 1039Contract.EndContractBlock(); 1054Contract.EndContractBlock(); 1069Contract.EndContractBlock(); 1086Contract.EndContractBlock(); 1101Contract.EndContractBlock(); 1118Contract.EndContractBlock(); 1127Contract.Requires(writer != null); 1128Contract.Requires(contents != null); 1147Contract.EndContractBlock(); 1162Contract.EndContractBlock(); 1171Contract.Requires(path != null); 1172Contract.Requires(encoding != null); 1173Contract.Requires(path.Length > 0); 1189Contract.EndContractBlock(); 1206Contract.EndContractBlock(); 1245Contract.EndContractBlock(); 1280Contract.EndContractBlock(); 1293Contract.EndContractBlock(); 1303Contract.Requires(sourceFileName != null); 1304Contract.Requires(destinationFileName != null); 1401Contract.Assert(false, "File::FillAttributeInfo - FindClose failed!");
system\io\fileinfo.cs (5)
73Contract.EndContractBlock(); 143Contract.Assert(Path.GetRootLength(fullPath) > 0, "fullPath must be fully qualified!"); 289Contract.EndContractBlock(); 312Contract.EndContractBlock(); 462Contract.EndContractBlock();
system\io\filestream.cs (100)
163Contract.Assert(_overlapped != null, "Did Overlapped.Pack or Overlapped.UnsafePack just return a null?"); 302Contract.Assert(_isComplete == true, "FileStreamAsyncResult::Wait - AsyncFSCallback didn't set _isComplete to true!"); 357Contract.Assert(!wh.SafeWaitHandle.IsClosed, "ManualResetEvent already closed!"); 359Contract.Assert(r, "ManualResetEvent::Set failed!"); 372Contract.Assert(_handle != null, "_handle should not be null."); 373Contract.Assert(_overlapped != null, "Cancel should only be called on true asynchronous FileStreamAsyncResult, i.e. _overlapped is not null"); 626Contract.EndContractBlock(); 762Contract.Assert(mode != FileMode.Append); 919Contract.Assert(!_exposedHandle, "Are we closing handle that we exposed/not own, how?"); 1013Contract.EndContractBlock(); 1025Contract.Assert(handleType == Win32Native.FILE_TYPE_DISK || handleType == Win32Native.FILE_TYPE_PIPE || handleType == Win32Native.FILE_TYPE_CHAR, "FileStream was passed an unknown file type!"); 1227Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1240Contract.EndContractBlock(); 1263Contract.EndContractBlock(); 1361Contract.Assert(_writePos == 0, "FileStream: Write buffer must be empty in FlushRead!"); 1363Contract.Assert(CanSeek, "FileStream will lose buffered read data now."); 1374Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream: Read buffer must be empty in FlushWrite!"); 1447Contract.EndContractBlock(); 1474Contract.Assert(value >= 0, "value >= 0"); 1506Contract.EndContractBlock(); 1510Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1555Contract.Assert(_readPos == _readLen, "Read buffer should be empty!"); 1570Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 1571Contract.Assert(CanRead, "CanRead"); 1573Contract.Assert(buffer != null, "buffer != null"); 1574Contract.Assert(_writePos == 0, "_writePos == 0"); 1575Contract.Assert(offset >= 0, "offset is negative"); 1576Contract.Assert(count >= 0, "count is negative"); 1602Contract.Assert(r >= 0, "FileStream's ReadCore is likely broken."); 1612Contract.EndContractBlock(); 1616Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1680Contract.Assert(_readLen >= 0 && _readPos <= _readLen, "_readLen should be nonnegative, and _readPos should be less than or equal _readLen"); 1681Contract.Assert(pos == Position, "Seek optimization: pos != Position! Buffer math was mangled."); 1691Contract.Assert(!_handle.IsClosed && CanSeek, "!_handle.IsClosed && CanSeek"); 1692Contract.Assert(origin>=SeekOrigin.Begin && origin<=SeekOrigin.End, "origin>=SeekOrigin.Begin && origin<=SeekOrigin.End"); 1760Contract.EndContractBlock(); 1811Contract.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 1826Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 1827Contract.Assert(CanWrite, "CanWrite"); 1829Contract.Assert(buffer != null, "buffer != null"); 1830Contract.Assert(_readPos == _readLen, "_readPos == _readLen"); 1831Contract.Assert(offset >= 0, "offset is negative"); 1832Contract.Assert(count >= 0, "count is negative"); 1862Contract.Assert(r >= 0, "FileStream's WriteCore is likely broken."); 1880Contract.EndContractBlock(); 1899Contract.Assert(_isAsync); 1903Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 1932Contract.Assert(_writePos == 0, "FileStream must not have buffered write data here! Pipes should be unidirectional."); 1937Contract.Assert(!_isPipe, "Should not be a pipe."); 2012Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 2013Contract.Assert(CanRead, "CanRead"); 2014Contract.Assert(bytes != null, "bytes != null"); 2015Contract.Assert(_writePos == 0, "_writePos == 0"); 2016Contract.Assert(_isAsync, "BeginReadCore doesn't work on synchronous file streams!"); 2017Contract.Assert(offset >= 0, "offset is negative"); 2018Contract.Assert(numBytes >= 0, "numBytes is negative"); 2124Contract.EndContractBlock(); 2163Contract.Assert((_readPos==0 && _readLen==0 && _writePos >= 0) || (_writePos==0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 2166Contract.Assert(_bufferSize > 0, "_bufferSize > 0"); 2192Contract.EndContractBlock(); 2211Contract.Assert(_isAsync); 2215Contract.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), "We're either reading or writing, but not both."); 2232Contract.Assert(_readPos == 0 && _readLen == 0, "FileStream must not have buffered data here! Pipes should be unidirectional."); 2272Contract.Assert(!_handle.IsClosed, "!_handle.IsClosed"); 2273Contract.Assert(CanWrite, "CanWrite"); 2274Contract.Assert(bytes != null, "bytes != null"); 2275Contract.Assert(_readPos == _readLen, "_readPos == _readLen"); 2276Contract.Assert(_isAsync, "BeginWriteCore doesn't work on synchronous file streams!"); 2277Contract.Assert(offset >= 0, "offset is negative"); 2278Contract.Assert(numBytes >= 0, "numBytes is negative"); 2377Contract.EndContractBlock(); 2422Contract.Assert(_bufferSize > 0, "_bufferSize > 0"); 2436Contract.EndContractBlock(); 2452Contract.EndContractBlock(); 2488Contract.Requires(handle != null, "handle != null"); 2489Contract.Requires(offset >= 0, "offset >= 0"); 2490Contract.Requires(count >= 0, "count >= 0"); 2491Contract.Requires(bytes != null, "bytes != null"); 2496Contract.EndContractBlock(); 2498Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to ReadFileNative."); 2543Contract.Requires(handle != null, "handle != null"); 2544Contract.Requires(offset >= 0, "offset >= 0"); 2545Contract.Requires(count >= 0, "count >= 0"); 2546Contract.Requires(bytes != null, "bytes != null"); 2553Contract.EndContractBlock(); 2555Contract.Assert((_isAsync && overlapped != null) || (!_isAsync && overlapped == null), "Async IO parameter ----up in call to WriteFileNative."); 2613Contract.EndContractBlock(); 2665Contract.EndContractBlock(); 2723Contract.Assert(task != null); 2732Contract.Assert((!asyncResult.IsWrite && typeof(T) == typeof(int)) || 2734Contract.Assert(asyncResult != null); 2735Contract.Assert(asyncResult.IsAsync); 2754Contract.Assert(asyncResult != null); 2755Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?"); 2758Contract.Assert(readTask != null); 2773Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?"); 2790Contract.Assert(asyncResult != null); 2791Contract.Assert(asyncResult.IsCompleted, "How can we end up in the completion callback if the IAsyncResult is not completed?"); 2794Contract.Assert(writeTask != null); 2809Contract.Assert(cancellationToken.IsCancellationRequested, "How can the IO operation be aborted if cancellation was not requested?");
system\io\filesystemenumerable.cs (28)
43Contract.Requires(path != null); 44Contract.Requires(originalUserPath != null); 45Contract.Requires(searchPattern != null); 53Contract.Requires(path != null); 54Contract.Requires(originalUserPath != null); 55Contract.Requires(searchPattern != null); 64Contract.Requires(path != null); 65Contract.Requires(originalUserPath != null); 66Contract.Requires(searchPattern != null); 74Contract.Requires(path != null); 75Contract.Requires(originalUserPath != null); 76Contract.Requires(searchPattern != null); 195Contract.Requires(path != null); 196Contract.Requires(originalUserPath != null); 197Contract.Requires(searchPattern != null); 198Contract.Requires(searchOption == SearchOption.AllDirectories || searchOption == SearchOption.TopDirectoryOnly); 199Contract.Requires(resultHandler != null); 265Contract.Assert(searchCriteria != null && searchData != null, "searchCriteria and searchData should be initialized"); 414Contract.Assert(searchData.searchOption != SearchOption.TopDirectoryOnly, "should not reach this code path if searchOption == TopDirectoryOnly"); 419Contract.Assert((searchData.fullPath != null), "fullpath can't be null!"); 525Contract.Requires(localSearchData != null); 597Contract.Requires(searchPattern != null); 614Contract.Requires(fullSearchString != null); 615Contract.Requires(fullPathMod != null); 616Contract.Requires(fullSearchString.Length >= fullPathMod.Length); 627Contract.Assert(fullSearchString.Length > fullPathMod.Length); 635Contract.Requires(fullPath != null); 636Contract.Requires(searchPattern != null);
system\io\filesysteminfo.cs (1)
74Contract.EndContractBlock();
system\io\isolatedstorage\isolatedstorage.cs (2)
796Contract.Assert(m_ValidQuota == false, "Quota should be invalid here"); 966Contract.Assert(evidence != null, "evidence != null");
system\io\isolatedstorage\isolatedstoragefile.cs (23)
191Contract.EndContractBlock(); 215Contract.EndContractBlock(); 253Contract.EndContractBlock(); 414Contract.EndContractBlock(); 504Contract.EndContractBlock(); 546Contract.EndContractBlock(); 590Contract.EndContractBlock(); 636Contract.EndContractBlock(); 698Contract.EndContractBlock(); 739Contract.EndContractBlock(); 780Contract.EndContractBlock(); 826Contract.EndContractBlock(); 848Contract.EndContractBlock(); 980Contract.EndContractBlock(); 1046Contract.EndContractBlock(); 1136Contract.EndContractBlock(); 1198Contract.EndContractBlock(); 1231Contract.EndContractBlock(); 1250Contract.Requires(searchPattern != null); 1600Contract.Requires(path != null); 2412Contract.EndContractBlock(); 2880Contract.Assert(m_RootDir[m_nRootDir].Length < Path.MaxPath); 2936Contract.Assert(m_Root.Length < Path.MaxPath);
system\io\isolatedstorage\isolatedstoragefilestream.cs (7)
121Contract.EndContractBlock(); 340Contract.EndContractBlock(); 417Contract.EndContractBlock(); 468Contract.EndContractBlock(); 477Contract.EndContractBlock(); 703Contract.EndContractBlock(); 748Contract.EndContractBlock();
system\io\longpath.cs (36)
43Contract.Requires(path != null); 52Contract.Requires(path != null); 58Contract.Requires(path1 != null); 59Contract.Requires(path2 != null); 60Contract.Requires(path2.Length != 0); 61Contract.Requires(!IsPathRooted(path2)); 94Contract.Requires(path != null); 167Contract.Requires(path != null); 192Contract.Requires(sourceFileName != null); 193Contract.Requires(destFileName != null); 194Contract.Requires(sourceFileName.Length > 0); 195Contract.Requires(destFileName.Length > 0); 209Contract.Requires(fullSourceFileName != null); 210Contract.Requires(fullDestFileName != null); 211Contract.Requires(fullSourceFileName.Length > 0); 212Contract.Requires(fullDestFileName.Length > 0); 256Contract.Requires(path != null); 296Contract.Assert(path != null, "File.Exists: GetFullPathInternal returned null"); 316Contract.Requires(path != null); 326Contract.Requires(path != null); 347Contract.Requires(path != null); 367Contract.Requires(path != null); 394Contract.Requires(sourceFileName != null); 395Contract.Requires(destFileName != null); 396Contract.Requires(sourceFileName.Length > 0); 397Contract.Requires(destFileName.Length > 0); 420Contract.Requires(path != null); 449Contract.Requires(path != null); 450Contract.Requires(path.Length > 0); 623Contract.Requires(sourceDirName != null); 624Contract.Requires(destDirName != null); 625Contract.Requires(sourceDirName.Length != 0); 626Contract.Requires(destDirName.Length != 0); 925Contract.Assert(false, "Ignore this assert and file a bug to the BCL team. This assert was tracking purposes only."); 936Contract.Requires(path != null); 945Contract.Requires(path != null);
system\io\memorystream.cs (20)
74Contract.EndContractBlock(); 91Contract.EndContractBlock(); 117Contract.EndContractBlock(); 274Contract.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 292Contract.Ensures(_capacity - _origin == value); 293Contract.EndContractBlock(); 328Contract.Ensures(Position == value); 329Contract.EndContractBlock(); 348Contract.EndContractBlock(); 357Contract.Assert(_position + n >= 0, "_position + n >= 0"); // len is less than 2^31 -1. 385Contract.EndContractBlock(); // contract validation copied from Read(...) 395Contract.Assert(t == null || t.Status == TaskStatus.RanToCompletion, 444Contract.EndContractBlock(); 513Contract.Assert(_position >= 0, "_position >= 0"); 531Contract.Ensures(_length - _origin == value); 532Contract.EndContractBlock(); 536Contract.Assert(MemStreamMaxLength == Int32.MaxValue); // Check parameter validation logic in this method if this fails. 566Contract.EndContractBlock(); 612Contract.EndContractBlock(); // contract validation copied from Write(...) 658Contract.EndContractBlock();
system\io\path.cs (12)
364Contract.EndContractBlock(); 488Contract.Requires(path != null, "path can't be null"); 511Contract.Requires(path != null, "path can't be null"); 871Contract.Assert(lastSlash < newBuffer.Length, "path unexpectedly ended in a '\'"); 1079Contract.Assert(path != null, "path can't be null"); 1200Contract.EndContractBlock(); 1210Contract.EndContractBlock(); 1221Contract.EndContractBlock(); 1234Contract.EndContractBlock(); 1313Contract.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 1353Contract.Assert(((b2 & 0xF8) == 0), "Unexpected set bits"); 1400Contract.EndContractBlock();
system\io\pathhelper.cs (9)
65Contract.Requires(charArrayPtr != null); 67Contract.Requires(length == Path.MaxPath); 120Contract.Requires(index >= 0 && index < Length); 130Contract.Requires(index >= 0 && index < Length); 173Contract.Assert(result < Path.MaxPath, "did we accidently remove a PathTooLongException check?"); 210Contract.Assert(result < m_maxPath, "did we accidentally remove a PathTooLongException check?"); 392Contract.Requires(useStackAlloc, "This should never be called for PathHelpers wrapping a StringBuilder"); 397Contract.Requires(!useStackAlloc, "This should never be called for PathHelpers that wrap a stackalloc'd buffer"); 403Contract.Requires(useStackAlloc, "This should never be called for PathHelpers wrapping a StringBuilder");
system\io\pinnedbuffermemorystream.cs (1)
35Contract.Assert(array != null, "Array can't be null");
system\io\ReadLinesIterator.cs (4)
35Contract.Requires(path != null); 36Contract.Requires(path.Length > 0); 37Contract.Requires(encoding != null); 38Contract.Requires(reader != null);
system\io\stream.cs (66)
107Contract.Ensures(Contract.Result<int>() >= 0); 118Contract.Ensures(Contract.Result<int>() >= 0); 157Contract.EndContractBlock(); 164Contract.Requires(destination != null); 165Contract.Requires(bufferSize > 0); 166Contract.Requires(CanRead); 167Contract.Requires(destination.CanWrite); 193Contract.EndContractBlock(); 213Contract.EndContractBlock(); 220Contract.Requires(destination != null); 221Contract.Requires(CanRead); 222Contract.Requires(destination.CanWrite); 223Contract.Requires(bufferSize > 0); 293Contract.Ensures(Contract.Result<WaitHandle>() != null); 300Contract.Ensures(Contract.Result<IAsyncResult>() != null); 307Contract.Ensures(Contract.Result<IAsyncResult>() != null); 344Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask"); 367Contract.Ensures(Contract.Result<int>() >= 0); 368Contract.EndContractBlock(); 401Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 447Contract.Ensures(Contract.Result<IAsyncResult>() != null); 454Contract.Ensures(Contract.Result<IAsyncResult>() != null); 490Contract.Assert(thisTask != null, "Inside ReadWriteTask, InternalCurrent should be the ReadWriteTask"); 511Contract.Assert(readWriteTask != null); // Should be Contract.Requires, but CCRewrite is doing a poor job with 513Contract.Assert(asyncWaiter != null); // Ditto 518Contract.Assert(asyncWaiter.IsRanToCompletion, "The semaphore wait should always complete successfully."); 525Contract.Assert(t.IsRanToCompletion, "The semaphore wait should always complete successfully."); 537Contract.Requires(readWriteTask != null); 538Contract.Assert(_activeReadWriteTask == null, "Expected no other readers or writers"); 554Contract.EndContractBlock(); 584Contract.Assert(writeTask.Status == TaskStatus.RanToCompletion); 589Contract.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 636Contract.Requires(function != null); 637Contract.Requires(stream != null); 638Contract.Requires(buffer != null); 639Contract.EndContractBlock(); 749Contract.Ensures(Contract.Result<int>() >= -1); 750Contract.Ensures(Contract.Result<int>() < 256); 778Contract.Ensures(Contract.Result<Stream>() != null); 779Contract.EndContractBlock(); 795Contract.Ensures(Contract.Result<IAsyncResult>() != null); 821Contract.Ensures(Contract.Result<int>() >= 0); 828Contract.Ensures(Contract.Result<IAsyncResult>() != null); 917Contract.EndContractBlock(); 934Contract.EndContractBlock(); 1088Contract.EndContractBlock(); 1204Contract.Requires(stream != null, "Expected a non-null stream."); 1205Contract.Requires(methodName == "BeginRead" || methodName == "BeginWrite", 1252Contract.Ensures(Contract.Result<int>() >= 0); 1253Contract.EndContractBlock(); 1310Contract.EndContractBlock();
system\io\streamreader.cs (31)
171Contract.EndContractBlock(); 238Contract.EndContractBlock(); 392Contract.EndContractBlock(); 453Contract.EndContractBlock(); 468Contract.Assert(byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?"); 540Contract.Assert(bytePos <= _preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?"); 551Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 574Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 576Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 594Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 596Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 656Contract.Assert(charsRead == 0); 659Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 661Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 683Contract.Assert(bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 687Contract.Assert(byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 912Contract.EndContractBlock(); 966Contract.Assert(n == 0); 970Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 973Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 994Contract.Assert(n == 0); 1006Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1010Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1040Contract.Assert(n == 0); 1048Contract.Assert(n > 0); 1057Contract.Assert(n > 0); 1100Contract.EndContractBlock(); 1196Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1199Contract.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1217Contract.Assert(BytePos_Prop == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1219Contract.Assert(ByteLen_Prop >= 0, "Stream.Read returned a negative number! Bug in stream class.");
system\io\streamwriter.cs (24)
148Contract.EndContractBlock(); 190Contract.EndContractBlock(); 384Contract.Assert(n > 0, "StreamWriter::Write(char[]) isn't making progress! This is most likely a ---- in user code."); 402Contract.EndContractBlock(); 412Contract.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code."); 436Contract.Assert(n > 0, "StreamWriter::Write(String) isn't making progress! This is most likely a race condition in user code."); 479Contract.Assert(_this.charPos == 0); 492Contract.Assert(_this.charPos == 0); 503Contract.Assert(_this.charPos == 0); 546Contract.Requires(value != null); 555Contract.Assert(_this.charPos == 0); 563Contract.Assert(n > 0, "StreamWriter::Write(String) isn't making progress! This is most likely a race condition in user code."); 578Contract.Assert(_this.charPos == 0); 589Contract.Assert(_this.charPos == 0); 608Contract.EndContractBlock(); 635Contract.Requires(count == 0 || (count > 0 && buffer != null)); 636Contract.Requires(index >= 0); 637Contract.Requires(count >= 0); 638Contract.Requires(buffer == null || (buffer != null && buffer.Length - index >= count)); 644Contract.Assert(_this.charPos == 0); 651Contract.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code."); 666Contract.Assert(_this.charPos == 0); 677Contract.Assert(_this.charPos == 0); 765Contract.EndContractBlock();
system\io\stringreader.cs (4)
39Contract.EndContractBlock(); 94Contract.EndContractBlock(); 172Contract.EndContractBlock(); 186Contract.EndContractBlock();
system\io\stringwriter.cs (2)
60Contract.EndContractBlock(); 118Contract.EndContractBlock();
system\io\textreader.cs (31)
96Contract.Ensures(Contract.Result<int>() >= -1); 108Contract.Ensures(Contract.Result<int>() >= -1); 127Contract.Ensures(Contract.Result<int>() >= 0); 128Contract.Ensures(Contract.Result<int>() <= Contract.OldValue(count)); 129Contract.EndContractBlock(); 144Contract.Ensures(Contract.Result<String>() != null); 161Contract.Ensures(Contract.Result<int>() >= 0); 162Contract.Ensures(Contract.Result<int>() <= count); 227Contract.EndContractBlock(); 234Contract.Requires(buffer != null); 235Contract.Requires(index >= 0); 236Contract.Requires(count >= 0); 237Contract.Requires(buffer.Length - index >= count); 254Contract.EndContractBlock(); 262Contract.Requires(buffer != null); 263Contract.Requires(index >= 0); 264Contract.Requires(count >= 0); 265Contract.Requires(buffer.Length - index >= count); 284Contract.Ensures(Contract.Result<TextReader>() != null); 285Contract.EndContractBlock(); 402Contract.EndContractBlock(); 417Contract.EndContractBlock();
system\io\textwriter.cs (4)
180Contract.Ensures(Contract.Result<TextWriter>() != null); 181Contract.EndContractBlock(); 217Contract.EndContractBlock();
system\io\unmanagedmemoryaccessor.cs (13)
81Contract.EndContractBlock(); 550Contract.EndContractBlock(); 592Contract.EndContractBlock(); 1034Contract.EndContractBlock(); 1079Contract.EndContractBlock(); 1093Contract.Assert(CanRead, "UMA not readable"); 1094Contract.Assert(position >= 0, "position less than 0"); 1095Contract.Assert(position <= _capacity - sizeof(byte), "position is greater than capacity - sizeof(byte)"); 1116Contract.Assert(CanWrite, "UMA not writeable"); 1117Contract.Assert(position >= 0, "position less than 0"); 1118Contract.Assert(position <= _capacity - sizeof(byte), "position is greater than capacity - sizeof(byte)"); 1145Contract.EndContractBlock(); 1166Contract.EndContractBlock();
system\io\unmanagedmemorystream.cs (13)
161Contract.EndContractBlock(); 236Contract.EndContractBlock(); 327Contract.EndContractBlock(); 334Contract.EndContractBlock(); 401Contract.EndContractBlock(); // Keep this in sync with contract validation in ReadAsync 419Contract.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1. 457Contract.EndContractBlock(); // contract validation copied from Read(...) 470Contract.Assert(! (ex is OperationCanceledException)); 540Contract.Assert(finalPos >= 0, "_position >= 0"); 548Contract.EndContractBlock(); 580Contract.EndContractBlock(); // Keep contract validation in sync with WriteAsync(..) 654Contract.EndContractBlock(); // contract validation copied from Write(..) 666Contract.Assert(! (ex is OperationCanceledException));
system\io\unmanagedmemorystreamwrapper.cs (2)
133Contract.EndContractBlock(); 174Contract.EndContractBlock();
system\Lazy.cs (5)
96Contract.Assert(false, "ALREADY_INVOKED_SENTINEL should never be invoked."); 329Contract.Assert(m_boxed != null); 384Contract.Assert(m_boxed != null); 398Contract.Assert(exHolder != null); 409Contract.Assert(boxed != null);
system\marshalbyrefobject.cs (2)
136Contract.Assert(!RemotingServices.IsTransparentProxy(obj), "Use this method for server objects only"); 243Contract.EndContractBlock();
system\math.cs (10)
137Contract.EndContractBlock(); 151Contract.EndContractBlock(); 256Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 259Contract.EndContractBlock(); 271Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 274Contract.EndContractBlock(); 286Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 289Contract.EndContractBlock(); 301Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (hack for JIT inlining)"); 304Contract.EndContractBlock();
system\missingmemberexception.cs (1)
92Contract.EndContractBlock();
system\multicastdelegate.cs (5)
147Contract.Assert((_invocationList as Object[]) != null, "empty invocation list on multicast delegate"); 179Contract.Assert(d != null && (_invocationList as Object[]) != null, "bogus delegate in multicast list comparison"); 254Contract.Assert(!IsUnmanagedFunctionPtr(), "dynamic method and unmanaged fntptr delegate combined"); 463Contract.Ensures(Contract.Result<Delegate[]>() != null);
system\notfinitenumberexception.cs (1)
66Contract.EndContractBlock();
system\nullable.cs (1)
136Contract.EndContractBlock();
system\number.cs (12)
413Contract.Assert(p != null, ""); 432Contract.Assert(*p >= 'a' && *p <= 'f', ""); 458Contract.Assert(p != null, ""); 477Contract.Assert(*p >= 'a' && *p <= 'f', ""); 507Contract.Assert(p != null, ""); 541Contract.Assert(p != null, ""); 575Contract.Assert(p != null, ""); 603Contract.Assert(p != null, ""); 631Contract.Assert(p != null && str != null, ""); 1026Contract.EndContractBlock(); 1027Contract.Assert(info != null, ""); 1209Contract.Assert(numfmt != null, "");
system\object.cs (8)
131Contract.Requires(typeName != null); 132Contract.Requires(fieldName != null); 166Contract.Requires(typeName != null); 167Contract.Requires(fieldName != null); 180Contract.Requires(typeName != null); 181Contract.Requires(fieldName != null); 182Contract.Ensures(Contract.Result<FieldInfo>() != null);
system\operatingsystem.cs (2)
52Contract.EndContractBlock(); 85Contract.EndContractBlock();
system\progress.cs (1)
53Contract.Assert(m_synchronizationContext != null);
system\random.cs (3)
164Contract.EndContractBlock(); 185Contract.EndContractBlock(); 208Contract.EndContractBlock();
system\reflection\assembly.cs (79)
77Contract.EndContractBlock(); 127Contract.Ensures(Contract.Result<Assembly>() != null); 128Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 168Contract.Ensures(Contract.Result<Assembly>() != null); 191Contract.Ensures(Contract.Result<Assembly>() != null); 216Contract.Ensures(Contract.Result<Assembly>() != null); 259Contract.Ensures(Contract.Result<Assembly>() != null); 260Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 280Contract.Ensures(Contract.Result<Assembly>() != null); 281Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 325Contract.Ensures(Contract.Result<Assembly>() != null); 336Contract.Ensures(Contract.Result<Assembly>() != null); 337Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 353Contract.Ensures(Contract.Result<Assembly>() != null); 354Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 372Contract.Ensures(Contract.Result<Assembly>() != null); 373Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 410Contract.Ensures(Contract.Result<Assembly>() != null); 411Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 433Contract.Ensures(Contract.Result<Assembly>() != null); 462Contract.Ensures(Contract.Result<Assembly>() != null); 463Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 487Contract.Ensures(Contract.Result<Assembly>() != null); 488Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 517Contract.Ensures(Contract.Result<Assembly>() != null); 518Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 548Contract.Ensures(Contract.Result<Assembly>() != null); 549Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 582Contract.Ensures(Contract.Result<Assembly>() != null); 583Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 601Contract.Ensures(Contract.Result<Assembly>() != null); 602Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 918Contract.Ensures(Contract.Result<Object[]>() != null); 924Contract.Ensures(Contract.Result<Object[]>() != null); 1291Contract.Assert(((MetadataToken)invocableAttribute.MetadataToken).IsTypeDef); 1294Contract.Assert(ctor != null); 1297Contract.Assert(((MetadataToken)token).IsMethodDef); 1628Contract.EndContractBlock(); 1655Contract.EndContractBlock(); 1669Contract.EndContractBlock(); 1699Contract.EndContractBlock(); 1759Contract.EndContractBlock(); 1812Contract.EndContractBlock(); 2810Contract.Assert( codeBase != null, "Must pass in a valid CodeBase" ); 2835Contract.Assert( false, "Unable to create WebPermission" ); 2884Contract.EndContractBlock();
system\reflection\assemblyattributes.cs (1)
196Contract.EndContractBlock();
system\reflection\assemblyname.cs (3)
207Contract.EndContractBlock(); 323Contract.EndContractBlock(); 389Contract.EndContractBlock();
system\reflection\Associates.cs (3)
49Contract.Assert(declaredType != null); 50Contract.Assert(reflectedType != null); 68Contract.Assert(!associateMethodHandle.IsNullHandle(), "Failed to resolve associateRecord methodDef token");
system\reflection\ConstructorInfo.cs (5)
273Contract.Ensures(methodAttributes == RuntimeMethodHandle.GetAttributes(handle)); 405Contract.EndContractBlock(); 420Contract.EndContractBlock(); 540Contract.EndContractBlock(); 769Contract.EndContractBlock();
system\reflection\customattribute.cs (70)
43Contract.EndContractBlock(); 52Contract.EndContractBlock(); 61Contract.EndContractBlock(); 71Contract.Assert(target != null); 94Contract.Assert(target != null); 117Contract.Assert(target != null); 140Contract.Assert(target != null); 148Contract.Assert(target != null); 156Contract.Assert(target != null); 164Contract.Assert(target != null); 175Contract.Assert(target != null); 198Contract.Assert(target != null); 838Contract.Assert(value != null); 1033Contract.EndContractBlock(); 1035Contract.Assert(customAttributeCtorParameters != null); 1036Contract.Assert(customAttributeNamedParameters != null); 1085Contract.EndContractBlock(); 1189Contract.Requires(type != null); 1219Contract.Requires(method != null); 1220Contract.Requires(caType != null); 1247Contract.Requires(ctor != null); 1248Contract.Requires(caType != null); 1259Contract.Requires(property != null); 1260Contract.Requires(caType != null); 1271Contract.Requires(e != null); 1272Contract.Requires(caType != null); 1283Contract.Requires(field != null); 1284Contract.Requires(caType != null); 1295Contract.Requires(parameter != null); 1296Contract.Requires(caType != null); 1307Contract.Requires(assembly != null); 1308Contract.Requires(caType != null); 1319Contract.Requires(module != null); 1320Contract.Requires(caType != null); 1331Contract.Requires(type != null); 1332Contract.Requires(caType != null); 1391Contract.Assert(type != null); 1414Contract.Requires(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 1435Contract.Requires(method != null); 1436Contract.Requires(caType != null); 1480Contract.Requires(ctor != null); 1481Contract.Requires(caType != null); 1493Contract.Requires(property != null); 1494Contract.Requires(caType != null); 1512Contract.Requires(e != null); 1513Contract.Requires(caType != null); 1530Contract.Requires(field != null); 1531Contract.Requires(caType != null); 1543Contract.Requires(parameter != null); 1544Contract.Requires(caType != null); 1556Contract.Requires(assembly != null); 1557Contract.Requires(caType != null); 1571Contract.Requires(module != null); 1572Contract.Requires(caType != null); 1601Contract.EndContractBlock(); 1607Contract.Assert(attributeCtorToken == 0); 1630Contract.Assert(attributeFilterType == null); 1631Contract.Assert(!MetadataToken.IsNullToken(attributeCtorToken)); 1659Contract.EndContractBlock(); 1963Contract.Assert(decoratedToken.IsModule || decoratedToken.IsAssembly, 2163Contract.Assert(pca.BaseType == (RuntimeType)typeof(Attribute), "Pseudo CA Error"); 2165Contract.Assert(usage.Inherited == false, "Pseudo CA Error"); 2182Contract.Requires(type != null); 2183Contract.Requires(caType != null); 2255Contract.Requires(method != null); 2256Contract.Requires(caType != null); 2320Contract.Requires(parameter != null); 2321Contract.Requires(caType != null); 2437Contract.Requires(field != null); 2438Contract.Requires(caType != null);
system\reflection\emit\assemblybuilder.cs (30)
231Contract.Requires(module != null); 232Contract.Assert(this.InternalAssembly == module.Assembly); 501Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 515Contract.Ensures(Contract.Result<AssemblyBuilder>() != null); 597Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 609Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 641Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 642Contract.EndContractBlock(); 646Contract.Assert(m_assemblyData != null, "m_assemblyData is null in DefineDynamicModuleInternal"); 789Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 813Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 865Contract.Ensures(Contract.Result<ModuleBuilder>() != null); 866Contract.EndContractBlock(); 1044Contract.EndContractBlock(); 1134Contract.EndContractBlock(); 1484Contract.EndContractBlock(); 1510Contract.EndContractBlock(); 1574Contract.EndContractBlock(); 1623Contract.EndContractBlock(); 1663Contract.EndContractBlock(); 1700Contract.EndContractBlock(); 1774Contract.EndContractBlock();
system\reflection\emit\constructorbuilder.cs (1)
239Contract.EndContractBlock();
system\reflection\emit\customattributebuilder.cs (4)
123Contract.EndContractBlock(); 332Contract.Assert(false, "Invalid primitive type"); 416Contract.Assert(false, "Invalid enum base type"); 494Contract.Assert(false, "Invalid primitive type");
system\reflection\emit\dynamicilgenerator.cs (13)
68Contract.EndContractBlock(); 97Contract.EndContractBlock(); 154Contract.EndContractBlock(); 182Contract.EndContractBlock(); 199Contract.EndContractBlock(); 220Contract.EndContractBlock(); 326Contract.EndContractBlock(); 357Contract.EndContractBlock(); 370Contract.Assert(opcode.Equals(OpCodes.Calli), 407Contract.EndContractBlock(); 1078Contract.EndContractBlock(); 1104Contract.EndContractBlock(); 1129Contract.EndContractBlock();
system\reflection\emit\dynamicmethod.cs (15)
278Contract.EndContractBlock(); 379Contract.Assert(owner == null && m == null, "owner and m cannot be set for transparent methods"); 392Contract.Assert(m != null || owner != null, "PerformSecurityCheck should ensure that either m or owner is set"); 393Contract.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); 394Contract.Assert(m == null || owner == null, "m and owner cannot both be set"); 445Contract.EndContractBlock(); 647Contract.Assert(assembly != null); 654Contract.Assert(assembly != null); 673Contract.Assert(assembly != null); 680Contract.Assert(assembly != null); 699Contract.Assert(assembly != null); 706Contract.Assert(assembly != null); 717Contract.EndContractBlock(); 937Contract.EndContractBlock(); 953Contract.EndContractBlock();
system\reflection\emit\eventbuilder.cs (3)
70Contract.EndContractBlock(); 118Contract.EndContractBlock(); 137Contract.EndContractBlock();
system\reflection\emit\fieldbuilder.cs (4)
52Contract.EndContractBlock(); 204Contract.EndContractBlock(); 235Contract.EndContractBlock(); 250Contract.EndContractBlock();
system\reflection\emit\generictypeparameterbuilder.cs (1)
87Contract.EndContractBlock();
system\reflection\emit\ilgenerator.cs (33)
35Contract.Requires(incoming != null); 36Contract.Ensures(Contract.Result<int[]>() != null); 37Contract.Ensures(Contract.Result<int[]>().Length > incoming.Length); 124Contract.Requires(methodBuilder != null); 125Contract.Requires(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod); 426Contract.Assert(m_RelocFixupList == null); 490Contract.EndContractBlock(); 615Contract.EndContractBlock(); 648Contract.EndContractBlock(); 666Contract.Assert(opcode.Equals(OpCodes.Calli), 685Contract.EndContractBlock(); 700Contract.Assert(opcode.Equals(OpCodes.Call) || 708Contract.Assert(opcode.Equals(OpCodes.Call) || 819Contract.EndContractBlock(); 869Contract.EndContractBlock(); 1172Contract.EndContractBlock(); 1235Contract.EndContractBlock(); 1310Contract.EndContractBlock(); 1339Contract.EndContractBlock(); 1481Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1498Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1540Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0"); 1541Contract.Assert(m_catchAddr[m_currentCatch-1] > 0,"m_catchAddr[m_currentCatch-1] > 0"); 1542Contract.Assert(m_catchEndAddr[m_currentCatch-1] == -1,"m_catchEndAddr[m_currentCatch-1] == -1"); 1604Contract.Requires(exc != null); 1605Contract.Assert(m_currentCatch > 0,"m_currentCatch > 0"); 1606Contract.Assert(exc.m_currentCatch > 0,"exc.m_currentCatch > 0"); 1615Contract.Assert(exc.GetEndAddress() != GetEndAddress(), 1719Contract.EndContractBlock(); 1830Contract.Assert(i < m_DocumentCount, "Bad document look up!"); 1921Contract.Assert(document == m_document, "Bad document look up!");
system\reflection\emit\methodbuilder.cs (24)
105Contract.EndContractBlock(); 210Contract.EndContractBlock(); 372Contract.Assert(false, "We should never get here!"); 702Contract.EndContractBlock(); 772Contract.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); 773Contract.Assert(currentToken.Token != 0, "The token should not be 0"); 781Contract.Assert(m_tkMethod.Token == 0, "m_tkMethod should not have been initialized"); 851Contract.EndContractBlock(); 926Contract.EndContractBlock(); 970Contract.EndContractBlock(); 1115Contract.Ensures(Contract.Result<ILGenerator>() != null); 1126Contract.Ensures(Contract.Result<ILGenerator>() != null); 1183Contract.EndContractBlock(); 1201Contract.EndContractBlock(); 1513Contract.EndContractBlock(); 1532Contract.Assert(tryStartOffset >= 0); 1533Contract.Assert(tryEndOffset >= 0); 1534Contract.Assert(filterOffset >= 0); 1535Contract.Assert(handlerStartOffset >= 0); 1536Contract.Assert(handlerEndOffset >= 0); 1537Contract.Assert(IsValidKind((ExceptionHandlingClauseOptions)kind)); 1538Contract.Assert(kind != (int)ExceptionHandlingClauseOptions.Clause || (exceptionTypeToken & 0x00FFFFFF) != 0);
system\reflection\emit\methodbuilderinstantiation.cs (1)
24Contract.EndContractBlock();
system\reflection\emit\methodrental.cs (1)
60Contract.EndContractBlock();
system\reflection\emit\modulebuilder.cs (80)
203Contract.Assert(method != null); 219Contract.Assert(method != null); 241Contract.Assert(runtimeField != null); 496Contract.Assert(!type.IsByRef, "Must not be ByRef."); 497Contract.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments."); 520Contract.EndContractBlock(); 707Contract.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 711Contract.Assert(masmi != null); 1139Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1150Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1161Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1179Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1194Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1206Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1217Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1229Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1240Contract.Ensures(Contract.Result<TypeBuilder>() != null); 1254Contract.Ensures(Contract.Result<EnumBuilder>() != null); 1262Contract.Assert(name == enumBuilder.FullName); 1265Contract.Assert(enumBuilder.m_typeBuilder == m_TypeBuilderDict[name]); 1275Contract.Ensures(Contract.Result<EnumBuilder>() != null); 1287Contract.Ensures(Contract.Result<IResourceWriter>() != null); 1295Contract.Ensures(Contract.Result<IResourceWriter>() != null); 1314Contract.Ensures(Contract.Result<IResourceWriter>() != null); 1315Contract.EndContractBlock(); 1347Contract.EndContractBlock(); 1362Contract.EndContractBlock(); 1403Contract.EndContractBlock(); 1434Contract.EndContractBlock(); 1464Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1472Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1504Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1505Contract.EndContractBlock(); 1526Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1538Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1559Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1560Contract.EndContractBlock(); 1600Contract.Ensures(Contract.Result<FieldBuilder>() != null); 1620Contract.Ensures(Contract.Result<FieldBuilder>() != null); 1621Contract.EndContractBlock(); 1632Contract.Ensures(Contract.Result<FieldBuilder>() != null); 1653Contract.Ensures(Contract.Result<FieldBuilder>() != null); 1654Contract.EndContractBlock(); 1695Contract.EndContractBlock(); 1757Contract.Assert(refedModuleBuilder != null || refedModule is RuntimeModule); 1828Contract.EndContractBlock(); 1977Contract.Assert(methodInfo != null); 2060Contract.EndContractBlock(); 2121Contract.EndContractBlock(); 2211Contract.EndContractBlock(); 2228Contract.EndContractBlock(); 2242Contract.EndContractBlock(); 2266Contract.EndContractBlock(); 2283Contract.EndContractBlock(); 2330Contract.EndContractBlock(); 2376Contract.EndContractBlock();
system\reflection\emit\modulebuilderdata.cs (1)
69Contract.Assert(m_strModuleName == AssemblyBuilder.MANIFEST_MODULE_NAME, "Changing names for non-manifest module");
system\reflection\emit\parameterbuilder.cs (3)
38Contract.EndContractBlock(); 73Contract.EndContractBlock(); 91Contract.EndContractBlock();
system\reflection\emit\propertybuilder.cs (1)
57Contract.EndContractBlock();
system\reflection\emit\signaturehelper.cs (4)
310Contract.Requires(clsArgument != null); 311Contract.Requires((optionalCustomModifiers == null && requiredCustomModifiers == null) || !clsArgument.ContainsGenericParameters); 331Contract.Assert(!MetadataToken.IsNullToken(token)); 354Contract.Assert(!MetadataToken.IsNullToken(token));
system\reflection\emit\symboltype.cs (3)
240Contract.EndContractBlock(); 308Contract.EndContractBlock(); 330Contract.EndContractBlock();
system\reflection\emit\typebuilder.cs (58)
65Contract.EndContractBlock(); 75Contract.EndContractBlock(); 117Contract.EndContractBlock(); 137Contract.EndContractBlock(); 158Contract.EndContractBlock(); 458Contract.Assert(destType is RuntimeType, "destType is not a runtime type, an EnumBuilder, or a TypeBuilder."); 577Contract.Requires(declMeth != null); 587Contract.Requires(declType != null); 631Contract.EndContractBlock(); 785Contract.EndContractBlock(); 872Contract.EndContractBlock(); 1069Contract.EndContractBlock(); 1080Contract.EndContractBlock(); 1130Contract.EndContractBlock(); 1140Contract.EndContractBlock(); 1150Contract.EndContractBlock(); 1166Contract.EndContractBlock(); 1175Contract.EndContractBlock(); 1184Contract.EndContractBlock(); 1193Contract.EndContractBlock(); 1217Contract.EndContractBlock(); 1226Contract.EndContractBlock(); 1241Contract.EndContractBlock(); 1250Contract.EndContractBlock(); 1259Contract.EndContractBlock(); 1268Contract.EndContractBlock(); 1278Contract.EndContractBlock(); 1287Contract.EndContractBlock(); 1296Contract.EndContractBlock(); 1395Contract.EndContractBlock(); 1407Contract.EndContractBlock(); 1419Contract.EndContractBlock(); 1487Contract.EndContractBlock(); 1512Contract.EndContractBlock(); 1525Contract.EndContractBlock(); 1543Contract.EndContractBlock(); 1579Contract.EndContractBlock(); 1634Contract.EndContractBlock(); 1653Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1660Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1667Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1675Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1684Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1703Contract.Ensures(Contract.Result<MethodBuilder>() != null); 1704Contract.EndContractBlock(); 2094Contract.EndContractBlock(); 2170Contract.EndContractBlock(); 2229Contract.EndContractBlock(); 2522Contract.EndContractBlock(); 2560Contract.EndContractBlock(); 2603Contract.EndContractBlock(); 2614Contract.EndContractBlock();
system\reflection\emit\typebuilderinstantiation.cs (3)
27Contract.Requires(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null"); 34Contract.EndContractBlock(); 98Contract.EndContractBlock();
system\reflection\emit\xxxontypebuilderinstantiation.cs (7)
35Contract.Assert(method is MethodBuilder || method is RuntimeMethodInfo); 65Contract.Assert(m_method is RuntimeMethodInfo); 93Contract.EndContractBlock(); 127Contract.Assert(constructor is ConstructorBuilder || constructor is RuntimeConstructorInfo); 162Contract.Assert(m_ctor is RuntimeConstructorInfo); 236Contract.Assert(field is FieldBuilder || field is RuntimeFieldInfo); 263Contract.Assert(m_field is RuntimeFieldInfo);
system\reflection\eventinfo.cs (9)
130Contract.Assert(addMethod.ReturnType == typeof(void)); 147Contract.Assert(parameters != null && parameters.Length == 1); 153Contract.Assert(parameters[0].ParameterType.BaseType == typeof(MulticastDelegate)); 254Contract.Requires(declaredType != null); 255Contract.Requires(reflectedTypeCache != null); 256Contract.Assert(!reflectedTypeCache.IsGlobal); 313Contract.EndContractBlock(); 328Contract.EndContractBlock(); 385Contract.EndContractBlock();
system\reflection\fieldinfo.cs (5)
336Contract.EndContractBlock(); 351Contract.EndContractBlock(); 377Contract.EndContractBlock(); 749Contract.EndContractBlock(); 774Contract.EndContractBlock();
system\reflection\mdimport.cs (2)
184Contract.EndContractBlock(); 277Contract.Requires(0 <= index && index < Length);
system\reflection\memberinfoserializationholder.cs (2)
37Contract.EndContractBlock(); 71Contract.EndContractBlock();
system\reflection\methodbody.cs (1)
165public virtual Type LocalType { get { Contract.Assert(m_type != null, "type must be set!"); return m_type; } }
system\reflection\methodinfo.cs (10)
255Contract.Ensures(!m_handle.IsNull()); 257Contract.Assert(!handle.IsNullHandle()); 258Contract.Assert(methodAttributes == RuntimeMethodHandle.GetAttributes(handle)); 488Contract.EndContractBlock(); 502Contract.EndContractBlock(); 819Contract.Ensures(m_returnParameter != null); 895Contract.EndContractBlock(); 921Contract.EndContractBlock(); 990Contract.EndContractBlock(); 1033Contract.EndContractBlock();
system\reflection\missing.cs (1)
35Contract.EndContractBlock();
system\reflection\module.cs (6)
446Contract.EndContractBlock(); 464Contract.EndContractBlock(); 479Contract.EndContractBlock(); 1021Contract.EndContractBlock(); 1036Contract.EndContractBlock(); 1060Contract.EndContractBlock();
system\reflection\parameterinfo.cs (18)
101Contract.Ensures(Contract.Result<MemberInfo>() != null); 165Contract.EndContractBlock(); 174Contract.EndContractBlock(); 218Contract.Ensures(Contract.Result<Object>() != null); 271Contract.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 280Contract.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 399Contract.Assert(result != null); 411Contract.EndContractBlock(); 457Contract.Assert(m_originalMember != null); 476Contract.Requires(member != null); 477Contract.Assert(MdToken.IsNullToken(tkParamDef) == scope.Equals(MetadataImport.EmptyImport)); 478Contract.Assert(MdToken.IsNullToken(tkParamDef) || MdToken.IsTokenOfType(tkParamDef, MetadataTokenType.ParamDef)); 520Contract.Assert(parameterType != null); 603Contract.Assert(!m_noMetadata); 741Contract.EndContractBlock(); 759Contract.EndContractBlock();
system\reflection\parametermodifier.cs (1)
27Contract.EndContractBlock();
system\reflection\pointer.cs (1)
48Contract.EndContractBlock();
system\reflection\propertyinfo.cs (9)
215Contract.Requires(declaredType != null); 216Contract.Requires(reflectedTypeCache != null); 217Contract.Assert(!reflectedTypeCache.IsGlobal); 296Contract.Requires(Name.Equals(target.Name)); 297Contract.Requires(this != target); 298Contract.Requires(this.ReflectedType == target.ReflectedType); 382Contract.EndContractBlock(); 397Contract.EndContractBlock(); 684Contract.EndContractBlock();
system\reflection\reflectiontypeloadexception.cs (1)
75Contract.EndContractBlock();
system\reflection\strongnamekeypair.cs (3)
63Contract.EndContractBlock(); 81Contract.EndContractBlock(); 98Contract.EndContractBlock();
system\reflection\typedelegator.cs (1)
37Contract.EndContractBlock();
system\resources\__fastresourcecomparer.cs (5)
86Contract.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 87Contract.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 123Contract.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 124Contract.Assert(a != null && b != null, "Null args not allowed."); 125Contract.Assert(byteLen >= 0, "byteLen must be non-negative.");
system\resources\filebasedresourcegroveler.cs (5)
36Contract.Assert(mediator != null, "mediator shouldn't be null; check caller"); 46Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 114Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 115Contract.Assert(fileName != null, "fileName shouldn't be null; check caller"); 157Contract.Assert(file != null, "file shouldn't be null; check caller");
system\resources\manifestbasedresourcegroveler.cs (16)
56Contract.Requires(mediator != null, "mediator shouldn't be null; check caller"); 64Contract.Assert(culture != null, "culture shouldn't be null; check caller"); 65Contract.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 236Contract.Assert(a != null, "assembly != null"); 269Contract.Assert(false, "mscorlib's NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + cultureName + "\" Exception: " + e); 286Contract.Assert(store != null, "I need a Stream!"); 366Contract.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 432Contract.Requires(satellite != null, "satellite shouldn't be null; check caller"); 433Contract.Requires(fileName != null, "fileName shouldn't be null; check caller"); 457Contract.Requires(satellite != null, "satellite shouldn't be null; check caller"); 458Contract.Requires(name != null, "name shouldn't be null; check caller"); 570Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + " with error code 0x" + hr.ToString("X", CultureInfo.InvariantCulture) + Environment.NewLine + "Exception: " + fle); 577Contract.Assert(false, "[This assert catches satellite assembly build/deployment problems - report this message to your build lab & loc engineer]" + Environment.NewLine + "GetSatelliteAssembly failed for culture " + lookForCulture.Name + " and version " + (_mediator.SatelliteContractVersion == null ? _mediator.MainAssembly.GetVersion().ToString() : _mediator.SatelliteContractVersion.ToString()) + " of assembly " + _mediator.MainAssembly.GetSimpleName() + Environment.NewLine + "Exception: " + bife); 605Contract.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 606Contract.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller"); 675Contract.Assert(false, "Couldn't get mscorlib" + ResourceManager.ResFileExtension + " from mscorlib's assembly" + Environment.NewLine + Environment.NewLine + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug.");
system\resources\neutralresourceslanguageattribute.cs (2)
41Contract.EndContractBlock(); 53Contract.EndContractBlock();
system\resources\resourcemanager.cs (23)
287Contract.Assert(!AppDomain.IsAppXModel() || AppDomain.IsAppXDesignMode()); 314Contract.EndContractBlock(); 320Contract.Assert(!AppDomain.IsAppXModel() || AppDomain.IsAppXDesignMode()); 360Contract.EndContractBlock(); 390Contract.EndContractBlock(); 396Contract.Assert(!AppDomain.IsAppXModel() || AppDomain.IsAppXDesignMode()); 424Contract.EndContractBlock(); 703Contract.EndContractBlock(); 749Contract.Assert(culture != null, "culture != null"); 874Contract.EndContractBlock(); 893Contract.Assert(attrs.Length == 1, "Cannot have multiple instances of SatelliteContractVersionAttribute on an assembly!"); 906Contract.Assert(false, "mscorlib's SatelliteContractVersionAttribute is a malformed version string!"); 935Contract.Assert(asmTypeName1 != null, "asmTypeName1 was unexpectedly null"); 990Contract.Assert(_bUsingModernResourceManagement); 991Contract.Assert(_WinRTResourceManager != null); 992Contract.Assert(_PRIonAppXInitialized); 993Contract.Assert(AppDomain.IsAppXModel()); 1093Contract.Assert(_bUsingModernResourceManagement == false); // Only this function writes to this member 1095Contract.Assert(_WinRTResourceManager == null); // Only this function writes to this member 1096Contract.Assert(_PRIonAppXInitialized == false); // Only this function writes to this member 1097Contract.Assert(_PRIExceptionInfo == null); // Only this function writes to this member 1252Contract.EndContractBlock(); 1369Contract.EndContractBlock();
system\resources\resourcereader.cs (27)
71Contract.Assert(value >= 0, "negative ResourceTypeCode. What?"); 186Contract.EndContractBlock(); 204Contract.Requires(stream != null, "Need a stream!"); 205Contract.Requires(stream.CanRead, "Stream should be readable!"); 206Contract.Requires(resCache != null, "Need a Dictionary!"); 274Contract.Assert(index >=0 && index < _numResources, "Bad index into hash array. index: "+index); 275Contract.Assert((_ums == null && _nameHashes != null && _nameHashesPtr == null) || 286Contract.Assert(index >=0 && index < _numResources, "Bad index into name position array. index: "+index); 287Contract.Assert((_ums == null && _namePositions != null && _namePositionsPtr == null) || 323Contract.Assert(_store != null, "ResourceReader is closed!"); 405Contract.Assert(_store != null, "ResourceReader is closed!"); 443Contract.Assert(_store != null, "ResourceReader is closed!"); 507Contract.Assert(_store != null, "ResourceReader is closed!"); 532Contract.Assert(_store != null, "ResourceReader is closed!"); 585Contract.Assert(_store != null, "ResourceReader is closed!"); 586Contract.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 661Contract.Assert(_store != null, "ResourceReader is closed!"); 662Contract.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 759Contract.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 859Contract.Assert(_store != null, "ResourceReader is closed!"); 1110Contract.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1188Contract.EndContractBlock(); 1222Contract.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 1225Contract.Assert(len >= 0 && len <= (int) _store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!"); 1247Contract.Requires(typeCode >= 0, "can't be negative"); 1249Contract.Assert(!String.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1254Contract.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
system\resources\resourceset.cs (2)
119Contract.EndContractBlock(); 299Contract.EndContractBlock();
system\resources\resourcewriter.cs (14)
108Contract.EndContractBlock(); 120Contract.EndContractBlock(); 133Contract.EndContractBlock(); 149Contract.EndContractBlock(); 174Contract.EndContractBlock(); 189Contract.EndContractBlock(); 223Contract.EndContractBlock(); 240Contract.EndContractBlock(); 466Contract.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 483Contract.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 512Contract.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 600Contract.Requires(writer != null); 719Contract.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, String.Format(CultureInfo.InvariantCulture, "ResourceReader: Unsupported ResourceTypeCode in .resources file! {0}", typeCode)); 730Contract.Requires(store != null);
system\resources\runtimeresourceset.cs (3)
295Contract.EndContractBlock(); 319Contract.Assert(dataPos >= 0, "data section offset cannot be negative!"); 380Contract.Assert(ignoreCase, "This should only happen for case-insensitive lookups");
system\resources\satellitecontractversionattribute.cs (1)
33Contract.EndContractBlock();
system\rttype.cs (98)
119Contract.Requires(index < Count); 244Contract.Assert(retVal || RequiresStringComparison()); 265Contract.Assert(RequiresStringComparison()); 595Contract.Assert(false); 610Contract.Assert(cachedMembers[freeSlotIndex] == null); 628Contract.Assert(declaringType != null); 640Contract.Assert(!filter.Match(RuntimeMethodHandle.GetUtf8Name(methodHandle))); 649Contract.Assert(!methodHandle.IsNullHandle()); 652Contract.Assert( 700Contract.Assert(!filter.Match(RuntimeMethodHandle.GetUtf8Name(methodHandle))); 709Contract.Assert(!methodHandle.IsNullHandle()); 715Contract.Assert( 751Contract.Assert( 768Contract.Assert((methodAttributes & (MethodAttributes.Virtual | MethodAttributes.Abstract)) == 0); 814Contract.Assert(!filter.Match(RuntimeMethodHandle.GetUtf8Name(methodHandle))); 824Contract.Assert(!methodHandle.IsNullHandle()); 830Contract.Assert( 929Contract.Requires(declaringType != null); 930Contract.Requires(ReflectedType != null); 943Contract.Assert(!filter.Match(RuntimeFieldHandle.GetUtf8Name(runtimeFieldHandle))); 951Contract.Assert(!runtimeFieldHandle.IsNullHandle()); 982Contract.Requires(declaringType != null); 983Contract.Requires(ReflectedType != null); 999Contract.Assert(MdToken.IsTokenOfType(tkField, MetadataTokenType.FieldDef)); 1000Contract.Assert(!MdToken.IsNullToken(tkField)); 1107Contract.Assert(interfaceType.IsInterface); 1228Contract.Requires(ReflectedType != null); 1278Contract.Assert(!MdToken.IsNullToken(tkEvent)); 1279Contract.Assert(MdToken.IsTokenOfType(tkEvent, MetadataTokenType.Event)); 1322Contract.Requires(ReflectedType != null); 1328Contract.Assert(declaringType != null); 1383Contract.Assert((declaringType.IsInterface && usedSlots == null && csPropertyInfos == null) || 1391Contract.Assert(!MdToken.IsNullToken(tkProperty)); 1392Contract.Assert(MdToken.IsTokenOfType(tkProperty, MetadataTokenType.Property)); 1398Contract.Assert(!filter.Match(declaringType.GetRuntimeModule().MetadataImport.GetName(tkProperty))); 1443Contract.Assert(associateMethod.IsVirtual); 1549Contract.Assert(listType == MemberListType.All); 1738Contract.Assert(enclosingType != typeof(void)); 1971Contract.EndContractBlock(); 2003Contract.Assert(!methodHandle.IsNullHandle()); 2196Contract.Assume(false, "Unreachable code"); 2212Contract.EndContractBlock(); 2286Contract.Assert(fullname.Equals(ns + "." + name)); 2378Contract.Assert(name != null); 2401Contract.Requires(memberInfo != null); 2402Contract.Requires(name == null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLower(CultureInfo.InvariantCulture).Equals(name))); 2483Contract.Requires((object)type != null); 2484Contract.Assert(type is RuntimeType); 2518Contract.Requires(methodBase != null); 2569Contract.Assert((callConv & CallingConventions.VarArgs) != 0); 2764Contract.Assert(cache != null); 3143Contract.Assert(i == members.Length); 3156Contract.EndContractBlock(); 3166Contract.Assert(ifaceType.IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 3167Contract.Assert(!IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 3188Contract.Assert(ifaceMethodBase is RuntimeMethodInfo); 3201Contract.Assert(rtTypeMethodBase == null || rtTypeMethodBase is RuntimeMethodInfo); 3284Contract.EndContractBlock(); 3324Contract.EndContractBlock(); 3353Contract.EndContractBlock(); 3393Contract.EndContractBlock(); 3429Contract.EndContractBlock(); 3460Contract.EndContractBlock(); 3535Contract.Assert(i == compressMembers.Length); 3656Contract.EndContractBlock(); 3681Contract.EndContractBlock(); 4005Contract.EndContractBlock(); 4063Contract.EndContractBlock(); 4080Contract.EndContractBlock(); 4101Contract.EndContractBlock(); 4110Contract.EndContractBlock(); 4163Contract.EndContractBlock(); 4205Contract.EndContractBlock(); 4270Contract.EndContractBlock(); 4280Contract.EndContractBlock(); 4304Contract.EndContractBlock(); 4324Contract.EndContractBlock(); 4370Contract.Assert(!IsGenericParameter); 4518Contract.EndContractBlock(); 4669Contract.Assert(IsSetField); 4688Contract.Assert(flds != null); 4811Contract.Assert(!IsSetField); 4818Contract.Assert(isSetProperty); 4820Contract.Assert(!IsGetField); 4842Contract.Assert(semiFinalist != null); 4865Contract.Assert(results.Count > 1); 4873Contract.Assert(finalists == null || finalist != null); 4919Contract.Assert(results.Count > 1); 5020Contract.EndContractBlock(); 5038Contract.EndContractBlock(); 5053Contract.EndContractBlock(); 5167Contract.EndContractBlock(); 5314Contract.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) == 5405Contract.Assert(!ace.m_hCtorMethodHandle.IsNullHandle(), "Expected the default ctor method handle for a reference type."); 5525Contract.Assert(ace.m_ctor != null || this.IsValueType); 5722Contract.Assert(false, "[RuntimeType.WrapArgsForInvokeCall]Invalid safe array wrapper type specified."); 5779Contract.Assert(false, "[RuntimeType.WrapArgsForInvokeCall]Invalid wrapper type specified."); 6017Contract.Assert(!hit.Equals(key), "Key was already in CerHashtable! Potential ---- (or bug) in the Reflection cache?");
system\runtime\compilerservices\AsyncMethodBuilder.cs (27)
73Contract.EndContractBlock(); 117Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 127Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 163Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 173Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 204Contract.EndContractBlock(); 234Contract.Assert(m_synchronizationContext != null, "Must only be used with a non-null context."); 305Contract.EndContractBlock(); 460Contract.EndContractBlock(); 504Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 515Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 544Contract.Assert(continuation != null, "GetCompletionAction should always return a valid action."); 555Contract.Assert(!Object.ReferenceEquals((object)stateMachine, (object)stateMachine), "Expected an unboxed state machine reference"); 594Contract.Assert(m_task != null, "GetTaskForResult should never return null"); 623Contract.Requires(completedTask != null, "Expected non-null task"); 624Contract.Requires(completedTask.Status == TaskStatus.RanToCompletion, "Expected a successfully completed task"); 650Contract.EndContractBlock(); 715Contract.Ensures( 716EqualityComparer<TResult>.Default.Equals(result, Contract.Result<Task<TResult>>().Result), 818Contract.Assert(EXCLUSIVE_INT32_MAX >= INCLUSIVE_INT32_MIN, "Expected max to be at least min"); 887Contract.EndContractBlock(); 904Contract.Assert(m_defaultContextAction == null || m_stateMachine != null, 927Contract.Assert(m_stateMachine != null, "If the delegate was set, the state machine should have been as well."); 995Contract.Assert(runner.m_stateMachine == null, "The runner's state machine should not yet have been populated."); 996Contract.Assert(m_stateMachine != null, "The builder's state machine field should have been initialized."); 1059Contract.Assert(m_stateMachine != null, "The state machine must have been set before calling Run."); 1109Contract.Requires(continuation != null, "Expected non-null continuation");
system\runtime\compilerservices\datetimeconstantattribute.cs (2)
31Contract.Requires(attr.Constructor.DeclaringType == typeof(DateTimeConstantAttribute)); 32Contract.Requires(attr.ConstructorArguments.Count == 1);
system\runtime\compilerservices\decimalconstantattribute.cs (4)
54Contract.Requires(attr.Constructor.DeclaringType == typeof(DecimalConstantAttribute)); 61Contract.Assert(false, "Decimal cannot be represented directly in the metadata."); 67Contract.Assert(parameters.Length == 5); 70Contract.Assert(args.Count == 5);
system\runtime\compilerservices\RuntimeWrappedException.cs (1)
43Contract.EndContractBlock();
system\runtime\compilerservices\TaskAwaiter.cs (13)
73Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 149Contract.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 162Contract.Requires(task.IsCompleted, "Task must have been completed by now."); 163Contract.Requires(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 177Contract.Assert(false, "Throw() should have thrown"); 188Contract.Assert(false, "Throw() should have thrown"); 193Contract.Assert(false, "There should be exceptions if we're Faulted."); 233Contract.Requires(task != null, "Need a task to wait on"); 234Contract.Requires(continuation != null, "Need a continuation to invoke when the wait completes"); 310Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 370Contract.Requires(task != null, "Constructing an awaitable requires a task to await."); 399Contract.Requires(task != null, "Constructing an awaiter requires a task to await."); 487Contract.Requires(task != null, "Constructing an awaiter requires a task to await.");
system\runtime\compilerservices\typedependencyattribute.cs (1)
22Contract.EndContractBlock();
system\runtime\compilerservices\YieldAwaitable.cs (1)
88Contract.EndContractBlock();
system\runtime\designerservices\windowsruntimedesignercontext.cs (5)
145Contract.Ensures(Contract.Result<Assembly>() != null); 146Contract.Ensures(!Contract.Result<Assembly>().ReflectionOnly); 158Contract.EndContractBlock();
system\runtime\gcsettings.cs (2)
61Contract.EndContractBlock(); 88Contract.EndContractBlock();
system\runtime\interopservices\attributes.cs (3)
582Contract.Assert(marshalTypeName != null); 886default: Contract.Assume(false); break; 895default: Contract.Assume(false); break;
system\runtime\interopservices\gchandle.cs (2)
67Contract.EndContractBlock(); 201Contract.EndContractBlock();
system\runtime\interopservices\marshal.cs (29)
203Contract.EndContractBlock(); 223Contract.EndContractBlock(); 283Contract.EndContractBlock(); 862Contract.EndContractBlock(); 882Contract.EndContractBlock(); 902Contract.EndContractBlock(); 1037Contract.EndContractBlock(); 1161Contract.EndContractBlock(); 1329Contract.EndContractBlock(); 1350Contract.EndContractBlock(); 1459Contract.EndContractBlock(); 1488Contract.EndContractBlock(); 1515Contract.EndContractBlock(); 1536Contract.EndContractBlock(); 1989Contract.EndContractBlock(); 2023Contract.EndContractBlock(); 2060Contract.EndContractBlock(); 2097Contract.EndContractBlock(); 2307Contract.EndContractBlock(); 2350Contract.EndContractBlock(); 2362Contract.Assert(caConstructorArgs.Count == 1, "caConstructorArgs.Count == 1"); 2365Contract.Assert(progIdConstructorArg.ArgumentType == typeof(String), "progIdConstructorArg.ArgumentType == typeof(String)"); 2612Contract.EndContractBlock(); 2642Contract.EndContractBlock(); 2663Contract.EndContractBlock(); 2674Contract.EndContractBlock(); 2686Contract.EndContractBlock(); 2719Contract.EndContractBlock(); 2729Contract.EndContractBlock();
system\runtime\interopservices\registrationservices.cs (6)
107Contract.EndContractBlock(); 170Contract.EndContractBlock(); 227Contract.EndContractBlock(); 265Contract.EndContractBlock(); 303Contract.Assert(baseComImportType != null, "baseComImportType != null"); 321Contract.EndContractBlock();
system\runtime\interopservices\safebuffer.cs (5)
108Contract.EndContractBlock(); 130Contract.EndContractBlock(); 256Contract.EndContractBlock(); 328Contract.EndContractBlock(); 390Contract.Assert(false, "Uninitialized SafeBuffer! Someone needs to call Initialize before using this instance!");
system\runtime\interopservices\tceadaptergen\eventproviderwriter.cs (33)
100Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper"); 104Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 108Contract.Assert(SinkHelperCons != null, "Unable to find the constructor for the sink helper"); 112Contract.Assert(CPAdviseMethod != null, "Unable to find the method ConnectionPoint.Advise"); 118Contract.Assert(ArrayListAddMethod != null, "Unable to find the method ArrayList.Add"); 122Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 127Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 243Contract.Assert(DelegateField != null, "Unable to find the field m_" + SrcItfMethod.Name + "Delegate on the sink helper"); 247Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 253Contract.Assert(ArrayListRemoveMethod != null, "Unable to find the method ArrayList.RemoveAt()"); 257Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item"); 259Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item"); 263Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count"); 265Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count"); 270Contract.Assert(DelegateEqualsMethod != null, "Unable to find the method Delegate.Equlals()"); 274Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 279Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 283Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()"); 287Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()"); 467Contract.Assert(DefaultArrayListCons != null, "Unable to find the constructor for class ArrayList"); 476Contract.Assert(ByteArrayGUIDCons != null, "Unable to find the constructor for GUID that accepts a string as argument"); 480Contract.Assert(CPCFindCPMethod != null, "Unable to find the method ConnectionPointContainer.FindConnectionPoint()"); 557Contract.Assert(DefaultBaseClsCons != null, "Unable to find the object's public default constructor"); 588Contract.Assert(CookieField != null, "Unable to find the field m_dwCookie on the sink helper"); 592Contract.Assert(ArrayListItemProperty != null, "Unable to find the property ArrayList.Item"); 594Contract.Assert(ArrayListItemGetMethod != null, "Unable to find the get method for property ArrayList.Item"); 598Contract.Assert(ArrayListSizeProperty != null, "Unable to find the property ArrayList.Count"); 600Contract.Assert(ArrayListSizeGetMethod != null, "Unable to find the get method for property ArrayList.Count"); 604Contract.Assert(CPUnadviseMethod != null, "Unable to find the method ConnectionPoint.Unadvise()"); 608Contract.Assert(ReleaseComObjectMethod != null, "Unable to find the method Marshal.ReleaseComObject()"); 612Contract.Assert(MonitorEnterMethod != null, "Unable to find the method Monitor.Enter()"); 618Contract.Assert(MonitorExitMethod != null, "Unable to find the method Monitor.Exit()"); 747Contract.Assert(SuppressFinalizeMethod != null, "Unable to find the GC.SuppressFinalize");
system\runtime\interopservices\tceadaptergen\eventsinkhelperwriter.cs (4)
69Contract.Assert(aParams.Length == 1, "All event interface methods must take a single delegate derived type and have a void return type"); 123Contract.Assert(DelegateInvokeMethod != null, "Unable to find method Delegate.Invoke()"); 233Contract.Assert(false, "Unexpected type for Primitive type."); 258Contract.Assert(DefaultBaseClsCons != null, "Unable to find the constructor for class " + m_InputType.Name);
system\runtime\interopservices\typelibconverter.cs (6)
108Contract.EndContractBlock(); 311Contract.Assert((asmFileName != null) && (asmFileName.Length > 0), "The assembly file name cannot be an empty string!"); 515Contract.Ensures(Contract.Result<Assembly>() != null && Contract.Result<Assembly>() is RuntimeAssembly); 516Contract.EndContractBlock();
system\runtime\interopservices\windowsruntime\bindablevectortocollectionadapter.cs (1)
33Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\bindablevectortolistadapter.cs (1)
33Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\clrikeyvaluepairimpl.cs (2)
42Contract.Requires(pair != null); 51Contract.Requires(wrapper != null);
system\runtime\interopservices\windowsruntime\clripropertyvalueimpl.cs (20)
136Contract.EndContractBlock(); 145Contract.EndContractBlock(); 160Contract.EndContractBlock(); 177Contract.EndContractBlock(); 186Contract.EndContractBlock(); 196Contract.EndContractBlock(); 207Contract.EndContractBlock(); 218Contract.EndContractBlock(); 282Contract.EndContractBlock(); 291Contract.EndContractBlock(); 306Contract.EndContractBlock(); 321Contract.EndContractBlock(); 330Contract.EndContractBlock(); 340Contract.EndContractBlock(); 351Contract.EndContractBlock(); 363Contract.EndContractBlock(); 514Contract.Requires(expectedBoxedType != null); 515Contract.Requires(Marshal.SizeOf(expectedBoxedType) == Marshal.SizeOf(typeof(T))); 535Contract.Requires(expectedArrayElementType != null); 536Contract.Requires(Marshal.SizeOf(expectedArrayElementType) == Marshal.SizeOf(typeof(T)));
system\runtime\interopservices\windowsruntime\clrireferenceimpl.cs (13)
86Contract.Requires(wrapper != null); 88Contract.Assert(reference != null, "CLRIReferenceImpl::UnboxHelper - QI'ed for IReference<"+typeof(T)+">, but that failed."); 275Contract.Requires(wrapper != null); 277Contract.Assert(reference != null, "CLRIReferenceArrayImpl::UnboxHelper - QI'ed for IReferenceArray<" + typeof(T) + ">, but that failed."); 293Contract.Requires(obj != null, "Null should not be boxed."); 294Contract.Ensures(Contract.Result<Object>() != null); 363Contract.Assert(false, "We should not see non-WinRT type here"); 370Contract.Requires(obj != null); 371Contract.Requires(obj.GetType().IsArray); 372Contract.Ensures(Contract.Result<Object>() != null); 376Contract.Assert(obj.Rank == 1 && obj.GetLowerBound(0) == 0 && !type.IsArray);
system\runtime\interopservices\windowsruntime\constantsplittablemap.cs (6)
54Contract.EndContractBlock(); 243Contract.Requires(items != null); 244Contract.Requires(first >= 0); 245Contract.Requires(end >= 0); 246Contract.Requires(first < items.Length); 247Contract.Requires(end < items.Length);
system\runtime\interopservices\windowsruntime\custompropertyimpl.cs (1)
128Contract.Assert(AppDomain.CurrentDomain.PermissionSet.IsUnrestricted());
system\runtime\interopservices\windowsruntime\dictionarytomapadapter.cs (2)
34Contract.Assert(false, "This class is never instantiated"); 76Contract.Assert(_this != null);
system\runtime\interopservices\windowsruntime\enumeratortoiteratoradapter.cs (3)
32Contract.Assert(false, "This class is never instantiated"); 48Contract.Assert(false, "This class is never instantiated"); 83Contract.Requires(enumerator != null);
system\runtime\interopservices\windowsruntime\eventregistrationtokentable.cs (2)
80Contract.Requires(handler != null); 134Contract.Requires(handler != null);
system\runtime\interopservices\windowsruntime\IClosable.cs (2)
31Contract.Assert(false, "This class is never instantiated"); 48Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\icustompropertyprovider.cs (6)
53Contract.Requires(target != null); 54Contract.Requires(propertyName != null); 74Contract.Requires(target != null); 75Contract.Requires(propertyName != null); 85Contract.Requires(target != null); 86Contract.Requires(propertyName != null);
system\runtime\interopservices\windowsruntime\imapviewtoireadonlydictionaryadapter.cs (3)
34Contract.Assert(false, "This class is never instantiated"); 43Contract.EndContractBlock(); 116Contract.Requires(null != key);
system\runtime\interopservices\windowsruntime\ireadonlydictionarytoimapviewadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\ireadonlylisttoivectorviewadapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\iteratortoenumeratoradapter.cs (3)
34Contract.Assert(false, "This class is never instantiated"); 76Contract.Assert(false, "This class is never instantiated"); 118Contract.Requires(iterator != null);
system\runtime\interopservices\windowsruntime\ivectorviewtoireadonlylistadapter.cs (1)
36Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\listtobindablevectoradapter.cs (1)
34Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\listtobindablevectorviewadapter.cs (1)
33Contract.EndContractBlock();
system\runtime\interopservices\windowsruntime\listtovectoradapter.cs (2)
34Contract.Assert(false, "This class is never instantiated"); 67Contract.Assert(_this != null);
system\runtime\interopservices\windowsruntime\maptocollectionadapter.cs (2)
35Contract.Assert(false, "This class is never instantiated"); 156Contract.EndContractBlock();
system\runtime\interopservices\windowsruntime\maptodictionaryadapter.cs (6)
32Contract.Assert(false, "This class is never instantiated"); 42Contract.EndContractBlock(); 55Contract.EndContractBlock(); 101Contract.EndContractBlock(); 163Contract.Requires(null != key); 180Contract.Requires(null != key);
system\runtime\interopservices\windowsruntime\mapviewtoreadonlycollectionadapter.cs (1)
35Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\vectortocollectionadapter.cs (2)
32Contract.Assert(false, "This class is never instantiated"); 99Contract.EndContractBlock();
system\runtime\interopservices\windowsruntime\vectortolistadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\vectorviewtoreadonlycollectionadapter.cs (1)
32Contract.Assert(false, "This class is never instantiated");
system\runtime\interopservices\windowsruntime\windowsruntimemarshal.cs (28)
39Contract.EndContractBlock(); 66Contract.EndContractBlock(); 91Contract.EndContractBlock(); 232Contract.Requires(addMethod != null); 233Contract.Requires(removeMethod != null); 263Contract.Requires(instance != null); 264Contract.Requires(removeMethod != null); 265Contract.Requires(s_eventRegistrations != null); 290Contract.Requires(removeMethod != null); 332Contract.Requires(removeMethod != null); 498Contract.Requires(s_eventRegistrations != null); 549Contract.Assert(target == null || Marshal.IsComObject(target), "Must be null or a RCW"); 640Contract.Requires(instance != null); 641Contract.Requires(removeMethod != null); 648Contract.Requires(instance != null); 649Contract.Requires(removeMethod != null); 657Contract.Requires(instance != null); 658Contract.Requires(removeMethod != null); 659Contract.Requires(s_eventRegistrations != null); 728Contract.Assert((key != null && tokens != null) || (key == null && tokens == null), 915Contract.Assert(owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 923Contract.Assert(owners == -1, "Calling ReleaseWriterLock when no write lock is held"); 935Contract.Assert(myLock != 0, "Lock must be held"); 936Contract.Assert(waitEvent == null, "Wait event must be null"); 955Contract.Assert(myLock != 0, "Lock must be held"); 983Contract.Assert(myLock != 0, "Lock must be held"); 1019Contract.Assert(myLock != 0, "Exiting spin lock that is not held"); 1054Contract.Requires(Environment.IsWinRTSupported);
system\runtime\interopservices\windowsruntime\windowsruntimemetadata.cs (1)
36Contract.EndContractBlock();
system\runtime\memoryfailpoint.cs (2)
165Contract.EndContractBlock(); 295Contract.Assert(false, "Fell through switch statement!");
system\runtime\remoting\activationservices.cs (32)
160Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface"); 172Contract.Assert(null != pa, "null != pa"); 197Contract.Assert(null != retObj, "null != retObj"); 205Contract.Assert(!serverType.IsInterface,"!serverType.IsInterface"); 218Contract.Assert(null != pa, "null != pa"); 229Contract.Assert(null != retObj, "null != retObj"); 398Contract.Assert( 425Contract.Assert(pa!=null, "expect proxy attribute"); 539Contract.Assert( 544Contract.Assert(ctorMsg.ActivationType.IsContextful, 558Contract.Assert( 564Contract.Assert( 617Contract.Assert( 759Contract.Assert(reqMsg!=null, "NULL ctorReqMsg"); 771Contract.Assert(replyMsg!=null, "NULL ctorRetMsg"); 840Contract.Assert( 1103Contract.Assert(_attributeStack != null, "Pop w/o a prior Set()?"); 1214Contract.Assert(ctorMsg!=null, "ctorMsg null?"); 1224Contract.Assert( 1249Contract.Assert( 1317Contract.EndContractBlock(); 1393Contract.Assert(ctorMsg != null, "Null ctorMsg"); 1472Contract.EndContractBlock(); 1522Contract.Assert(remActivatorURL!=null,"Bad activator URL"); 1531Contract.EndContractBlock(); 1585Contract.EndContractBlock(); 1681Contract.Assert(cp != null && cp.Count > 0,"Bad _cp?"); 1740Contract.Assert(typ!=null, "typ != null"); 1741Contract.Assert(attr!=null, "attr != null"); 1748Contract.Assert(newAttr.Length == newTypes.Length,"These should be in sync!"); 1761Contract.Assert(typ!=null, "typ != null"); 1774Contract.Assert(typ!=null, "typ != null");
system\runtime\remoting\channelservices.cs (7)
124Contract.EndContractBlock(); 252Contract.Assert((oldList != null) && (oldList.Length != 0), "channel list should not be empty"); 459Contract.Assert(null != idObj,"null != idObj"); 1311Contract.Assert(nextSink != null, 1320Contract.Assert(RemotingServices.CORProfilerTrackRemoting(), 1322Contract.Assert(RemotingServices.CORProfilerTrackRemotingAsync(), 1343Contract.Assert(false, "ServerAsyncReplyTerminatorSink.AsyncProcessMessage called!");
system\runtime\remoting\configuration.cs (8)
1292Contract.EndContractBlock(); 1498Contract.Assert(null != URI, "null != URI"); 1517Contract.Assert(null != URI, "null != URI"); 1602Contract.Assert(null != srvID, "null != srvID"); 1620Contract.Assert(null != srvID, "null != srvID"); 1642Contract.Assert(null != srvID, "null != srvID"); 1685Contract.Assert(null != srvID, "null != srvID"); 1771Contract.Assert(_channel != null, "channel shouldn't be null");
system\runtime\remoting\context.cs (8)
247Contract.EndContractBlock(); 300Contract.Assert( 526Contract.Assert( (msg is IConstructionCallMessage) 529Contract.Assert( !((msg is IConstructionCallMessage) && 533Contract.Assert((_ctxFlags & CTX_FROZEN) == CTX_FROZEN, 635Contract.EndContractBlock(); 669Contract.Assert(targetCtxID != IntPtr.Zero, "Bad transition context"); 909Contract.EndContractBlock();
system\runtime\remoting\contextproperty.cs (3)
208Contract.EndContractBlock(); 210Contract.Assert(ctorMsg.ActivationType.IsMarshalByRef, "Activation on a non MarshalByRef object"); 235Contract.EndContractBlock();
system\runtime\remoting\dispatchchannelsink.cs (1)
66Contract.EndContractBlock();
system\runtime\remoting\identityholder.cs (17)
112Contract.Assert( 167Contract.EndContractBlock(); 232Contract.Assert( 288Contract.Assert(null != serverCtx, "null != serverCtx"); 296Contract.Assert(srvID == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" ); 302Contract.Assert(null != rp, "null != rp"); 389Contract.Assert(null != srvID,"null != srvID"); 404Contract.Assert(null != objURI,"null != objURI"); 473Contract.Assert(null != idObj,"null != idObj"); 491Contract.Assert(null != idObj,"null != idObj"); 494Contract.Assert( 506Contract.Assert(bServerIDSet,"idObj should be ServerIdentity"); 525Contract.Assert(null != idObj.URI,"null != idObj.URI"); 553Contract.Assert( 569Contract.Assert( 603Contract.Assert(false, "Invalid DuplicateIdentityOption"); 721Contract.Assert(uri!=null, "Null URI");
system\runtime\remoting\message.cs (25)
303Contract.EndContractBlock(); 496Contract.Assert(mb != null, "null method base passed to CoerceArgs"); 516Contract.EndContractBlock(); 1345Contract.Assert(_message == null, "Can't set frame twice on ConstructorCallMessage"); 2222Contract.Assert(_enumHash != null,"_enumHash != null"); 2249Contract.Assert(_enumHash != null,"_enumHash != null"); 2870Contract.EndContractBlock(); 2893Contract.EndContractBlock(); 2972Contract.EndContractBlock(); 3239Contract.Assert( 3973Contract.Assert(value==null, "Phoney type in CCM"); 4127Contract.EndContractBlock(); 4230Contract.EndContractBlock(); 4308Contract.EndContractBlock(); 4855Contract.Assert(_obj != null, "SerializationMonkey's _obj field should have been initialized elsewhere with a special hack."); 4962Contract.Assert(targetCtxID!=IntPtr.Zero, "bad target ctx for call back"); 4985Contract.Assert(targetCtxID != IntPtr.Zero, "bad target ctx for call back"); 4986Contract.Assert(targetDomainID !=0, "bad target ctx for call back"); 5015Contract.Assert(channelSink != null, "X-domain transition failure"); 5026Contract.EndContractBlock(); 5035Contract.Assert(_targetDomainID != 0, "target domain should be non-zero"); 5068Contract.Assert(Thread.CurrentContext.InternalContextID 5087Contract.Assert(ctx != null, "Null target context unexpected!"); 5153Contract.Assert( 5213Contract.EndContractBlock();
system\runtime\remoting\realproxy.cs (9)
120Contract.EndContractBlock(); 124Contract.Assert((IntPtr)0 != _defaultStub, "Default stub not set up"); 610Contract.Assert( 755Contract.Assert(rp!=null, "RemotingProxy expected here!"); 787Contract.Assert(false, "Unknown call type"); 802Contract.Assert(null != retMsg, "null != retMsg"); 806Contract.Assert(null != reqMsg, "null != reqMsg"); 918Contract.Assert(msgFlags != -1, "Unexpected msgFlags?"); 984Contract.Assert(null != serverID.ServerContext, "null != serverID.ServerContext");
system\runtime\remoting\remotingconfiguration.cs (9)
355Contract.EndContractBlock(); 368Contract.EndContractBlock(); 418Contract.EndContractBlock(); 427Contract.EndContractBlock(); 478Contract.EndContractBlock(); 491Contract.EndContractBlock(); 548Contract.EndContractBlock(); 562Contract.EndContractBlock(); 607Contract.Assert(appURI != null, "Bad remote app URI");
system\runtime\remoting\remotingservices.cs (26)
424Contract.Assert(!(obj is ContextBoundObject), "ContextBoundObject's shouldn't get here."); 432Contract.Assert(null != serverCtx, "null != serverCtx"); 438Contract.Assert(idObj == MarshalByRefObject.GetIdentity(obj), "Bad ID state!" ); 452Contract.Assert(obj is ContextBoundObject, "Object should have been a ContextBoundObject."); 529Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI"); 534Contract.Assert(null != idObj,"null != idObj"); 545Contract.Assert(null != realProxy,"null != realProxy"); 688Contract.Assert(null != realProxy,"null != realProxy"); 707Contract.Assert(null != idObj, "null != idObj"); 719Contract.Assert(srvID != null && Obj is ContextBoundObject, 749Contract.Assert(srvID == idObj, "Bad ID Table state!"); 756Contract.Assert(idObj.ObjURI != null, "Client side id without URI!"); 774Contract.Assert(null != idObj.ObjURI,"null != idObj.ObjURI"); 821Contract.EndContractBlock(); 872Contract.EndContractBlock(); 975Contract.EndContractBlock(); 1066Contract.Assert(obj.GetType().IsContextful,"objType.IsContextful"); 2218Contract.Assert(IsTransparentProxy(tp),"Must be called only for TPs"); 2298Contract.Assert( 2348Contract.Assert(IsTransparentProxy(tp), "IsTransparentProxy(tp)"); 2354Contract.Assert(!(id is ServerIdentity), "(!id is ServerIdentity)"); 2471Contract.EndContractBlock(); 2511Contract.EndContractBlock(); 2605Contract.EndContractBlock(); 2642Contract.EndContractBlock(); 2780Contract.Assert(condition, message);
system\runtime\remoting\remotingsurrogateselector.cs (7)
63Contract.EndContractBlock(); 90Contract.EndContractBlock(); 146Contract.EndContractBlock(); 189Contract.EndContractBlock(); 272Contract.EndContractBlock(); 380Contract.Assert( 450Contract.EndContractBlock();
system\runtime\remoting\soap.cs (2)
173Contract.EndContractBlock(); 231Contract.EndContractBlock();
system\runtime\remoting\synchronizeddispatch.cs (24)
88Contract.Assert( 97Contract.Assert( 101Contract.Assert( 187Contract.EndContractBlock(); 197Contract.Assert(ctx.GetProperty(PROPERTY_NAME) != this, 231Contract.Assert(_flavor == REQUIRED,"Use cli-ctx property only for the REQUIRED flavor"); 284Contract.Assert(_locked==true,"_locked==true"); 292Contract.Assert(work!=null,"work!=null"); 293Contract.Assert(work.IsSignaled() && !(work.IsDummy()),"work.IsSignaled() && !(work.IsDummy())"); 308Contract.Assert(_locked==true,"_locked==true"); 335Contract.Assert(_locked==true,"_locked==true"); 452Contract.Assert(_locked==true,"_locked==true"); 482Contract.Assert(_locked==true,"_locked==true"); 498Contract.Assert(_locked==true,"_locked==true"); 720Contract.Assert(!IsWaiting(),"!IsWaiting()"); 732Contract.Assert(!IsSignaled(),"!IsSignaled()"); 795Contract.Assert(IsSignaled(),"IsSignaled()"); 836Contract.Assert(_property.Locked == true,"_property.Locked == true"); 853Contract.Assert(_property.Locked == true,"_property.Locked == true"); 878Contract.Assert( 890Contract.Assert(lcid.Equals(_property.SyncCallOutLCID), "Bad synchronization domain state!"); 910Contract.Assert( 930Contract.Assert(_property.Locked == true,"_property.Locked == true"); 953Contract.Assert(
system\runtime\remoting\trackingservices.cs (2)
72Contract.EndContractBlock(); 107Contract.EndContractBlock();
system\runtime\serialization\formatterconverter.cs (17)
32Contract.EndContractBlock(); 40Contract.EndContractBlock(); 48Contract.EndContractBlock(); 56Contract.EndContractBlock(); 65Contract.EndContractBlock(); 73Contract.EndContractBlock(); 81Contract.EndContractBlock(); 90Contract.EndContractBlock(); 98Contract.EndContractBlock(); 107Contract.EndContractBlock(); 115Contract.EndContractBlock(); 124Contract.EndContractBlock(); 132Contract.EndContractBlock(); 140Contract.EndContractBlock(); 148Contract.EndContractBlock(); 156Contract.EndContractBlock(); 164Contract.EndContractBlock();
system\runtime\serialization\formatters\binary\binarycommonclasses.cs (4)
86Contract.Assert(objectInfo!=null, "[BinaryConverter.GetBinaryTypeInfo]objectInfo null for user object"); 154Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 163Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null"); 167Contract.Assert(typeInformation!=null, "[BinaryConverter.WriteTypeInfo]typeInformation!=null");
system\runtime\serialization\formatters\binary\binaryconverter.cs (1)
480Contract.Assert((code != InternalPrimitiveTypeE.Invalid), "[Converter.FromString]!InternalPrimitiveTypeE.Invalid ");
system\runtime\serialization\formatters\binary\binaryformatter.cs (2)
185Contract.EndContractBlock(); 225Contract.EndContractBlock();
system\runtime\serialization\formatters\binary\binaryobjectreader.cs (4)
116Contract.EndContractBlock(); 147Contract.EndContractBlock(); 169Contract.Assert(!bFullDeserialization, "we just set bFullDeserialization to false"); 357Contract.Assert((index < crossAppDomainArray.Length),
system\runtime\serialization\formatters\binary\binaryobjectwriter.cs (1)
85Contract.EndContractBlock();
system\runtime\serialization\formatters\binary\binaryparser.cs (1)
1022Contract.Assert((pr.PRnewObj != null),"[BinaryParser expected a Primitive Array]");
system\runtime\serialization\formatters\sertrace.cs (2)
101Contract.Assert(condition, message); 115Contract.EndContractBlock();
system\runtime\serialization\formatterservices.cs (10)
89Contract.Assert((object)type != null, "[GetAllSerializableMembers]type!=null"); 190Contract.EndContractBlock(); 236Contract.EndContractBlock(); 250Contract.EndContractBlock(); 301Contract.Requires(fi != null); 342Contract.EndContractBlock(); 390Contract.EndContractBlock(); 405Contract.Assert(mi is RuntimeFieldInfo || mi is SerializationFieldInfo, 429Contract.EndContractBlock(); 443Contract.EndContractBlock();
system\runtime\serialization\objectidgenerator.cs (2)
97Contract.EndContractBlock(); 134Contract.EndContractBlock();
system\runtime\serialization\objectmanager.cs (44)
126Contract.Assert(objectID>0,"objectID>0"); 170Contract.Assert(holder!=null,"holder!=null"); 172Contract.Assert(holder.m_id>=0,"holder.m_id>=0"); 254Contract.Assert(holder.RequiresSerInfoFixup,"[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 257Contract.Assert(surrogate!=null,"surrogate!=null"); 269Contract.Assert(holder.ObjectValue is ISerializable,"holder.m_object is ISerializable"); 296Contract.Assert(holder.IsIncompleteObjectReference,"holder.IsIncompleteObjectReference"); 362Contract.Assert(holder!=null, "[TypedReferenceBuilder.ctor]holder!=null"); 363Contract.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 404Contract.Assert(currFixup.ParentIndex!=null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 419Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 445Contract.Assert(fixupObj!=null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 500Contract.Assert(holder!=null,"[ObjectManager.CompleteObject]holder.m_object!=null"); 524Contract.Assert(fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup,"fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 578Contract.Assert(holder.ObjectValue is Array,"holder.ObjectValue is Array"); 586Contract.Assert(fixupInfo is MemberInfo,"fixupInfo is MemberInfo"); 672Contract.Assert(temp.DirectlyDependentObjects>0,"temp.m_missingElementsRemaining>0"); 693Contract.EndContractBlock(); 731Contract.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 732Contract.Assert((FindObjectHolder(objectID) == null), "RegisterString - FindObjectHolder(objectID) == null"); 747Contract.EndContractBlock(); 865Contract.EndContractBlock(); 948Contract.Assert(m_fixupCount>=0,"[ObjectManager.DoFixups]m_fixupCount>=0"); 1021Contract.EndContractBlock(); 1053Contract.EndContractBlock(); 1088Contract.EndContractBlock(); 1173Contract.Assert(objID>=0,"objID>=0"); 1207Contract.Assert(objID>=0,"objID>=0"); 1253Contract.Assert(m_dependentObjects!=null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1254Contract.Assert(id>=0, "[ObjectHolder.RemoveDependency]id>=0"); 1296Contract.Assert(holder!=null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1334Contract.Assert(obj!=null,"obj!=null"); 1335Contract.Assert(m_id>0,"m_id>0"); 1576Contract.Assert(id>0,"id>0"); 1577Contract.Assert(fixupInfo!=null,"fixupInfo!=null"); 1578Contract.Assert(fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup,"fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1685Contract.Assert(m_currentItem!=-1, "[LongList.Current]m_currentItem!=-1"); 1686Contract.Assert(m_values[m_currentItem]!=-1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1731Contract.Assert(startingSize>0 && startingSize<0x1000,"startingSize>0 && startingSize<0x1000"); 1784Contract.Assert(list!=null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1792Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1811Contract.Assert(m_currPos!=-1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1812Contract.Assert(m_currPos<m_list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1813Contract.Assert(m_startingVersion==m_list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
system\runtime\serialization\safeserializationmanager.cs (5)
325Contract.Requires(serializedObject != null); 326Contract.Requires(info != null); 327Contract.Requires(typeof(ISerializable).IsAssignableFrom(serializedObject.GetType())); 328Contract.Requires(serializedObject.GetType().IsAssignableFrom(info.ObjectType)); 356Contract.Requires(deserializedObject != null);
system\runtime\serialization\serializationattributes.cs (1)
36Contract.EndContractBlock();
system\runtime\serialization\serializationeventscache.cs (3)
96Contract.Assert(obj != null, "object should have been initialized"); 115Contract.Assert(obj != null, "object should have been initialized"); 134Contract.Assert(obj != null, "object should have been initialized");
system\runtime\serialization\serializationfieldinfo.cs (2)
43Contract.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null"); 44Contract.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null");
system\runtime\serialization\serializationinfo.cs (21)
77Contract.EndContractBlock(); 108Contract.EndContractBlock(); 130Contract.EndContractBlock(); 150Contract.EndContractBlock(); 255Contract.Assert(m_members.Length == m_currMember, "[SerializationInfo.ExpandArrays]m_members.Length == m_currMember"); 300Contract.EndContractBlock(); 432Contract.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 433Contract.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 434Contract.Assert(null != (object)type, "[SerializationInfo.UpdateValue]type!=null"); 455Contract.EndContractBlock(); 483Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length"); 484Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length"); 487Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null"); 502Contract.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length"); 503Contract.Assert(index < m_types.Length, "[SerializationInfo.GetElement]index<m_types.Length"); 506Contract.Assert((object)foundType != null, "[SerializationInfo.GetElement]foundType!=null"); 523Contract.EndContractBlock(); 547Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null"); 560Contract.Assert((object)type != null, "[SerializationInfo.GetValue]type ==null"); 561Contract.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 580Contract.Assert(m_converter != null, "[SerializationInfo.GetValue]m_converter!=null");
system\runtime\serialization\serializationinfoenumerator.cs (7)
71Contract.Assert(members!=null, "[SerializationInfoEnumerator.ctor]members!=null"); 72Contract.Assert(info!=null, "[SerializationInfoEnumerator.ctor]info!=null"); 73Contract.Assert(types!=null, "[SerializationInfoEnumerator.ctor]types!=null"); 74Contract.Assert(numItems>=0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 75Contract.Assert(members.Length>=numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 76Contract.Assert(info.Length>=numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 77Contract.Assert(types.Length>=numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
system\runtime\serialization\surrogateselector.cs (5)
41Contract.EndContractBlock(); 52Contract.Assert(selector!=null, "[HasCycle]selector!=null"); 90Contract.EndContractBlock(); 179Contract.EndContractBlock(); 201Contract.EndContractBlock();
system\runtime\serialization\valuetypefixupinfo.cs (1)
43Contract.EndContractBlock();
system\runtime\versioning\binarycompatibility.cs (13)
118Contract.Ensures(Contract.Result<TargetFrameworkId>() > TargetFrameworkId.NotYetChecked); 132Contract.Ensures(Contract.Result<int>() > 0 || s_AppWasBuiltForFramework == TargetFrameworkId.Unspecified); 137Contract.Assert(s_AppWasBuiltForFramework != TargetFrameworkId.Unrecognized); 188Contract.Requires(buildAgainstVersion > 0 || builtAgainstFramework == TargetFrameworkId.Unspecified); 256Contract.Assert(false, "Bad framework kind"); 259Contract.Assert(false, "Error: we introduced a new Target Framework but did not update our binary compatibility map"); 270Contract.Requires(!String.IsNullOrEmpty(targetFrameworkMoniker)); 334Contract.Assert(false, "This is a phone app, but we can't tell what version this is!"); 340Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Silverlight profile \"{0}\". What is this, an XBox app?", profile)); 347Contract.Assert(false, String.Format(CultureInfo.InvariantCulture, "Unrecognized Target Framework Moniker in our Binary Compatibility class. Framework name: \"{0}\"", targetFrameworkMoniker)); 370Contract.EndContractBlock();
system\runtime\versioning\resourceattributes.cs (1)
235Contract.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
system\runtime\versioning\targetframeworkattribute.cs (1)
32Contract.EndContractBlock();
system\runtimehandles.cs (8)
649Contract.EndContractBlock(); 884Contract.EndContractBlock(); 899Contract.EndContractBlock(); 1053Contract.EndContractBlock(); 1068Contract.EndContractBlock(); 1226Contract.Requires(method != null); 1797Contract.EndContractBlock(); 1815Contract.EndContractBlock();
system\sbyte.cs (10)
88Contract.Ensures(Contract.Result<String>() != null); 94Contract.Ensures(Contract.Result<String>() != null); 99Contract.Ensures(Contract.Result<String>() != null); 104Contract.Ensures(Contract.Result<String>() != null); 110Contract.Ensures(Contract.Result<String>() != null);
system\security\accesscontrol\ace.cs (8)
143Contract.Assert( false, "Length > ushort.MaxValue" ); 692Contract.EndContractBlock(); 743Contract.EndContractBlock(); 793Contract.EndContractBlock(); 891Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" ); 1205Contract.Assert( false, "Invalid ACE type" ); 1644Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" ); 2210Contract.Assert( false, "OpaqueLength somehow managed to exceed MaxOpaqueLength" );
system\security\accesscontrol\acl.cs (26)
46Contract.EndContractBlock(); 182Contract.EndContractBlock(); 255Contract.EndContractBlock(); 380Contract.Assert( false, "aceLength % 4 != 0" ); 519Contract.Assert( false, "aceLength % 4 != 0" ); 546Contract.EndContractBlock(); 555Contract.Assert( false, "aceLength % 4 != 0" ); 580Contract.EndContractBlock(); 1365Contract.Assert(( ace.AccessMask & newAce.AccessMask) == newAce.AccessMask, "AceFlagsAreMergeable:: AccessMask of existing ace does not contain all access bits of new ace."); 1742Contract.Assert( false, "Audit and alarm ACEs must have been stripped by remove-meaningless logic" ); 1794Contract.Assert( ace != null, "How did a null ACE end up in a SACL?" ); 1826Contract.Assert( false, "Allow and deny ACEs must have been stripped by remove-meaningless logic" ); 1886Contract.EndContractBlock(); 2014Contract.EndContractBlock(); 2113Contract.EndContractBlock(); 2224Contract.EndContractBlock(); 2669Contract.EndContractBlock(); 2889Contract.EndContractBlock(); 3009Contract.EndContractBlock(); 3030Contract.EndContractBlock(); 3051Contract.EndContractBlock(); 3071Contract.EndContractBlock(); 3172Contract.EndContractBlock(); 3195Contract.EndContractBlock(); 3218Contract.EndContractBlock(); 3240Contract.EndContractBlock();
system\security\accesscontrol\commonobjectsecurity.cs (16)
219Contract.EndContractBlock(); 267Contract.Assert( false, "Invalid operation" ); 308Contract.Assert( false, "Invalid operation" ); 326Contract.Assert( false, "rule.AccessControlType unrecognized" ); 350Contract.EndContractBlock(); 434Contract.EndContractBlock(); 455Contract.EndContractBlock(); 476Contract.EndContractBlock(); 499Contract.EndContractBlock(); 525Contract.EndContractBlock(); 553Contract.EndContractBlock(); 579Contract.EndContractBlock(); 600Contract.EndContractBlock(); 621Contract.EndContractBlock(); 642Contract.EndContractBlock(); 663Contract.EndContractBlock();
system\security\accesscontrol\directoryobjectsecurity.cs (17)
316Contract.Assert(false, "Invalid operation"); 357Contract.Assert(false, "Invalid operation"); 375Contract.Assert(false, "rule.AccessControlType unrecognized"); 447Contract.Assert(false, "Invalid operation"); 490Contract.EndContractBlock(); 502Contract.EndContractBlock(); 515Contract.EndContractBlock(); 538Contract.EndContractBlock(); 559Contract.EndContractBlock(); 580Contract.EndContractBlock(); 606Contract.EndContractBlock(); 632Contract.EndContractBlock(); 658Contract.EndContractBlock(); 679Contract.EndContractBlock(); 700Contract.EndContractBlock(); 721Contract.EndContractBlock(); 742Contract.EndContractBlock();
system\security\accesscontrol\filesecurity.cs (4)
187Contract.EndContractBlock(); 297Contract.EndContractBlock(); 504Contract.EndContractBlock(); 549Contract.EndContractBlock();
system\security\accesscontrol\nativeobjectsecurity.cs (4)
166Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32GetSecurityInfo() failed with unexpected error code {0}", error )); 311Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Unexpected error code {0}", error )); 362Contract.EndContractBlock(); 388Contract.EndContractBlock();
system\security\accesscontrol\objectsecurity.cs (10)
89Contract.EndContractBlock(); 100Contract.Assert( newOne != null, "Must not supply a null parameter here" ); 382Contract.EndContractBlock(); 426Contract.EndContractBlock(); 447Contract.EndContractBlock(); 468Contract.EndContractBlock(); 618Contract.EndContractBlock(); 668Contract.EndContractBlock(); 702Contract.EndContractBlock(); 729Contract.EndContractBlock();
system\security\accesscontrol\privilege.cs (7)
139Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "LookupPrivilegeValue() failed with unrecognized error code {0}", error )); 250Contract.Assert( this.isImpersonating == false, "Incorrect isImpersonating state" ); 314Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "WindowsIdentity.GetCurrentThreadToken() failed with unrecognized error code {0}", error )); 411Contract.EndContractBlock(); 424Contract.Assert( !this.needToRevert, "Must revert privileges that you alter!" ); 579Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error )); 669Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "AdjustTokenPrivileges() failed with unrecognized error code {0}", error ));
system\security\accesscontrol\privilegenotheldexception.cs (1)
52Contract.EndContractBlock();
system\security\accesscontrol\rules.cs (2)
62Contract.EndContractBlock(); 159Contract.EndContractBlock();
system\security\accesscontrol\securitydescriptor.cs (9)
245Contract.Assert( false, "binaryForm produced invalid output" ); 250Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.ConvertSdToSddl returned {0}", error )); 280Contract.EndContractBlock(); 518Contract.EndContractBlock(); 639Contract.EndContractBlock(); 678Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Unexpected error out of Win32.ConvertStringSdToSd: {0}", error )); 960Contract.EndContractBlock(); 1221Contract.EndContractBlock(); 1235Contract.EndContractBlock();
system\security\accesscontrol\win32.cs (1)
338Contract.Assert( false, "Internal error: both name and handle are null" );
system\security\builtinpermissionsets.cs (4)
284Contract.Requires(!String.IsNullOrEmpty(permissionSetXml)); 286Contract.Requires(!String.IsNullOrEmpty(extensionXml)); 308Contract.Assert(!String.IsNullOrEmpty(permissionSetXml)); 326Contract.Requires(!String.IsNullOrEmpty(extensionXml));
system\security\claims\Claim.cs (1)
208Contract.EndContractBlock();
system\security\claims\ClaimsIdentity.cs (9)
641Contract.EndContractBlock(); 668Contract.EndContractBlock(); 767Contract.EndContractBlock(); 795Contract.EndContractBlock(); 825Contract.EndContractBlock(); 857Contract.EndContractBlock(); 888Contract.EndContractBlock(); 914Contract.EndContractBlock(); 984Contract.EndContractBlock();
system\security\claims\ClaimsPrincipal.cs (12)
182Contract.EndContractBlock(); 199Contract.EndContractBlock(); 223Contract.EndContractBlock(); 336Contract.EndContractBlock(); 484Contract.EndContractBlock(); 500Contract.EndContractBlock(); 555Contract.EndContractBlock(); 587Contract.EndContractBlock(); 618Contract.EndContractBlock(); 650Contract.EndContractBlock(); 681Contract.EndContractBlock(); 715Contract.EndContractBlock();
system\security\codeaccesspermission.cs (8)
92Contract.Assert(new StackFrame().GetMethod().Name.Equals("Demand"), "This method needs to be named Demand"); 120Contract.Assert(new StackFrame().GetMethod().Name.Equals("Assert"), "This method needs to be named Assert"); 173Contract.Assert( perm.GetType().FullName.Equals( permname ), "Incorrect class name passed in! Was: " + permname + " Should be " + perm.GetType().FullName); 183Contract.EndContractBlock(); 263Contract.Assert( grant == null || grant.GetType().Equals( this.GetType() ), "CheckDemand not defined for permissions of different type" ); 269Contract.Assert( permitted == null || permitted.GetType().Equals( this.GetType() ), "CheckPermitOnly not defined for permissions of different type" ); 275Contract.Assert( denied == null || denied.GetType().Equals( this.GetType() ), "CheckDeny not defined for permissions of different type" ); 282Contract.Assert( asserted == null || asserted.GetType().Equals( this.GetType() ), "CheckPermitOnly not defined for permissions of different type" );
system\security\codeaccesssecurityengine.cs (12)
130Contract.Assert((assemblyOrString == null || assemblyOrString is RuntimeAssembly || assemblyOrString is String), "Must pass in an Assembly object or String object here"); 192Contract.Assert(demands != null, "Should not reach here with a null demand set"); 306Contract.Assert(demand != null, "Should not reach here with a null demand"); 347Contract.Assert(demand != null,"demand != null"); 429Contract.Assert(grantSet != null, "Missing grant set"); 499Contract.Assert(securityContext != null, "securityContext != null"); 555Contract.Assert( asm != null, "Must pass in a good assembly" ); 556Contract.Assert( demand != null, "Must pass in a good demand" ); 619Contract.Assert(AssertPermissionToken != null && AssertPermission != null, "Assert Permission not setup correctly"); 732Contract.Assert(evidence != null); 733Contract.Assert(!AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled); // This API does not do CAS policy resolution 764Contract.Assert(evidence != null);
system\security\cryptography\asymmetricsignaturedeformatter.cs (1)
36Contract.EndContractBlock();
system\security\cryptography\asymmetricsignatureformatter.cs (1)
35Contract.EndContractBlock();
system\security\cryptography\base64transforms.cs (4)
54Contract.EndContractBlock(); 71Contract.EndContractBlock(); 149Contract.EndContractBlock(); 193Contract.EndContractBlock();
system\security\cryptography\capinative.cs (20)
277Contract.Assert(keyContainer == null, "Key containers are not supported"); 305Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 306Contract.Assert(((AlgorithmClass)algorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm"); 321Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 322Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0"); 335Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 336Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0"); 337Contract.Assert(offset >= 0 && count > 0, "offset >= 0 && count > 0"); 338Contract.Assert(buffer.Length >= offset + count, "buffer.Length >= offset + count"); 355Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size"); 364Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 392Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size"); 401Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 430Contract.Assert(hashHandle != null && !hashHandle.IsInvalid, "hashHandle != null && !hashHandle.IsInvalid"); 448Contract.Assert(cspHandle != null && !cspHandle.IsInvalid, "cspHandle != null && !cspHandle.IsInvalid"); 449Contract.Assert(keyHandle != null && !keyHandle.IsInvalid, "keyHandle != null && !keyHandle.IsInvalid"); 450Contract.Assert(((AlgorithmClass)signatureAlgorithm & AlgorithmClass.Signature) == AlgorithmClass.Signature, "Invalid signature algorithm"); 451Contract.Assert(((AlgorithmClass)hashAlgorithm & AlgorithmClass.Hash) == AlgorithmClass.Hash, "Invalid hash algorithm"); 452Contract.Assert(hashValue != null, "hashValue != null"); 453Contract.Assert(signature != null, "signature != null");
system\security\cryptography\cryptoapitransform.cs (3)
207Contract.EndContractBlock(); 247Contract.EndContractBlock(); 307Contract.Assert((CspProviderFlags.UseMachineKeyStore |
system\security\cryptography\cryptoconfig.cs (9)
549Contract.EndContractBlock(); 574Contract.EndContractBlock(); 694Contract.EndContractBlock(); 723Contract.EndContractBlock(); 756Contract.EndContractBlock(); 834Contract.Assert(nameMappingNode != null, "No name mappings"); 835Contract.Assert(String.Compare(nameMappingNode.Name, "cryptoNameMapping", StringComparison.Ordinal) == 0, "Invalid name mapping root"); 884Contract.Assert(oidMappingNode != null, "No OID mappings"); 885Contract.Assert(String.Compare(oidMappingNode.Name, "oidMap", StringComparison.Ordinal) == 0, "Invalid OID mapping root");
system\security\cryptography\cryptostream.cs (12)
189Contract.EndContractBlock(); 317Contract.EndContractBlock(); 345Contract.Requires(CanRead); 346Contract.Requires(offset >= 0); 347Contract.Requires(count >= 0); 348Contract.Requires(buffer.Length - offset >= count); 501Contract.EndContractBlock(); 581Contract.EndContractBlock(); 600Contract.Requires(CanWrite); 601Contract.Requires(offset >= 0); 602Contract.Requires(count >= 0); 603Contract.Requires(buffer.Length - offset >= count);
system\security\cryptography\des.cs (1)
55Contract.EndContractBlock();
system\security\cryptography\dsa.cs (1)
158Contract.EndContractBlock();
system\security\cryptography\dsacryptoserviceprovider.cs (10)
73Contract.EndContractBlock(); 274Contract.Assert(data != null); 275Contract.Assert(offset >= 0 && offset <= data.Length); 276Contract.Assert(count >= 0 && count <= data.Length - offset); 277Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); 290Contract.Assert(data != null); 291Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); 305Contract.EndContractBlock(); 329Contract.EndContractBlock(); 377Contract.EndContractBlock();
system\security\cryptography\dsasignaturedeformatter.cs (3)
35Contract.EndContractBlock(); 46Contract.EndContractBlock(); 60Contract.EndContractBlock();
system\security\cryptography\dsasignatureformatter.cs (3)
35Contract.EndContractBlock(); 46Contract.EndContractBlock(); 58Contract.EndContractBlock();
system\security\cryptography\hashalgorithm.cs (3)
101Contract.EndContractBlock(); 143Contract.EndContractBlock(); 166Contract.EndContractBlock();
system\security\cryptography\hmac.cs (2)
187Contract.Requires(createStandardHashAlgorithmCallback != null); 188Contract.Requires(createFipsHashAlgorithmCallback != null);
system\security\cryptography\mactripledes.cs (1)
58Contract.EndContractBlock();
system\security\cryptography\md5cryptoserviceprovider.cs (1)
32Contract.EndContractBlock();
system\security\cryptography\passwordderivebytes.cs (1)
108Contract.EndContractBlock();
system\security\cryptography\rc2cryptoserviceprovider.cs (1)
41Contract.EndContractBlock();
system\security\cryptography\rfc2898derivebytes.cs (7)
68Contract.EndContractBlock(); 107Contract.EndContractBlock(); 129Contract.EndContractBlock(); 142Contract.EndContractBlock(); 155Contract.EndContractBlock(); 157Contract.Assert(m_blockSize > 0); 175Contract.Assert(m_startIndex == 0 && m_endIndex == 0, "Invalid start or end index in the internal buffer." );
system\security\cryptography\rijndaelmanaged.cs (1)
30Contract.EndContractBlock();
system\security\cryptography\rijndaelmanagedtransform.cs (6)
57Contract.EndContractBlock(); 247Contract.EndContractBlock(); 315Contract.EndContractBlock(); 477Contract.Assert(m_blockSizeBytes <= m_Nb * sizeof(int), "m_blockSizeBytes <= m_Nb * sizeof(int)"); 482Contract.Assert(m_blockSizeBytes <= m_Nb * sizeof(int), "m_blockSizeBytes <= m_Nb * sizeof(int)"); 562Contract.Assert(m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int), "m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int)");
system\security\cryptography\ripemd160managed.cs (1)
42Contract.EndContractBlock();
system\security\cryptography\rngcryptoserviceprovider.cs (2)
95Contract.EndContractBlock(); 108Contract.EndContractBlock();
system\security\cryptography\rsa.cs (1)
267Contract.EndContractBlock();
system\security\cryptography\rsacryptoserviceprovider.cs (15)
113Contract.EndContractBlock(); 342Contract.EndContractBlock(); 352Contract.Requires(rgbHash != null); 371Contract.EndContractBlock(); 379Contract.Requires(rgbHash != null); 380Contract.Requires(rgbSignature != null); 402Contract.EndContractBlock(); 421Contract.EndContractBlock(); 485Contract.EndContractBlock(); 522Contract.Assert(data != null); 523Contract.Assert(offset >= 0 && offset <= data.Length); 524Contract.Assert(count >= 0 && count <= data.Length); 525Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); 536Contract.Assert(data != null); 537Contract.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name));
system\security\cryptography\rsaoaepkeyexchangedeformatter.cs (2)
24Contract.EndContractBlock(); 56Contract.EndContractBlock();
system\security\cryptography\rsaoaepkeyexchangeformatter.cs (2)
26Contract.EndContractBlock(); 66Contract.EndContractBlock();
system\security\cryptography\rsapkcs1keyexchangedeformatter.cs (2)
24Contract.EndContractBlock(); 85Contract.EndContractBlock();
system\security\cryptography\rsapkcs1keyexchangeformatter.cs (2)
28Contract.EndContractBlock(); 52Contract.EndContractBlock();
system\security\cryptography\rsapkcs1signaturedeformatter.cs (3)
40Contract.EndContractBlock(); 51Contract.EndContractBlock(); 66Contract.EndContractBlock();
system\security\cryptography\rsapkcs1signatureformatter.cs (3)
33Contract.EndContractBlock(); 44Contract.EndContractBlock(); 57Contract.EndContractBlock();
system\security\cryptography\sha1managed.cs (1)
44Contract.EndContractBlock();
system\security\cryptography\sha256managed.cs (1)
46Contract.EndContractBlock();
system\security\cryptography\sha384managed.cs (1)
44Contract.EndContractBlock();
system\security\cryptography\sha512managed.cs (1)
36Contract.EndContractBlock();
system\security\cryptography\signaturedescription.cs (1)
33Contract.EndContractBlock();
system\security\cryptography\symmetricalgorithm.cs (2)
125Contract.EndContractBlock(); 140Contract.EndContractBlock();
system\security\cryptography\tripledes.cs (2)
54Contract.EndContractBlock(); 99Contract.EndContractBlock();
system\security\cryptography\utils.cs (5)
527Contract.Assert(Environment.OSVersion.Version.Major < 6, "CryptGetFIPSAlgorithmMode should be used on Vista+"); 577Contract.EndContractBlock(); 602Contract.EndContractBlock(); 663Contract.Assert(i < 8, "Got too big an int here!"); 689Contract.Assert(i < 4, "Got too big an int here!");
system\security\cryptography\x509certificates\x509certificate.cs (4)
192Contract.EndContractBlock(); 201Contract.EndContractBlock(); 787Contract.EndContractBlock(); 825Contract.EndContractBlock();
system\security\cryptography\x509certificates\x509utils.cs (5)
130Contract.Requires(key != null); 180Contract.Requires(oid != null); 200Contract.Requires(oid != null); 207Contract.Requires(friendlyName != null); 281Contract.EndContractBlock();
system\security\framesecuritydescriptor.cs (1)
303Contract.Assert(demand != null && !demand.CheckDemand(null), "Empty demands should have been filtered out by this point");
system\security\hostprotectionexception.cs (2)
59Contract.EndContractBlock(); 130Contract.EndContractBlock();
system\security\hostsecuritymanager.cs (2)
94Contract.EndContractBlock(); 162Contract.EndContractBlock();
system\security\namedpermissionset.cs (4)
88Contract.Assert(permissionSetXml != null); 101Contract.EndContractBlock(); 139Contract.Assert( this.GetType().FullName.Equals( "System.Security.NamedPermissionSet" ), "Class name changed!" ); 163Contract.EndContractBlock();
system\security\permissionlistset.cs (4)
66Contract.Assert(m_permSetTriples == null, "m_permSetTriples != null"); 429Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); 445Contract.Assert(m_permSetTriples == null && m_firstPermSetTriple != null, "More than one PermissionSetTriple encountered in AD PermissionListSet"); 511Contract.Assert(flags != 0, "Invalid permission flag demand");
system\security\permissions\environmentpermission.cs (2)
166Contract.EndContractBlock(); 180Contract.EndContractBlock();
system\security\permissions\filedialogpermission.cs (1)
192Contract.EndContractBlock();
system\security\permissions\fileiopermission.cs (5)
214Contract.EndContractBlock(); 1263Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1283Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1360Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" ); 1448Contract.Assert( this.m_pathDiscovery == operand.m_pathDiscovery, "Path discovery settings must match" );
system\security\permissions\hostprotectionpermission.cs (2)
77Contract.EndContractBlock(); 205Contract.EndContractBlock();
system\security\permissions\keycontainerpermission.cs (7)
242Contract.EndContractBlock(); 257Contract.EndContractBlock(); 285Contract.EndContractBlock(); 308Contract.EndContractBlock(); 395Contract.EndContractBlock(); 606Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 657Contract.EndContractBlock();
system\security\permissions\principalpermission.cs (1)
526Contract.Assert( this.GetType().FullName.Equals( "System.Security.Permissions.PrincipalPermission" ), "Class name changed!" );
system\security\permissions\reflectionpermission.cs (1)
266Contract.EndContractBlock();
system\security\permissions\securitypermission.cs (1)
260Contract.EndContractBlock();
system\security\permissions\strongnameidentitypermission.cs (3)
148Contract.EndContractBlock(); 167Contract.EndContractBlock(); 194Contract.EndContractBlock();
system\security\permissions\strongnamepublickeyblob.cs (1)
30Contract.EndContractBlock();
system\security\permissions\uipermission.cs (2)
166Contract.EndContractBlock(); 175Contract.EndContractBlock();
system\security\permissions\urlidentitypermission.cs (1)
117Contract.EndContractBlock();
system\security\permissions\zoneidentitypermission.cs (1)
193Contract.EndContractBlock();
system\security\permissionset.cs (44)
261Contract.EndContractBlock(); 380Contract.Assert( PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ), 382Contract.Assert( PermissionToken.GetToken( perm ).m_index == index, 699Contract.Assert( demandedPerm != null, "Expected non-null value" ); 707Contract.Assert( tokenDemandedPerm != null, "Unable to find token for demanded permission" ); 722Contract.Assert(demandedSet != null, "Expected non-null value"); 746Contract.Assert( child is SecurityElement, "SecurityElement expected" ); 748Contract.Assert( elChild.InternalChildren != null, 754Contract.Assert( !current.GetTag().Equals( parent.Tag ), 823Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" ); 868Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 877Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1029Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1039Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1055Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1065Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1087Contract.Assert( intersectPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1160Contract.Assert( thisElem is SecurityElement, "SecurityElement expected" ); 1301Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1311Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1330Contract.Assert( PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1351Contract.Assert( unionPerm == null || PermissionToken.s_tokenSet.GetItem( i ) != null, "PermissionToken should already be assigned" ); 1762Contract.EndContractBlock(); 1795Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(), 1798Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" ); 1817Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ), 1860Contract.EndContractBlock(); 1902Contract.Assert( objectToInsert.GetType().Module.Assembly == System.Reflection.Assembly.GetExecutingAssembly(), 1905Contract.Assert((token != null), "PermissionToken.GetToken returned null "); 1906Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should always know the permission type when getting a token from an instance" ); 1925Contract.Assert( PermissionToken.IsTokenProperlyAssigned( ip, token ), 2040Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" ); 2050Contract.Assert( tempPerm != null, "We should only come here if we have a real permission" ); 2071Contract.Assert( (token.m_type & PermissionTokenType.DontKnow) == 0, "We should know the permission type already" ); 2096Contract.Assert( false, "Unrecognized case found during permission creation" ); 2118Contract.Assert(perm == null || PermissionToken.IsTokenProperlyAssigned( perm, PermissionToken.GetToken( perm ) ), "PermissionToken was improperly assigned"); 2141Contract.Assert( false, "No Permission or IPermission tag found" ); 2221Contract.Assert( this.GetType().FullName.Equals( "System.Security.PermissionSet" ), "Class name changed! Was: System.Security.PermissionSet Should be:" + this.GetType().FullName); 2382Contract.Assert(casPset == null || !casPset.IsReadOnly); 2383Contract.Assert(nonCasPset == null || !nonCasPset.IsReadOnly); 2431Contract.Assert(i == 0 || ((SecurityAttribute)attrs[i]).m_action == ((SecurityAttribute)attrs[i - 1]).m_action, "Mixed SecurityActions"); 2460Contract.Assert(serialize || nonCasPset == null, "We shouldn't separate nonCAS permissions unless fSerialize is true"); 2521Contract.Assert((assertSet == null || !assertSet.IsUnrestricted()), "Cannot be unrestricted here"); 2577Contract.Assert(!assertSet.IsUnrestricted(), "Cannot call this function if assertSet is unrestricted");
system\security\permissionsettriple.cs (3)
97Contract.Assert((!in_a.IsUnrestricted() || RefusedSet == null), "Cannot be unrestricted or refused must be null"); 247Contract.Assert(AssertSet == null, "AssertSet not null"); 255Contract.Assert(AssertSet == null, "AssertSet not null");
system\security\permissiontoken.cs (12)
70Contract.EndContractBlock(); 108Contract.Assert( c_mscorlibName == ((RuntimeAssembly)Assembly.GetExecutingAssembly()).GetSimpleName(), 163Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" ); 169Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo"); 251Contract.Assert( method != null, "IBuiltInPermission types should have a static method called 'GetTokenIndex'" ); 257Contract.Assert(getTokenIndex != null, "method is not a RuntimeMethodInfo"); 293Contract.Assert( (m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when ToXml is called" ); 309Contract.Assert( false, "Tried to deserialize non-PermissionToken element here" ); 320Contract.Assert((this.m_type & PermissionTokenType.DontKnow) == 0, "Should have valid token type when FromXml is called."); 403Contract.Assert( cls != null, "Must pass in valid type" ); 459Contract.Assert( !(perm is IBuiltInPermission), "This should not be called for built-ins" ); 467Contract.Assert( cls.GetInterface( "System.Security.Permissions.IBuiltInPermission" ) == null, "This shoudl not be called for built-ins" );
system\security\policy\allmembershipcondition.cs (2)
68Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.AllMembershipCondition" ), "Class name changed!" ); 84Contract.EndContractBlock();
system\security\policy\appdomainevidencefactory.cs (2)
24Contract.Assert(target != null); 25Contract.Assert(target == AppDomain.CurrentDomain, "AppDomainEvidenceFactory should not be used across domains.");
system\security\policy\applicationdirectory.cs (3)
32Contract.EndContractBlock(); 39Contract.Assert(appDirectory != null); 82Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.ApplicationDirectory" ), "Class name changed!" );
system\security\policy\applicationsecurityinfo.cs (5)
51Contract.EndContractBlock(); 67Contract.EndContractBlock(); 84Contract.EndContractBlock(); 158Contract.EndContractBlock(); 189Contract.EndContractBlock();
system\security\policy\applicationsecuritymanager.cs (1)
41Contract.EndContractBlock();
system\security\policy\applicationtrust.cs (8)
127Contract.EndContractBlock(); 466Contract.EndContractBlock(); 481Contract.EndContractBlock(); 500Contract.EndContractBlock(); 538Contract.EndContractBlock(); 552Contract.EndContractBlock(); 571Contract.EndContractBlock(); 625Contract.EndContractBlock();
system\security\policy\assemblyevidencefactory.cs (6)
35Contract.Assert(targetAssembly != null); 36Contract.Assert(peFileFactory != null); 131Contract.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled); 220Contract.Assert(peFileEvidence != null); 221Contract.Assert(targetAssembly != null); 222Contract.Assert(peFileEvidence.Target is PEFileEvidenceFactory, "Expected upgrade path is from PEFile to Assembly");
system\security\policy\codegroup.cs (9)
45Contract.Assert( membershipCondition != null, "membershipCondition != null" ); 46Contract.Assert( permSet != null, "permSet != null" ); 60Contract.EndContractBlock(); 78Contract.EndContractBlock(); 94Contract.EndContractBlock(); 152Contract.EndContractBlock(); 196Contract.EndContractBlock(); 336Contract.Assert( this.GetType().FullName.Equals( policyClassName ), "Incorrect class name passed in! Was: " + policyClassName + " Should be " + this.GetType().FullName); 401Contract.EndContractBlock();
system\security\policy\evidence.cs (53)
211Contract.Assert(target != null); 300Contract.Assert(m_evidenceLock == null || !IsReaderLockHeld); 310Contract.Assert(m_evidenceLock == null || !IsWriterLockHeld); 320Contract.Assert(IsWriterLockHeld); 329Contract.Assert(IsReaderLockHeld); 335Contract.Assert(IsReaderLockHeld); 345Contract.Assert(IsWriterLockHeld); 361Contract.EndContractBlock(); 383Contract.EndContractBlock(); 402Contract.EndContractBlock(); 426Contract.Assert(IsWriterLockHeld); 427Contract.Assert(evidence != null); 428Contract.Assert(evidenceType != null); 459Contract.EndContractBlock(); 476Contract.Assert(evidence != null); 477Contract.Assert(evidenceType != null); 496Contract.Assert(IsWriterLockHeld); 497Contract.Assert(evidence != null); 498Contract.Assert(evidenceType != null); 526Contract.Assert(IsWriterLockHeld); 629Contract.Assert((m_target != null && m_target is PEFileEvidenceFactory && value != null && value is AssemblyEvidenceFactory) || 650Contract.Assert(evidence != null); 679Contract.Assert(IsReaderLockHeld || IsWriterLockHeld); 680Contract.Assert(evidenceType != null); 728Contract.Assert(original != null); 729Contract.Assert(duplicate != null); 730Contract.Assert(original.GetType() == duplicate.GetType() || original.GetType() == typeof(LegacyEvidenceList)); 766Contract.Assert(evidence != null); 981Contract.Assert(IsReaderLockHeld || IsWriterLockHeld); 1070Contract.EndContractBlock(); 1111Contract.Assert(IsReaderLockHeld); 1122Contract.Assert(IsReaderLockHeld); 1146Contract.Assert(type != null); 1156Contract.Assert(IsReaderLockHeld || IsWriterLockHeld); 1157Contract.Assert(type != null); 1189Contract.Assert(type != null); 1197Contract.Assert(type != null); 1228Contract.Assert(IsReaderLockHeld || IsWriterLockHeld); 1229Contract.Assert(type != null); 1304Contract.Assert(type != null); 1305Contract.Assert(IsWriterLockHeld); 1449Contract.EndContractBlock(); 1541Contract.Assert(target != null); 1542Contract.Assert(lockType == LockType.Reader || lockType == LockType.Writer); 1581Contract.Assert(target != null); 1619Contract.Assert(evidence != null); 1620Contract.Assert(evidenceTypes != null); 1694Contract.Assert(evidence != null); 1695Contract.Assert(evidenceTypes != null); 1805Contract.Assert(evidence != null); 1806Contract.Assert(evidence.IsReaderLockHeld); 1885Contract.Assert(m_evidence != null); 1886Contract.Assert(m_evidence.IsReaderLockHeld);
system\security\policy\evidencebase.cs (7)
91Contract.Assert(legacyEvidence != null); 92Contract.Assert(legacyEvidence.GetType() != typeof(EvidenceBase), "Attempt to wrap an EvidenceBase in a LegacyEvidenceWrapper"); 93Contract.Assert(legacyEvidence.GetType().IsSerializable, "legacyEvidence.GetType().IsSerializable"); 158Contract.Assert(m_legacyEvidenceList.Count > 0, "No items in LegacyEvidenceList, cannot tell what type they are"); 167Contract.Assert(evidence != null); 168Contract.Assert(m_legacyEvidenceList.Count == 0 || EvidenceType == evidence.GetType() || (evidence is LegacyEvidenceWrapper && (evidence as LegacyEvidenceWrapper).EvidenceType == EvidenceType), 170Contract.Assert(evidence.GetType() != typeof(LegacyEvidenceList),
system\security\policy\evidencetypedescriptor.cs (5)
48Contract.Assert(descriptor != null); 75Contract.Assert(value != null); 92Contract.Assert(value, "Attempt to clear the Generated flag"); 106Contract.Assert(value, "Attempt to clear HostCanGenerate flag"); 120Contract.Assert(value != null);
system\security\policy\filecodegroup.cs (3)
43Contract.EndContractBlock(); 86Contract.EndContractBlock(); 98Contract.EndContractBlock();
system\security\policy\firstmatchcodegroup.cs (2)
42Contract.EndContractBlock(); 119Contract.EndContractBlock();
system\security\policy\gacmembershipcondition.cs (1)
87Contract.EndContractBlock();
system\security\policy\hash.cs (16)
92Contract.EndContractBlock(); 108Contract.Assert(hash != null); 120Contract.Assert(hashType != null); 121Contract.Assert(hashValue != null); 139Contract.EndContractBlock(); 152Contract.EndContractBlock(); 165Contract.EndContractBlock(); 293Contract.EndContractBlock(); 309Contract.Assert(hashType != null && typeof(HashAlgorithm).IsAssignableFrom(hashType), "Expected a hash algorithm"); 333Contract.Assert(hashType != null && typeof(HashAlgorithm).IsAssignableFrom(hashType), "Expected a hash algorithm"); 334Contract.Assert(assemblyBytes != null); 362Contract.Assert(assemblyBytes != null); 394Contract.Assert(hashAlgorithm != null && typeof(HashAlgorithm).IsAssignableFrom(hashAlgorithm)); 395Contract.Assert(fallbackImplementation != null && GetHashIndexType(hashAlgorithm).IsAssignableFrom(fallbackImplementation)); 408Contract.Assert(hashAlgorithm != null && typeof(HashAlgorithm).IsAssignableFrom(hashAlgorithm)); 445Contract.Assert(hashType != null && typeof(HashAlgorithm).IsAssignableFrom(hashType));
system\security\policy\hashmembershipcondition.cs (5)
59Contract.EndContractBlock(); 81Contract.EndContractBlock(); 95Contract.EndContractBlock(); 173Contract.Assert(this.GetType().FullName.Equals("System.Security.Policy.HashMembershipCondition"), "Class name changed!"); 189Contract.EndContractBlock();
system\security\policy\netcodegroup.cs (5)
136Contract.EndContractBlock(); 297Contract.EndContractBlock(); 365Contract.EndContractBlock(); 414Contract.EndContractBlock(); 428Contract.EndContractBlock();
system\security\policy\pefileevidencefactory.cs (1)
65Contract.Assert(peFile != null &&
system\security\policy\permissionrequestevidence.cs (1)
94Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.PermissionRequestEvidence" ), "Class name changed!" );
system\security\policy\policylevel.cs (16)
230Contract.EndContractBlock(); 257Contract.EndContractBlock(); 266Contract.EndContractBlock(); 276Contract.EndContractBlock(); 295Contract.EndContractBlock(); 305Contract.EndContractBlock(); 340Contract.EndContractBlock(); 361Contract.EndContractBlock(); 370Contract.EndContractBlock(); 432Contract.EndContractBlock(); 470Contract.EndContractBlock(); 558Contract.EndContractBlock(); 740Contract.EndContractBlock(); 1339Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 1376Contract.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 1418Contract.EndContractBlock();
system\security\policy\policystatement.cs (2)
369Contract.EndContractBlock(); 443Contract.EndContractBlock();
system\security\policy\publisher.cs (2)
35Contract.EndContractBlock(); 117Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Publisher" ), "Class name changed!" );
system\security\policy\publishermembershipcondition.cs (3)
59Contract.EndContractBlock(); 169Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.PublisherMembershipCondition" ), "Class name changed!" ); 187Contract.EndContractBlock();
system\security\policy\site.cs (3)
33Contract.EndContractBlock(); 40Contract.Assert(name != null); 106Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Site" ), "Class name changed!" );
system\security\policy\sitemembershipcondition.cs (4)
53Contract.EndContractBlock(); 71Contract.EndContractBlock(); 152Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.SiteMembershipCondition" ), "Class name changed!" ); 171Contract.EndContractBlock();
system\security\policy\strongname.cs (2)
57Contract.EndContractBlock(); 163Contract.EndContractBlock();
system\security\policy\strongnamemembershipcondition.cs (4)
60Contract.EndContractBlock(); 79Contract.EndContractBlock(); 222Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.StrongNameMembershipCondition" ), "Class name changed!" ); 248Contract.EndContractBlock();
system\security\policy\unioncodegroup.cs (3)
47Contract.EndContractBlock(); 94Contract.EndContractBlock(); 110Contract.EndContractBlock();
system\security\policy\url.cs (4)
32Contract.EndContractBlock(); 41Contract.EndContractBlock(); 48Contract.Assert(url != null); 99Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Url" ), "Class name changed!" );
system\security\policy\urlmembershipcondition.cs (4)
51Contract.EndContractBlock(); 72Contract.EndContractBlock(); 156Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.UrlMembershipCondition" ), "Class name changed!" ); 174Contract.EndContractBlock();
system\security\policy\zone.cs (4)
41Contract.EndContractBlock(); 48Contract.Assert(zone != null); 67Contract.EndContractBlock(); 130Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.Zone" ), "Class name changed!" );
system\security\policy\zonemembershipcondition.cs (3)
100Contract.EndContractBlock(); 167Contract.Assert( this.GetType().FullName.Equals( "System.Security.Policy.ZoneMembershipCondition" ), "Class name changed!" ); 186Contract.EndContractBlock();
system\security\policymanager.cs (3)
91Contract.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled); 278Contract.Assert(level != null, "No policy level to encode."); 459Contract.Assert(0 <= (int)zone && (int)zone < FullTrustMap.Length, "FullTrustMap does not contain a mapping for this zone.");
system\security\principal\genericidentity.cs (2)
45Contract.EndContractBlock(); 63Contract.EndContractBlock();
system\security\principal\genericprincipal.cs (1)
38Contract.EndContractBlock();
system\security\principal\ircollection.cs (9)
73Contract.EndContractBlock(); 84Contract.EndContractBlock(); 106Contract.EndContractBlock(); 143Contract.EndContractBlock(); 177Contract.EndContractBlock(); 218Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic."); 281Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic."); 378Contract.Assert( false, "Source type is an IdentityReference type which has not been included in translation logic."); 417Contract.EndContractBlock();
system\security\principal\ntaccount.cs (7)
61Contract.EndContractBlock(); 89Contract.EndContractBlock(); 126Contract.EndContractBlock(); 208Contract.EndContractBlock(); 262Contract.EndContractBlock(); 292Contract.Assert(false, "NTAccount::TranslateToSids - source account name is too long."); 348Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32Native.LsaLookupNames(2) returned unrecognized error {0}", win32ErrorCode ));
system\security\principal\sid.cs (13)
199Contract.EndContractBlock(); 311Contract.EndContractBlock(); 406Contract.EndContractBlock(); 424Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateSidFromString returned unrecognized error {0}", Error )); 475Contract.EndContractBlock(); 526Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", ErrorCode) ); 549Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.CreateWellKnownSid returned unrecognized error {0}", Error )); 757Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32.GetWindowsAccountDomainSid returned unrecognized error {0}", Error) ); 787Contract.EndContractBlock(); 847Contract.EndContractBlock(); 932Contract.EndContractBlock(); 998Contract.Assert( false, string.Format( CultureInfo.InvariantCulture, "Win32Native.LsaLookupSids returned {0}", win32ErrorCode)); 1114Contract.EndContractBlock();
system\security\principal\win32.cs (4)
60Contract.Assert( r, "OSVersion native call failed." ); 87Contract.Assert( r, "OSVersion native call failed"); 322Contract.Assert(referencedDomains != null, "referencedDomains != null"); 347Contract.Assert(bufferSize > 0, "bufferSize > 0");
system\security\principal\windowsidentity.cs (7)
172Contract.EndContractBlock(); 396Contract.EndContractBlock(); 886Contract.Assert(!m_safeTokenHandle.IsInvalid && !m_safeTokenHandle.IsClosed, "!m_safeTokenHandle.IsInvalid && !m_safeTokenHandle.IsClosed"); 889Contract.Assert(information.ByteLength >= (ulong)Marshal.SizeOf(typeof(T)), 910Contract.Assert(hr == 0, "[WindowsIdentity..QueryImpersonation] - hr == 0"); 1072Contract.Assert(Marshal.SizeOf(typeof(Win32Native.KERB_S4U_LOGON)) % IntPtr.Size == 0, "Potential allignment issue setting up S4U logon buffer"); 1159Contract.EndContractBlock();
system\security\principal\windowsimpersonationcontext.cs (1)
45Contract.EndContractBlock();
system\security\principal\windowsprincipal.cs (3)
76Contract.EndContractBlock(); 210Contract.EndContractBlock(); 232Contract.EndContractBlock();
system\security\readonlypermissionset.cs (1)
137Contract.Assert(permissionSetEnumerator != null);
system\security\securestring.cs (15)
116Contract.EndContractBlock(); 195Contract.EndContractBlock(); 293Contract.EndContractBlock(); 294Contract.Assert(index <= Int32.MaxValue / sizeof(char)); 316Contract.Assert(m_buffer != null, "Buffer is not initialized!"); 336Contract.EndContractBlock(); 344Contract.EndContractBlock(); 366Contract.EndContractBlock(); 373Contract.EndContractBlock(); 378Contract.Assert(size >= 0, "size must be non-negative"); 450Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!"); 451Contract.Assert(m_buffer.Length % BlockSize == 0, "buffer length must be multiple of blocksize!"); 651Contract.Assert(!m_buffer.IsInvalid && m_buffer.Length != 0, "Invalid buffer!"); 652Contract.Assert(m_buffer.Length % BlockSize == 0, "buffer length must be multiple of blocksize!"); 735Contract.Assert(Win32Native.SysStringLen((IntPtr)targetPtr) >= Win32Native.SysStringLen((IntPtr)sourcePtr), "Target buffer is not large enough!");
system\security\securitycontext.cs (10)
117Contract.Assert(currEC == Thread.CurrentThread.GetMutableExecutionContext(), "SecurityContextSwitcher used from another thread"); 118Contract.Assert(currSC == currEC.SecurityContext, "SecurityContextSwitcher context mismatch"); 126Contract.Assert(Thread.CurrentThread.GetExecutionContextReader().SecurityContext.IsSame(prevSC)); 345Contract.EndContractBlock(); 373Contract.Assert(GetCurrentWI(Thread.CurrentThread.GetExecutionContextReader()) == null); 531Contract.Assert(!this.isNewCapture); 642Contract.Assert(cachedAlwaysFlowImpersonationPolicy == _alwaysFlowImpersonationPolicy); 657Contract.Assert(currentEC.IsSame(Thread.CurrentThread.GetExecutionContextReader())); 658Contract.Assert(cachedAlwaysFlowImpersonationPolicy == _alwaysFlowImpersonationPolicy); 666Contract.Assert(_alwaysFlowImpersonationPolicy || currentEC.SecurityContext.WindowsIdentity == targetWI);
system\security\securitydocument.cs (1)
154Contract.Assert(bFoundEnd, "Malformed string in parse data");
system\security\securityelement.cs (21)
105Contract.EndContractBlock(); 118Contract.EndContractBlock(); 134Contract.EndContractBlock(); 157Contract.EndContractBlock(); 176Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 301Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 329Contract.EndContractBlock(); 338Contract.EndContractBlock(); 350Contract.EndContractBlock(); 362Contract.EndContractBlock(); 405Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 500Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 511Contract.Assert( false, "Unable to find escape sequence for this character" ); 562Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 684Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 776Contract.EndContractBlock(); 788Contract.Assert( iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly" ); 814Contract.EndContractBlock(); 845Contract.Assert((token.m_type & PermissionTokenType.DontKnow) == 0, "Token type not properly assigned"); 873Contract.EndContractBlock(); 905Contract.EndContractBlock();
system\security\securityexception.cs (2)
234Contract.EndContractBlock(); 640Contract.EndContractBlock();
system\security\securitymanager.cs (5)
84Contract.EndContractBlock(); 169Contract.EndContractBlock(); 210Contract.EndContractBlock(); 414Contract.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled); 437Contract.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled);
system\security\securityruntime.cs (4)
140Contract.Assert(secObj != null,"Failure in SecurityRuntime.Assert() - secObj != null"); 161Contract.Assert(secObj != null, "Failure in SecurityRuntime.AssertAllPossible() - secObj != null"); 190Contract.Assert(secObj != null, "Failure in SecurityRuntime.Deny() - secObj != null"); 211Contract.Assert(secObj != null, "Failure in SecurityRuntime.PermitOnly() - secObj != null");
system\security\util\hex.cs (1)
81Contract.EndContractBlock();
system\security\util\sitestring.cs (1)
48Contract.EndContractBlock();
system\security\util\stringexpressionset.cs (3)
130Contract.EndContractBlock(); 197Contract.Assert( m_throwOnRelative, "This should only be called when throw on relative is set" ); 221Contract.EndContractBlock();
system\security\util\tokenbasedset.cs (1)
427Contract.Assert( (thisObj == null || otherObj == null), "Permission cannot be in both TokenBasedSets" );
system\security\util\tokenizer.cs (5)
211Contract.Assert( _inSavedCharacter == -1, "There was a lookahead character at the stream change point, that means the parser is changing encodings too late" ); 269Contract.Assert(false, "attempting to change encoding on a non-changable source, should have been prevented earlier" ); 277Contract.Assert(false, "A new input source type has been added to the Tokenizer but it doesn't support encoding changes"); 283Contract.Assert( reader._in.CurrentEncoding != null, "Tokenizer's StreamReader does not have an encoding" ); 290Contract.Assert(stream != null, "The XML stream with new encoding was not properly initialized for kind of input we had");
system\security\util\urlstring.cs (3)
620Contract.EndContractBlock(); 1097Contract.EndContractBlock(); 1176Contract.EndContractBlock();
system\security\util\xmlutil.cs (5)
73Contract.Assert( type.FullName.Equals( typename ), "Incorrect class name passed! Was : " + typename + " Shoule be: " + type.FullName); 210Contract.EndContractBlock(); 435Contract.EndContractBlock(); 496Contract.Assert( groupClass.Module.Assembly != Assembly.GetExecutingAssembly(), 509Contract.EndContractBlock();
system\sharedstatics.cs (2)
66Contract.Assert(_sharedStatics._Remoting_Identity_IDGuid != null, 145Contract.Assert(Volatile.Read(ref _sharedStatics._memFailPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
system\single.cs (8)
181Contract.Ensures(Contract.Result<String>() != null); 187Contract.Ensures(Contract.Result<String>() != null); 193Contract.Ensures(Contract.Result<String>() != null); 199Contract.Ensures(Contract.Result<String>() != null);
system\string.cs (221)
87Contract.EndContractBlock(); 95Contract.EndContractBlock(); 125Contract.Ensures(Contract.Result<String>() != null); 126Contract.EndContractBlock(); 164Contract.Ensures(Contract.Result<String>() != null); 165Contract.EndContractBlock(); 216Contract.EndContractBlock(); 262Contract.Assert(*(pointerToJointString + charBuffer.Length) == '\0', "String must be null-terminated!"); 271Contract.Requires(strA != null); 272Contract.Requires(strB != null); 273Contract.EndContractBlock(); 286Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII"); 325Contract.Requires(strIn != null); 326Contract.EndContractBlock(); 339Contract.Assert(c <= 0x7F, "string has to be ASCII"); 347Contract.Assert(outBuff[length]=='\0', "outBuff[length]=='\0'"); 366Contract.Requires(strA != null); 367Contract.Requires(strB != null); 368Contract.Requires(strA.Length == strB.Length); 420Contract.Requires(strA != null); 421Contract.Requires(strB != null); 422Contract.Requires(strA.Length == strB.Length, "Lengths of strA and strB must be the same"); 436Contract.Assert((charA | charB) <= 0x7F, "strings have to be ASCII"); 464Contract.Requires(strA != null); 465Contract.Requires(strB != null); 515Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!"); 538Contract.Assert( *(a+1) != *(b+1), "This byte must be different if we reach here!"); 591Contract.EndContractBlock(); 658Contract.EndContractBlock(); 742Contract.EndContractBlock(); 779Contract.EndContractBlock(); 844Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 845Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); 901Contract.Assert(src[this.Length] == '\0', "src[this.Length] == '\\0'"); 902Contract.Assert( ((int)src)%4 == 0, "Managed string should start at 4 bytes boundary"); 976Contract.Ensures(Contract.Result<String[]>() != null); 992Contract.Ensures(Contract.Result<String[]>() != null); 998Contract.Ensures(Contract.Result<String[]>() != null); 1005Contract.Ensures(Contract.Result<String[]>() != null); 1018Contract.Ensures(Contract.Result<String[]>() != null); 1019Contract.EndContractBlock(); 1050Contract.Ensures(Contract.Result<String[]>() != null); 1064Contract.EndContractBlock(); 1101Contract.Requires(numReplaces >= 0); 1102Contract.Requires(count >= 2); 1103Contract.Ensures(Contract.Result<String[]>() != null); 1137Contract.Requires(numReplaces >= 0); 1138Contract.Requires(count >= 2); 1139Contract.Ensures(Contract.Result<String[]>() != null); 1166Contract.Assert(arrIndex < maxItems); 1231Contract.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0"); 1288Contract.EndContractBlock(); 1303Contract.Assert( startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 1304Contract.Assert( length >= 0 && startIndex <= this.Length - length, "length is out of range!"); 1405Contract.Requires(bytes != null); 1406Contract.Requires(byteLength >= 0); 1410Contract.Assert(stringLength >= 0, "stringLength >= 0"); 1421Contract.Assert(stringLength == doubleCheck, 1441Contract.Assert(cbNativeBuffer >= (Length + 1) * Marshal.SystemMaxDBCSCharSize, "Insufficient buffer length passed to ConvertToAnsi"); 1539Contract.Requires(dest != null); 1540Contract.Requires(src != null); 1544Contract.EndContractBlock(); 1607Contract.EndContractBlock(); 1708Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it 1735Contract.EndContractBlock(); 1736Contract.Assert(this == null, "this == null"); // this is the string constructor, we allocate it 1806Contract.EndContractBlock(); 1866Contract.EndContractBlock(); 1884Contract.EndContractBlock(); 1953Contract.EndContractBlock(); 1987Contract.EndContractBlock(); 2013Contract.EndContractBlock(); 2197Contract.EndContractBlock(); 2236Contract.EndContractBlock(); 2333Contract.EndContractBlock(); 2360Contract.EndContractBlock(); 2455Contract.EndContractBlock(); 2475Contract.EndContractBlock(); 2562Contract.EndContractBlock(); 2577Contract.EndContractBlock(); 2623Contract.EndContractBlock(); 2641Contract.Ensures(Contract.Result<String>() != null); 2642Contract.EndContractBlock(); 2652Contract.Ensures(Contract.Result<String>() != null); 2653Contract.EndContractBlock(); 2660Contract.Ensures(Contract.Result<String>() != null); 2661Contract.EndContractBlock(); 2668Contract.Ensures(Contract.Result<String>() != null); 2669Contract.EndContractBlock(); 2680Contract.Ensures(Contract.Result<String>() != null); 2681Contract.EndContractBlock(); 2689Contract.Ensures(Contract.Result<String>() != null); 2690Contract.EndContractBlock(); 2697Contract.Ensures(Contract.Result<String>() != null); 2698Contract.EndContractBlock(); 2703Contract.Ensures(Contract.Result<String>() != null); 2704Contract.EndContractBlock(); 2711Contract.Ensures(Contract.Result<Object>() != null); 2712Contract.EndContractBlock(); 2737Contract.Ensures(Contract.Result<String>() != null); 2738Contract.EndContractBlock(); 2828Contract.Ensures(Contract.Result<String>() != null); 2829Contract.Ensures(Contract.Result<String>().Length == this.Length + value.Length); 2830Contract.EndContractBlock(); 2865Contract.Ensures(Contract.Result<String>() != null); 2866Contract.Ensures(Contract.Result<String>().Length == this.Length); 2867Contract.EndContractBlock(); 2884Contract.Ensures(Contract.Result<String>() != null); 2885Contract.EndContractBlock(); 2921Contract.Ensures(Contract.Result<String>() != null); 2922Contract.Ensures(Contract.Result<String>().Length == this.Length - count); 2923Contract.EndContractBlock(); 2954Contract.Ensures(Contract.Result<String>() != null); 2955Contract.EndContractBlock(); 2961Contract.Ensures(Contract.Result<String>() != null); 2966Contract.Ensures(Contract.Result<String>() != null); 2971Contract.Ensures(Contract.Result<String>() != null); 2982Contract.Ensures(Contract.Result<String>() != null); 2983Contract.EndContractBlock(); 2989Contract.Ensures(Contract.Result<String>() != null); 2994Contract.Ensures(Contract.Result<String>() != null); 2999Contract.Ensures(Contract.Result<String>() != null); 3010Contract.Ensures(Contract.Result<String>() != null); 3011Contract.EndContractBlock(); 3031Contract.Ensures(Contract.Result<String>() != null); 3032Contract.EndContractBlock(); 3046Contract.Ensures(Contract.Result<String>() != null); 3047Contract.EndContractBlock(); 3057Contract.Ensures(Contract.Result<String>() != null); 3058Contract.EndContractBlock(); 3072Contract.Ensures(Contract.Result<String>() != null); 3073Contract.EndContractBlock(); 3094Contract.Ensures(Contract.Result<String>() != null); 3095Contract.EndContractBlock(); 3125Contract.Ensures(Contract.Result<String>() != null); 3126Contract.EndContractBlock(); 3148Contract.Ensures(Contract.Result<String>() != null); 3149Contract.EndContractBlock(); 3171Contract.Ensures(Contract.Result<String>() != null); 3172Contract.EndContractBlock(); 3188Contract.Ensures(Contract.Result<String>() != null); 3189Contract.Ensures(Contract.Result<String>().Length == 3192Contract.EndContractBlock(); 3217Contract.Ensures(Contract.Result<String>() != null); 3218Contract.Ensures(Contract.Result<String>().Length == 3222Contract.EndContractBlock(); 3252Contract.Ensures(Contract.Result<String>() != null); 3253Contract.Ensures(Contract.Result<String>().Length == 3258Contract.EndContractBlock(); 3297Contract.Assert((currPos <= totalLength - values[i].Length), 3310Contract.Ensures(Contract.Result<String>() != null); 3312Contract.EndContractBlock(); 3336Contract.Ensures(Contract.Result<String>().Length == str.Length); 3337Contract.Ensures(str.Equals(Contract.Result<String>())); 3338Contract.EndContractBlock(); 3349Contract.Ensures(Contract.Result<String>() == null || Contract.Result<String>().Length == str.Length); 3350Contract.EndContractBlock(); 3464Contract.Ensures(Contract.Result<CharEnumerator>() != null); 3465Contract.EndContractBlock(); 3472Contract.Ensures(Contract.Result<IEnumerator<char>>() != null); 3473Contract.EndContractBlock(); 3480Contract.Ensures(Contract.Result<IEnumerator>() != null); 3481Contract.EndContractBlock();
system\stringcomparer.cs (20)
26Contract.Ensures(Contract.Result<StringComparer>() != null); 33Contract.Ensures(Contract.Result<StringComparer>() != null); 40Contract.Ensures(Contract.Result<StringComparer>() != null); 47Contract.Ensures(Contract.Result<StringComparer>() != null); 54Contract.Ensures(Contract.Result<StringComparer>() != null); 61Contract.Ensures(Contract.Result<StringComparer>() != null); 70Contract.Ensures(Contract.Result<StringComparer>() != null); 71Contract.EndContractBlock(); 116Contract.EndContractBlock(); 184Contract.EndContractBlock(); 279Contract.EndContractBlock(); 357Contract.EndContractBlock(); 434Contract.EndContractBlock();
system\stubhelpers.cs (11)
486Contract.Assert(false, "NYI"); 492Contract.Assert(false, "NYI"); 498Contract.Assert(false, "NYI"); 600Contract.Assert(Environment.IsWinRTSupported); 943Contract.Assert(Environment.IsWinRTSupported); 1483Contract.Assert(Environment.IsWinRTSupported); 1512Contract.Ensures(Contract.Result<Exception>() != null || hr >= 0); 1527Contract.Assert(e != null || hr == 0 || hr == 1, "Unexpected HRESULT - it is a success HRESULT (without the high bit set) other than S_OK & S_FALSE."); 1777Contract.EndContractBlock(); 1793Contract.EndContractBlock();
system\text\asciiencoding.cs (43)
74Contract.EndContractBlock(); 96Contract.EndContractBlock(); 119Contract.EndContractBlock(); 149Contract.EndContractBlock(); 197Contract.EndContractBlock(); 234Contract.EndContractBlock(); 262Contract.EndContractBlock(); 290Contract.EndContractBlock(); 320Contract.EndContractBlock(); 357Contract.EndContractBlock(); 386Contract.EndContractBlock(); 407Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetByteCount]count is negative"); 408Contract.Assert(chars != null, "[ASCIIEncoding.GetByteCount]chars is null"); 411Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetByteCount]Attempting to use null fallback encoder"); 425Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 444Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 481Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ASCIIEncoding.GetByteCount]leftover character should be high surrogate"); 482Contract.Assert(encoder != null, "[ASCIIEncoding.GetByteCount]Expected encoder"); 532Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 543Contract.Assert(bytes != null, "[ASCIIEncoding.GetBytes]bytes is null"); 544Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetBytes]byteCount is negative"); 545Contract.Assert(chars != null, "[ASCIIEncoding.GetBytes]chars is null"); 546Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetBytes]charCount is negative"); 549Contract.Assert(encoderFallback != null, "[ASCIIEncoding.GetBytes]Attempting to use null encoder fallback"); 581Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 585Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 664Contract.Assert(encoder != null, 718Contract.Assert(chars > charStart || bytes == byteStart, 747Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 759Contract.Assert(bytes != null, "[ASCIIEncoding.GetCharCount]bytes is null"); 760Contract.Assert(count >= 0, "[ASCIIEncoding.GetCharCount]byteCount is negative"); 770Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 821Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 833Contract.Assert(bytes != null, "[ASCIIEncoding.GetChars]bytes is null"); 834Contract.Assert(byteCount >= 0, "[ASCIIEncoding.GetChars]byteCount is negative"); 835Contract.Assert(chars != null, "[ASCIIEncoding.GetChars]chars is null"); 836Contract.Assert(charCount >= 0, "[ASCIIEncoding.GetChars]charCount is negative"); 853Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 921Contract.Assert(bytes > byteStart || chars == charStart, 934Contract.Assert(bytes > byteStart || chars == charStart, 951Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 963Contract.EndContractBlock(); 984Contract.EndContractBlock();
system\text\basecodepageencoding.cs (5)
189Contract.Assert(info!=null, "[BaseCodePageEncoding.GetObjectData] Expected null info to throw"); 256Contract.Assert(pCodePage->ByteCount == 1 || pCodePage->ByteCount == 2, 279Contract.Assert(pMemorySection != null, 320Contract.Assert(arrayUnicodeBestFit != null, 333Contract.Assert(arrayBytesBestFit != null,
system\text\codepageencoding.cs (4)
49Contract.EndContractBlock(); 102Contract.Assert(false, "Didn't expect to make it to CodePageEncoding ISerializable.GetObjectData"); 120Contract.EndContractBlock(); 138Contract.Assert(false, "Didn't expect to make it to CodePageEncoding.Decoder.GetObjectData");
system\text\dbcscodepageencoding.cs (40)
65Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor"); 101Contract.Assert(pCodePage->CodePage == this.dataTableCodePage, 124Contract.Assert(bytesUnknown == 0x3f, 138Contract.Assert(((*mapCodePageCached == this.dataTableCodePage && this.bFlagDataTable) || 192Contract.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 411Contract.Assert((arrayTemp.Length / 2) < 20, 542Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 543Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 546Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 572Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 573Contract.Assert(encoder != null, 634Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 635Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 636Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 637Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 640Contract.Assert(encoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 658Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 673Contract.Assert(encoder != null, 706Contract.Assert(encoder == null, 728Contract.Assert(chars > charStart, 747Contract.Assert(chars > charStart, 787Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 788Contract.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 804Contract.Assert(decoder == null || 822Contract.Assert(fallbackBuffer == null, 846Contract.Assert(fallbackBuffer == null, 921Contract.Assert(decoder == null || !decoder.m_throwOnOverflow || 934Contract.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 935Contract.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 936Contract.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 937Contract.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 955Contract.Assert(decoder == null || !decoder.m_throwOnOverflow || 974Contract.Assert(fallbackBuffer == null, 999Contract.Assert(fallbackBuffer == null, 1077Contract.Assert(bytes >= byteStart + byteBuffer.Length, 1091Contract.Assert(bytes > byteStart, 1096Contract.Assert(bytes > byteStart, 1122Contract.Assert(decoder == null || !decoder.m_throwOnOverflow || 1135Contract.EndContractBlock(); 1157Contract.EndContractBlock();
system\text\decoder.cs (6)
54Contract.EndContractBlock(); 141Contract.EndContractBlock(); 207Contract.EndContractBlock(); 223Contract.Assert(result <= charCount, "Returned more chars than we have space for"); 279Contract.EndContractBlock(); 326Contract.EndContractBlock();
system\text\decoderbestfitfallback.cs (3)
106Contract.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 217Contract.Assert(index + 1 < oFallback.arrayBestFit.Length, 238Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
system\text\decoderfallback.cs (2)
157Contract.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 218Contract.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
system\text\decodernls.cs (6)
99Contract.EndContractBlock(); 121Contract.EndContractBlock(); 158Contract.EndContractBlock(); 188Contract.EndContractBlock(); 226Contract.EndContractBlock(); 260Contract.EndContractBlock();
system\text\decoderreplacementfallback.cs (2)
28Contract.EndContractBlock(); 162Contract.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
system\text\encoder.cs (6)
54Contract.EndContractBlock(); 137Contract.EndContractBlock(); 200Contract.EndContractBlock(); 216Contract.Assert(result <= byteCount, "Returned more bytes than we have space for"); 271Contract.EndContractBlock(); 318Contract.EndContractBlock();
system\text\encoderbestfitfallback.cs (5)
108Contract.Assert(iCount < 1, "[InternalEncoderBestFitFallbackBuffer.Fallback(non surrogate)] Fallback char " + ((int)cBestFit).ToString("X4", CultureInfo.InvariantCulture) + " caused recursive fallback"); 130Contract.EndContractBlock(); 135Contract.Assert(iCount < 1, "[InternalEncoderBestFitFallbackBuffer.Fallback(surrogate)] Fallback char " + ((int)cBestFit).ToString("X4", CultureInfo.InvariantCulture) + " caused recursive fallback"); 217Contract.Assert(index + 1 < oFallback.arrayBestFit.Length, 238Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
system\text\encoderexceptionfallback.cs (2)
77Contract.EndContractBlock(); 160Contract.EndContractBlock();
system\text\encoderfallback.cs (1)
171Contract.Assert(charStart != null,
system\text\encodernls.cs (6)
98Contract.EndContractBlock(); 124Contract.EndContractBlock(); 151Contract.EndContractBlock(); 180Contract.EndContractBlock(); 215Contract.EndContractBlock(); 248Contract.EndContractBlock();
system\text\encoderreplacementfallback.cs (3)
30Contract.EndContractBlock(); 161Contract.EndContractBlock(); 195Contract.Assert(fallbackIndex < strDefault.Length && fallbackIndex >= 0,
system\text\encoding.cs (38)
213Contract.EndContractBlock(); 232Contract.EndContractBlock(); 298Contract.EndContractBlock(); 337Contract.EndContractBlock(); 367Contract.Ensures(Contract.Result<byte[]>() != null); 388Contract.Ensures(Contract.Result<byte[]>() != null); 436Contract.EndContractBlock(); 579Contract.Assert(codepage != 0 && codepage != 1200 && codepage != 1201 && codepage != 65001, 865Contract.EndContractBlock(); 887Contract.EndContractBlock(); 956Contract.EndContractBlock(); 966Contract.EndContractBlock(); 997Contract.EndContractBlock(); 1013Contract.Requires(chars != null); 1014Contract.Requires(count >= 0); 1030Contract.EndContractBlock(); 1066Contract.EndContractBlock(); 1071Contract.Assert(byteCount == bytesReceived); 1080Contract.EndContractBlock(); 1124Contract.EndContractBlock(); 1140Contract.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 1168Contract.EndContractBlock(); 1194Contract.EndContractBlock(); 1224Contract.EndContractBlock(); 1284Contract.EndContractBlock(); 1300Contract.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1338Contract.EndContractBlock(); 1488Contract.EndContractBlock(); 1662Contract.EndContractBlock(); 1710Contract.EndContractBlock(); 1790Contract.EndContractBlock(); 1833Contract.EndContractBlock(); 1945Contract.Assert(fallbackBuffer.Remaining == 0, 2017Contract.Assert(bytes < byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 2147Contract.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 2211Contract.Assert(chars > charStart ||
system\text\encodingnls.cs (11)
61Contract.EndContractBlock(); 82Contract.EndContractBlock(); 102Contract.EndContractBlock(); 131Contract.EndContractBlock(); 178Contract.EndContractBlock(); 212Contract.EndContractBlock(); 239Contract.EndContractBlock(); 264Contract.EndContractBlock(); 293Contract.EndContractBlock(); 327Contract.EndContractBlock(); 354Contract.EndContractBlock();
system\text\gb18030encoding.cs (19)
138Contract.Assert(info!=null, "[GB18030Encoding(Serialization...)] Expected null info to throw"); 150Contract.Assert(info!=null, "[GB18030.GetObjectData] Expected null info to throw"); 209Contract.Assert(count4Byte <= GBLast4ByteCode, 227Contract.Assert(unicodeCount == 0, 231Contract.Assert(count4Byte == GBLast4ByteCode + 1, 271Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 272Contract.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 273Contract.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 276Contract.Assert(encoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 299Contract.Assert(Char.IsHighSurrogate(charLeftOver), 329Contract.Assert(offset < 0x6f, 379Contract.Assert(iBytes < 0x7e, 459Contract.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 460Contract.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 462Contract.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative"); 805Contract.EndContractBlock(); 827Contract.EndContractBlock(); 867Contract.EndContractBlock(); 895Contract.EndContractBlock();
system\text\isciiencoding.cs (36)
77Contract.Assert(defaultCodePage >= CodeDevanagari && defaultCodePage <= CodePunjabi, 91Contract.Assert(false, "Didn't expect to make it to ISCIIEncoding serialization constructor"); 102Contract.Assert(info!=null, "[ISCIIEncoding.GetObjectData] Expected null info to throw"); 120Contract.EndContractBlock(); 144Contract.EndContractBlock(); 175Contract.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 177Contract.Assert(charCount >=0, "[ISCIIEncoding.GetBytes]charCount >=0"); 178Contract.Assert(byteCount >=0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 275Contract.Assert(indicScript!=0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 286Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 301Contract.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3, 367Contract.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 368Contract.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 370Contract.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 402Contract.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 422Contract.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) + 483Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 484Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 485Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 486Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 515Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 516Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 517Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 518Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 551Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 552Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 553Contract.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 554Contract.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 559Contract.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 581Contract.Assert(bLastATR == false, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 582Contract.Assert(bLastVirama == false, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 583Contract.Assert(bLastDevenagariStressAbbr == false, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 588Contract.Assert (!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 607Contract.Assert (currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 653Contract.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt, 708Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
system\text\iso2022encoding.cs (28)
77Contract.Assert(false, "Didn't expect to make it to DBCSCodePageEncoding serialization constructor"); 135Contract.Assert(false, "[ISO2022Encoding.GetMemorySectionName] Don't expect to get here for code page " + this.CodePage); 279Contract.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 280Contract.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 291Contract.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 292Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 293Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 296Contract.Assert(encoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 332Contract.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 333Contract.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 344Contract.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 345Contract.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 346Contract.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 370Contract.Assert(false, "[ISO2022Encoding.GetChars] had unexpected code page"); 434Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 495Contract.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 677Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 777Contract.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 825Contract.Assert(Char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1151Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1245Contract.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1453Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1512Contract.Assert(byteCount >=0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1513Contract.Assert(bytes!=null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1624Contract.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1749Contract.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1768Contract.EndContractBlock(); 1823Contract.EndContractBlock();
system\text\latin1encoding.cs (28)
50Contract.Assert(info!=null, "[Latin1Encoding.GetObjectData] Expected null info to throw"); 68Contract.Assert(charCount >= 0, "[Latin1Encoding.GetByteCount]count is negative"); 69Contract.Assert(chars != null, "[Latin1Encoding.GetByteCount]chars is null"); 72Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetByteCount]Attempting to use null fallback encoder"); 82Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 88Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 125Contract.Assert(encoder != null, 174Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 185Contract.Assert(bytes != null, "[Latin1Encoding.GetBytes]bytes is null"); 186Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetBytes]byteCount is negative"); 187Contract.Assert(chars != null, "[Latin1Encoding.GetBytes]chars is null"); 188Contract.Assert(charCount >= 0, "[Latin1Encoding.GetBytes]charCount is negative"); 191Contract.Assert(encoderFallback != null, "[Latin1Encoding.GetBytes]Attempting to use null encoder fallback"); 200Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 204Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 287Contract.Assert(encoder != null, 341Contract.Assert(chars > charStart, 359Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false, 363Contract.Assert(chars > charStart, 388Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 399Contract.Assert(bytes != null, "[Latin1Encoding.GetCharCount]bytes is null"); 400Contract.Assert(count >= 0, "[Latin1Encoding.GetCharCount]byteCount is negative"); 412Contract.Assert(bytes != null, "[Latin1Encoding.GetChars]bytes is null"); 413Contract.Assert(byteCount >= 0, "[Latin1Encoding.GetChars]byteCount is negative"); 414Contract.Assert(chars != null, "[Latin1Encoding.GetChars]chars is null"); 415Contract.Assert(charCount >= 0, "[Latin1Encoding.GetChars]charCount is negative"); 451Contract.EndContractBlock(); 471Contract.EndContractBlock();
system\text\mlangcodepageencoding.cs (6)
51Contract.EndContractBlock(); 104Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding ISerializable.GetObjectData"); 122Contract.EndContractBlock(); 140Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding.MLangEncoder.GetObjectData"); 160Contract.EndContractBlock(); 178Contract.Assert(false, "Didn't expect to make it to MLangCodePageEncoding.MLangDecoder.GetObjectData");
system\text\normalization.cs (3)
189Contract.Requires(strInput != null); 226Contract.Requires(strInput != null); 282Contract.Assert(iLength > cBuffer.Length, "Buffer overflow should have iLength > cBuffer.Length");
system\text\sbcscodepageencoding.cs (38)
57Contract.Assert(false, "Didn't expect to make it to SBCSCodePageEncoding serialization constructor"); 77Contract.Assert(pCodePage->CodePage == this.dataTableCodePage, 100Contract.Assert(*mapCodePageCached == this.dataTableCodePage, 184Contract.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, String.Format(CultureInfo.InvariantCulture, 285Contract.Assert(arrayTemp[iBestFitCount-1] != (char)0, 307Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 308Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 311Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 323Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 328Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 367Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 418Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 429Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 430Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 431Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 432Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 435Contract.Assert(encoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 447Contract.Assert(charLeftOver == 0 || Char.IsHighSurrogate(charLeftOver), 452Contract.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 549Contract.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 602Contract.Assert(chars > charStart, 619Contract.Assert(fallbackBuffer == null || fallbackBuffer.bFallingBack == false, 623Contract.Assert(chars > charStart, 649Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 660Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 661Contract.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 680Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 733Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 745Contract.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 746Contract.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 747Contract.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 748Contract.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 772Contract.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 852Contract.Assert(bytes > byteStart, 870Contract.Assert(bytes > byteStart, 887Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 898Contract.EndContractBlock(); 918Contract.EndContractBlock();
system\text\stringbuilder.cs (159)
131Contract.EndContractBlock(); 168Contract.EndContractBlock(); 183Contract.EndContractBlock(); 248Contract.EndContractBlock(); 267Contract.Assert(currentBlock.m_MaxCapacity == maxCapacity, "Bad maxCapacity"); 268Contract.Assert(currentBlock.m_ChunkChars != null, "Empty Buffer"); 270Contract.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length, "Out of range length"); 271Contract.Assert(currentBlock.m_ChunkLength >= 0, "Negative length"); 272Contract.Assert(currentBlock.m_ChunkOffset >= 0, "Negative offset"); 277Contract.Assert(currentBlock.m_ChunkOffset == 0, "First chunk's offset is not 0"); 281Contract.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength, "There is a gap between chunks!"); 298Contract.EndContractBlock(); 322Contract.EndContractBlock(); 331Contract.Ensures(Contract.Result<String>() != null); 374Contract.Ensures(Contract.Result<String>() != null); 458Contract.Ensures(Contract.Result<int>() >= 0); 470Contract.EndContractBlock(); 478Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 500Contract.Assert(newLen > chunk.m_ChunkChars.Length, "the new chunk should be larger than the one it is replacing"); 510Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 558Contract.Ensures(Contract.Result<StringBuilder>() != null); 559Contract.EndContractBlock(); 576Contract.Assert(m_ChunkLength == 0, "Expand should create a new block"); 601Contract.Ensures(Contract.Result<StringBuilder>() != null); 602Contract.EndContractBlock(); 635Contract.Ensures(Contract.Result<StringBuilder>() != null); 708Contract.Ensures(Contract.Result<StringBuilder>() != null); 743Contract.Ensures(Contract.Result<StringBuilder>() != null); 749Contract.Ensures(Contract.Result<StringBuilder>() != null); 781Contract.EndContractBlock(); 824Contract.Ensures(Contract.Result<StringBuilder>() != null); 825Contract.EndContractBlock(); 844Contract.Assert(insertingChars + this.Length < Int32.MaxValue); 877Contract.Ensures(Contract.Result<StringBuilder>() != null); 878Contract.EndContractBlock(); 906Contract.Ensures(Contract.Result<StringBuilder>() != null); 914Contract.Ensures(Contract.Result<StringBuilder>() != null); 921Contract.Ensures(Contract.Result<StringBuilder>() != null); 927Contract.Ensures(Contract.Result<StringBuilder>() != null); 939Contract.Ensures(Contract.Result<StringBuilder>() != null); 946Contract.Ensures(Contract.Result<StringBuilder>() != null); 953Contract.Ensures(Contract.Result<StringBuilder>() != null); 960Contract.Ensures(Contract.Result<StringBuilder>() != null); 967Contract.Ensures(Contract.Result<StringBuilder>() != null); 972Contract.Ensures(Contract.Result<StringBuilder>() != null); 980Contract.Ensures(Contract.Result<StringBuilder>() != null); 988Contract.Ensures(Contract.Result<StringBuilder>() != null); 996Contract.Ensures(Contract.Result<StringBuilder>() != null); 1003Contract.Ensures(Contract.Result<StringBuilder>() != null); 1015Contract.Ensures(Contract.Result<StringBuilder>() != null); 1041Contract.Ensures(Contract.Result<StringBuilder>() != null); 1042Contract.EndContractBlock(); 1060Contract.Ensures(Contract.Result<StringBuilder>() != null); 1071Contract.Ensures(Contract.Result<StringBuilder>() != null); 1081Contract.Ensures(Contract.Result<StringBuilder>() != null); 1091Contract.Ensures(Contract.Result<StringBuilder>() != null); 1101Contract.Ensures(Contract.Result<StringBuilder>() != null); 1118Contract.Ensures(Contract.Result<StringBuilder>() != null); 1119Contract.EndContractBlock(); 1132Contract.Ensures(Contract.Result<StringBuilder>() != null); 1177Contract.Ensures(Contract.Result<StringBuilder>() != null); 1187Contract.Ensures(Contract.Result<StringBuilder>() != null); 1197Contract.Ensures(Contract.Result<StringBuilder>() != null); 1207Contract.Ensures(Contract.Result<StringBuilder>() != null); 1212Contract.Ensures(Contract.Result<StringBuilder>() != null); 1222Contract.Ensures(Contract.Result<StringBuilder>() != null); 1232Contract.Ensures(Contract.Result<StringBuilder>() != null); 1242Contract.Ensures(Contract.Result<StringBuilder>() != null); 1252Contract.Ensures(Contract.Result<StringBuilder>() != null); 1263Contract.Ensures(Contract.Result<StringBuilder>() != null); 1268Contract.Ensures(Contract.Result<StringBuilder>() != null); 1273Contract.Ensures(Contract.Result<StringBuilder>() != null); 1284Contract.Ensures(Contract.Result<String>() != null); 1285Contract.EndContractBlock(); 1291Contract.Ensures(Contract.Result<StringBuilder>() != null); 1296Contract.Ensures(Contract.Result<StringBuilder>() != null); 1301Contract.Ensures(Contract.Result<StringBuilder>() != null); 1312Contract.Ensures(Contract.Result<String>() != null); 1313Contract.EndContractBlock(); 1326Contract.Ensures(Contract.Result<StringBuilder>() != null); 1327Contract.EndContractBlock(); 1486Contract.Ensures(Contract.Result<StringBuilder>() != null); 1537Contract.Ensures(Contract.Result<StringBuilder>() != null); 1608Contract.Assert(chunk != null || count == 0, "Chunks ended prematurely"); 1624Contract.Ensures(Contract.Result<StringBuilder>() != null); 1692Contract.Assert(m_ChunkLength == 0, "Expand did not make a new block"); 1758Contract.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 1759Contract.Assert(gapStart <= gapEnd, "negative gap size"); 1760Contract.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 1770Contract.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 1823Contract.Assert(lengthInChunk >= 0, "index not in chunk"); 1917Contract.Assert(0 <= index && index <= Length, "index not in string"); 1923Contract.Assert(ret != null, "index not in string"); 1934Contract.Assert(0 <= byteIndex && byteIndex <= Length*sizeof(char), "Byte Index not in string"); 1940Contract.Assert(ret != null, "Byte Index not in string"); 1964Contract.Requires(Capacity == Length, "Expand expect to be called only when there is no space left"); // We are currently full 1965Contract.Requires(minBlockCharCount > 0, "Expansion request must be positive"); 2027Contract.Assert(count > 0, "Count must be strictly positive"); 2028Contract.Assert(index >= 0, "Index can't be negative"); 2094Contract.Assert(size > 0, "size not positive"); 2095Contract.Assert(maxCapacity > 0, "maxCapacity not positive"); 2112Contract.Assert(startIndex >= 0 && startIndex < Length, "startIndex not in string"); 2141Contract.Assert(chunk != null, "fell off beginning of string!"); 2171Contract.Assert(chunk != null, "fell off beginning of string!");
system\text\surrogateencoder.cs (2)
35Contract.EndContractBlock(); 55Contract.Assert(false, "Didn't expect to make it to SurrogateEncoder.GetObjectData");
system\text\unicodeencoding.cs (47)
111Contract.EndContractBlock(); 133Contract.EndContractBlock(); 156Contract.EndContractBlock(); 186Contract.EndContractBlock(); 234Contract.EndContractBlock(); 271Contract.EndContractBlock(); 299Contract.EndContractBlock(); 327Contract.EndContractBlock(); 357Contract.EndContractBlock(); 394Contract.EndContractBlock(); 423Contract.EndContractBlock(); 440Contract.Assert(chars!=null, "[UnicodeEncoding.GetByteCount]chars!=null"); 441Contract.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 590Contract.Assert(chars > charStart, 657Contract.Assert(chars > charStart, 723Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 734Contract.Assert(chars!=null, "[UnicodeEncoding.GetBytes]chars!=null"); 735Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 736Contract.Assert(charCount >=0, "[UnicodeEncoding.GetBytes]charCount >=0"); 737Contract.Assert(bytes!=null, "[UnicodeEncoding.GetBytes]bytes!=null"); 941Contract.Assert(chars > charStart, 1007Contract.Assert(chars > charStart + 1 || bytes == byteStart, 1036Contract.Assert(chars > charStart, 1070Contract.Assert(chars > charStart, 1138Contract.Assert((encoder != null && !encoder.MustFlush) || charLeftOver == (char)0, 1141Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 1154Contract.Assert(bytes!=null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 1155Contract.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1194Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1484Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 1494Contract.Assert(chars!=null, "[UnicodeEncoding.GetChars]chars!=null"); 1495Contract.Assert(byteCount >=0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1496Contract.Assert(charCount >=0, "[UnicodeEncoding.GetChars]charCount >=0"); 1497Contract.Assert(bytes!=null, "[UnicodeEncoding.GetChars]bytes!=null"); 1513Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1671Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1720Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1737Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1779Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1796Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1841Contract.Assert(bytes >= byteStart + 2 || chars == charStart, 1894Contract.Assert((decoder.MustFlush == false) || ((lastChar == (char)0) && (lastByte == -1)), 1909Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 1949Contract.EndContractBlock(); 1972Contract.EndContractBlock(); 2032Contract.EndContractBlock(); 2059Contract.EndContractBlock();
system\text\utf32encoding.cs (38)
115Contract.EndContractBlock(); 137Contract.EndContractBlock(); 159Contract.EndContractBlock(); 189Contract.EndContractBlock(); 237Contract.EndContractBlock(); 273Contract.EndContractBlock(); 301Contract.EndContractBlock(); 328Contract.EndContractBlock(); 358Contract.EndContractBlock(); 394Contract.EndContractBlock(); 422Contract.EndContractBlock(); 439Contract.Assert(chars!=null, "[UTF32Encoding.GetByteCount]chars!=null"); 440Contract.Assert(count >=0, "[UTF32Encoding.GetByteCount]count >=0"); 502Contract.Assert(chars > charStart, 555Contract.Assert(fallbackBuffer.Remaining == 0, 566Contract.Assert(chars!=null, "[UTF32Encoding.GetBytes]chars!=null"); 567Contract.Assert(bytes!=null, "[UTF32Encoding.GetBytes]bytes!=null"); 568Contract.Assert(byteCount >=0, "[UTF32Encoding.GetBytes]byteCount >=0"); 569Contract.Assert(charCount >=0, "[UTF32Encoding.GetBytes]charCount >=0"); 638Contract.Assert(chars > charStart + 1 || bytes == byteStart, 666Contract.Assert(chars > charStart, 707Contract.Assert(chars > charStart, 741Contract.Assert(highSurrogate == 0 || (encoder != null && !encoder.MustFlush), 760Contract.Assert(bytes!=null, "[UTF32Encoding.GetCharCount]bytes!=null"); 761Contract.Assert(count >=0, "[UTF32Encoding.GetCharCount]count >=0"); 786Contract.Assert(fallbackBuffer.Remaining == 0, 893Contract.Assert(fallbackBuffer.Remaining == 0, 904Contract.Assert(chars!=null, "[UTF32Encoding.GetChars]chars!=null"); 905Contract.Assert(bytes!=null, "[UTF32Encoding.GetChars]bytes!=null"); 906Contract.Assert(byteCount >=0, "[UTF32Encoding.GetChars]byteCount >=0"); 907Contract.Assert(charCount >=0, "[UTF32Encoding.GetChars]charCount >=0"); 934Contract.Assert(fallbackBuffer.Remaining == 0, 995Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1019Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1036Contract.Assert(bytes >= byteStart + 4 || chars == charStart, 1100Contract.Assert(fallbackBuffer.Remaining == 0, 1141Contract.EndContractBlock(); 1164Contract.EndContractBlock();
system\text\utf7encoding.cs (31)
179Contract.EndContractBlock(); 202Contract.EndContractBlock(); 225Contract.EndContractBlock(); 256Contract.EndContractBlock(); 304Contract.EndContractBlock(); 341Contract.EndContractBlock(); 369Contract.EndContractBlock(); 397Contract.EndContractBlock(); 427Contract.EndContractBlock(); 464Contract.EndContractBlock(); 493Contract.EndContractBlock(); 510Contract.Assert(chars!=null, "[UTF7Encoding.GetByteCount]chars!=null"); 511Contract.Assert(count >=0, "[UTF7Encoding.GetByteCount]count >=0"); 521Contract.Assert(byteCount >=0, "[UTF7Encoding.GetBytes]byteCount >=0"); 522Contract.Assert(chars!=null, "[UTF7Encoding.GetBytes]chars!=null"); 523Contract.Assert(charCount >=0, "[UTF7Encoding.GetBytes]charCount >=0"); 661Contract.Assert(count >=0, "[UTF7Encoding.GetCharCount]count >=0"); 662Contract.Assert(bytes!=null, "[UTF7Encoding.GetCharCount]bytes!=null"); 672Contract.Assert(byteCount >=0, "[UTF7Encoding.GetChars]byteCount >=0"); 673Contract.Assert(bytes!=null, "[UTF7Encoding.GetChars]bytes!=null"); 674Contract.Assert(charCount >=0, "[UTF7Encoding.GetChars]charCount >=0"); 693Contract.Assert(firstByte == false || decoder.bitCount <= 0, 854Contract.EndContractBlock(); 887Contract.EndContractBlock(); 916Contract.EndContractBlock(); 932Contract.EndContractBlock(); 981Contract.EndContractBlock(); 996Contract.EndContractBlock(); 1080Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 1081Contract.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 1141Contract.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
system\text\utf8encoding.cs (49)
143Contract.EndContractBlock(); 165Contract.EndContractBlock(); 188Contract.EndContractBlock(); 218Contract.EndContractBlock(); 266Contract.EndContractBlock(); 303Contract.EndContractBlock(); 331Contract.EndContractBlock(); 359Contract.EndContractBlock(); 389Contract.EndContractBlock(); 426Contract.EndContractBlock(); 455Contract.EndContractBlock(); 516Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 548Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 819Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 852Contract.Assert(chars!=null, "[UTF8Encoding.GetBytes]chars!=null"); 853Contract.Assert(byteCount >=0, "[UTF8Encoding.GetBytes]byteCount >=0"); 854Contract.Assert(charCount >=0, "[UTF8Encoding.GetBytes]charCount >=0"); 855Contract.Assert(bytes!=null, "[UTF8Encoding.GetBytes]bytes!=null"); 904Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 932Contract.Assert(ch >= 0xD800 && ch <= 0xDBFF, 1029Contract.Assert(pSrc >= chars || pTarget == bytes, 1251Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetBytes]pTarget <= pAllocatedBufferEnd"); 1262Contract.Assert(!encoder.MustFlush || ch == 0, 1269Contract.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0 || 1294Contract.Assert(count >=0, "[UTF8Encoding.GetCharCount]count >=0"); 1295Contract.Assert(bytes!=null, "[UTF8Encoding.GetCharCount]bytes!=null"); 1314Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1349Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0, 1670Contract.Assert(fallback == null || fallback.Remaining == 0, 1690Contract.Assert(chars!=null, "[UTF8Encoding.GetChars]chars!=null"); 1691Contract.Assert(byteCount >=0, "[UTF8Encoding.GetChars]count >=0"); 1692Contract.Assert(charCount >=0, "[UTF8Encoding.GetChars]charCount >=0"); 1693Contract.Assert(bytes!=null, "[UTF8Encoding.GetChars]bytes!=null"); 1710Contract.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1745Contract.Assert( (ch & (SupplimentarySeq | ThreeByteSeq)) != 0, 1808Contract.Assert(pSrc >= bytes || pTarget == chars, 1815Contract.Assert(pSrc >= bytes, 1901Contract.Assert(pSrc >= bytes || pTarget == chars, 2155Contract.Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetChars]pTarget <= pAllocatedBufferEnd"); 2182Contract.Assert(pSrc >= bytes || pTarget == chars, 2190Contract.Assert(pSrc >= bytes, 2201Contract.Assert(!baseDecoder.MustFlush || ch == 0 || !baseDecoder.m_throwOnOverflow, 2212Contract.Assert(fallback == null || fallback.Remaining == 0, 2349Contract.EndContractBlock(); 2372Contract.EndContractBlock(); 2437Contract.EndContractBlock(); 2462Contract.EndContractBlock(); 2512Contract.EndContractBlock(); 2538Contract.EndContractBlock();
system\threading\asynclocal.cs (7)
82Contract.Assert(m_valueChangedHandler != null); 138Contract.Assert(asyncLocalValueMap != null); 139Contract.Assert(asyncLocalValueMap == Empty || asyncLocalValueMap.GetType() != typeof(EmptyAsyncLocalValueMap)); 349Contract.Assert(count <= MaxMultiElements); 355Contract.Assert(index < _keyValues.Length); 484Contract.Assert(index == MultiElementAsyncLocalValueMap.MaxMultiElements); 497Contract.Assert(map.Count == count - 1);
system\threading\CancellationToken.cs (1)
172Contract.Assert(action != null, "Expected an Action here");
system\threading\CancellationTokenSource.cs (12)
89Contract.Assert(source != null); 643Contract.Assert(CanBeCanceled, "Cannot register for uncancelable token src"); 741Contract.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 753Contract.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 754Contract.Assert(ThreadIDExecutingCallbacks != -1, "ThreadIDExecutingCallbacks should have been set."); 838Contract.Assert(exceptionList.Count > 0, "Expected exception count > 0"); 918Contract.EndContractBlock(); 1029Contract.Assert(callbackInfo != null); 1113Contract.Assert(start >= 0 && start < c, "start is outside of bounds"); 1120Contract.Assert(tryIndex >= 0 && tryIndex < curr.m_elements.Length, "tryIndex is outside of bounds"); 1159Contract.Assert(source != null); 1160Contract.Assert(index >= 0 && index < source.Length);
system\threading\compressedstack.cs (2)
182Contract.EndContractBlock(); 287Contract.EndContractBlock();
system\threading\CountdownEvent.cs (3)
192Contract.Assert(m_event != null); 239Contract.Assert(m_event != null); 273Contract.Assert(m_currentCount >= 0, "latch was decremented below zero");
system\threading\eventwaithandle.cs (4)
63Contract.EndContractBlock(); 109Contract.EndContractBlock(); 238Contract.EndContractBlock(); 295Contract.EndContractBlock();
system\threading\executioncontext.cs (23)
335Contract.Assert(Thread.CurrentThread == this.thread); 532Contract.Assert(!IsPreAllocatedDefault); 547Contract.Assert(!IsPreAllocatedDefault); 572Contract.Assert(this == s_dummyDefaultEC); 711Contract.Assert(current._localChangeNotifications != null); 712Contract.Assert(Array.IndexOf(current._localChangeNotifications, local) >= 0); 804Contract.Assert(this != s_dummyDefaultEC); 821Contract.Assert(this != s_dummyDefaultEC); 837Contract.Assert(this != s_dummyDefaultEC); 852Contract.Assert(this != s_dummyDefaultEC); 866Contract.Assert(this != s_dummyDefaultEC); 882Contract.Assert(this != s_dummyDefaultEC); 937Contract.Assert(executionContext != null); 940Contract.Assert(executionContext.IsDefaultFTContext(preserveSyncCtx)); 944Contract.Assert(executionContext.isNewCapture); 997Contract.Assert(currentThread == Thread.CurrentThread); 1005Contract.Assert(SecurityContext.GetCurrentWI(ecsw.outerEC, ecsw.cachedAlwaysFlowImpersonationPolicy) == null); 1029Contract.Assert(executionContext != null); 1030Contract.Assert(executionContext != s_dummyDefaultEC); 1118Contract.Assert(this._illogicalCallContext == null); 1130Contract.Assert(!this.isNewCapture); 1173Contract.EndContractBlock(); 1336Contract.EndContractBlock();
system\threading\hostexecutioncontextmanager.cs (2)
206Contract.EndContractBlock(); 331Contract.Assert(_hostExecutionContextManager == null, "HostExecutionContextManager should be null");
system\threading\LazyInitializer.cs (1)
155Contract.Assert(target != null);
system\threading\ManualResetEventSlim.cs (11)
149Contract.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 150Contract.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 169Contract.Assert(value >= 0, "NumWaiters should never be less than zero. This indicates an internal error."); 247Contract.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 248Contract.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 259Contract.Ensures(m_lock != null); 300Contract.Assert(currentIsSet, 342Contract.Assert(m_lock != null); //if waiters>0, then m_lock has already been created. 751Contract.Assert(mre != null, "Expected a ManualResetEventSlim"); 752Contract.Assert(mre.m_lock != null); //the lock should have been created before this callback is registered for use. 772Contract.Assert((newBits | updateBitsMask) == updateBitsMask, "newBits do not fall within the updateBitsMask.");
system\threading\monitor.cs (3)
61Contract.Assert(lockTaken); 243Contract.EndContractBlock(); 262Contract.EndContractBlock();
system\threading\mutex.cs (4)
67Contract.EndContractBlock(); 96Contract.EndContractBlock(); 367Contract.EndContractBlock(); 510Contract.EndContractBlock();
system\threading\overlapped.cs (5)
97Contract.Assert(helper != null,"_IOCompletionCallback cannot be null"); 183Contract.Assert(m_pinSelf.IsNull(), "OverlappedData has not been freed: m_pinSelf"); 186Contract.Assert(m_AppDomainId == 0 || m_AppDomainId == AppDomain.CurrentDomain.Id, "OverlappedData is not in the current domain"); 415Contract.EndContractBlock(); 428Contract.EndContractBlock();
system\threading\SemaphoreSlim.cs (14)
96Contract.Assert(setSuccessfully, "Should have been able to complete task"); 368Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't"); 400Contract.Assert(!waitSuccessful || m_currentCount > 0, 629Contract.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 642Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 650Contract.Assert(m_asyncTail == null, "If head is null, so too should be tail"); 656Contract.Assert(m_asyncTail != null, "If head is not null, neither should be tail"); 671Contract.Requires(task != null, "Expected non-null task"); 672Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 682Contract.Assert((m_asyncHead == null) == (m_asyncTail == null), "Head is null iff tail is null"); 697Contract.Assert(asyncWaiter != null, "Waiter should have been constructed"); 698Contract.Assert(Monitor.IsEntered(m_lockObj), "Requires the lock be held"); 805Contract.Assert(m_asyncTail != null, "tail should not be null if head isn't null"); 889Contract.Assert(semaphore != null, "Expected a SemaphoreSlim");
system\threading\SpinLock.cs (5)
129Contract.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now"); 398Contract.Assert((newOwner & WAITERS_MASK) >= 0); 440Contract.Assert((newOwner & WAITERS_MASK) >= 0); 502Contract.Assert(!IsThreadOwnerTrackingEnabled); // Make sure the waiters never be negative which will cause the thread tracking bit to be flipped 515Contract.Assert(IsThreadOwnerTrackingEnabled);
system\threading\SpinWait.cs (2)
314Contract.Assert(procCount > 0 && procCount <= 64, 355Contract.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite);
system\threading\synchronizationcontext.cs (2)
160Contract.EndContractBlock(); 284Contract.Assert(Environment.IsWinRTSupported);
system\threading\Tasks\AsyncCausalityTracer.cs (1)
156Contract.Assert(token != default(EventRegistrationToken), "EventRegistrationToken is null");
system\threading\Tasks\BeginEndAwaitableAdapter.cs (7)
70Contract.Assert(asyncResult != null); 71Contract.Assert(asyncResult.IsCompleted); 72Contract.Assert(asyncResult.AsyncState is BeginEndAwaitableAdapter); 89Contract.Assert(continuation != CALLBACK_RAN); 119Contract.Assert(continuation != null); 128Contract.Assert(continuation != null); 147Contract.Assert(_asyncResult != null && _asyncResult.IsCompleted);
system\threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
110Contract.EndContractBlock(); 207Contract.Requires(ReadyToComplete, "The block must be ready to complete to be here."); 219Contract.Assert(!localCs.Task.IsCompleted, "Completion should only happen once."); 225Contract.Assert(success, "Expected to complete completion task."); 234Contract.Requires(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception.InnerExceptions.Count > 0, 342else Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 351Contract.Requires(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 352Contract.Requires(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 357Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 378Contract.Assert(currentMode == ProcessingMode.ProcessingExclusiveTask, 388Contract.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 401Contract.Requires(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 406Contract.Assert(!m_threadProcessingMapping.ContainsKey(Thread.CurrentThread.ManagedThreadId), 438Contract.Assert(currentMode == ProcessingMode.ProcessingConcurrentTasks, 448Contract.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 509Contract.Requires(pair != null, "Scheduler must be associated with a valid pair."); 510Contract.Requires(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 512Contract.Requires( 533Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 550Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 561Contract.Assert(task != null, "Infrastructure should have provided a non-null task."); 634Contract.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 674Contract.Requires(scheduler != null, "Need a scheduler with which to construct the debug view."); 697Contract.Requires(pair != null, "Need a pair with which to construct the debug view."); 740Contract.Requires(syncObj != null, "The monitor object to check must be provided."); 758Contract.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
system\threading\Tasks\Future.cs (11)
464Contract.Assert(m_action == null, "Task<T>.TrySetResult(): non-null m_action"); 504Contract.Assert(!IsCompleted, "The promise must not yet be completed."); 512Contract.Assert(success); 546Contract.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 565Contract.Assert(IsRanToCompletion, "Task<T>.Result getter: Expected result to have been set."); 579Contract.Assert(m_action == null, "Task<T>.TrySetException(): non-null m_action"); 582Contract.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 585Contract.Assert( 627Contract.Assert(m_action == null, "Task<T>.TrySetCanceled(): non-null m_action"); 676Contract.Assert(m_action != null); 689Contract.Assert(false, "Invalid m_action in Task<TResult>");
system\threading\Tasks\FutureFactory.cs (48)
540Contract.Requires((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 699Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 703Contract.EndContractBlock(); 822Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 853Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 959Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 989Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1104Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1134Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1256Contract.Requires((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1286Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1336Contract.Assert(thisRef != null, "Expected a non-null thisRef"); 1337Contract.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1338Contract.Assert(endMethod != null, "Expected a non-null endMethod"); 1351Contract.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1379Contract.Requires(thisRef != null, "Expected a non-null thisRef"); 1380Contract.Requires(endMethod != null, "Expected a non-null endMethod"); 1394Contract.EndContractBlock(); 1431Contract.Assert(!IsCompleted, "The task should not have been completed yet."); 1460Contract.Assert(successfullySet, "Expected the task to not yet be completed"); 1498Contract.EndContractBlock(); 1529Contract.EndContractBlock(); 1566Contract.EndContractBlock(); 1614Contract.EndContractBlock(); 1641Contract.EndContractBlock(); 1674Contract.EndContractBlock(); 1713Contract.EndContractBlock(); 1762Contract.EndContractBlock(); 1779Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1781Contract.EndContractBlock(); 1807Contract.Assert(continuationAction != null); 1826Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1828Contract.EndContractBlock(); 1860Contract.Assert(continuationAction != null); 1898Contract.EndContractBlock(); 1929Contract.EndContractBlock(); 1966Contract.EndContractBlock(); 2014Contract.EndContractBlock(); 2041Contract.EndContractBlock(); 2074Contract.EndContractBlock(); 2113Contract.EndContractBlock(); 2162Contract.EndContractBlock(); 2180Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2182Contract.EndContractBlock(); 2206Contract.Assert(continuationAction != null); 2227Contract.Requires((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2229Contract.EndContractBlock(); 2252Contract.Assert(continuationAction != null);
system\threading\Tasks\Parallel.cs (19)
1042Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 1044Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1168Contract.Assert(sharedPStateFlags != null); 1173Contract.Assert(sharedPStateFlags != null); 1357Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 1359Contract.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1482Contract.Assert(sharedPStateFlags != null); 1487Contract.Assert(sharedPStateFlags != null); 2225Contract.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2228Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2289Contract.Assert(array != null); 2290Contract.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 2348Contract.Assert(list != null); 2349Contract.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 3202Contract.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 3205Contract.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 3209Contract.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null), 3412Contract.Assert(false, "PartitionerForEach: illegal body type in Partitioner handler"); 3587Contract.Assert(m_timeLimit != 0, "Probably the default initializer for LoopTimer was used somewhere");
system\threading\Tasks\ParallelLoopState.cs (3)
52Contract.Assert(false); 109Contract.Assert(false); 157Contract.Assert(false);
system\threading\Tasks\ParallelRangeManager.cs (4)
193Contract.Assert((nFromInclusiveLocal <= Int32.MaxValue) && (nFromInclusiveLocal >= Int32.MinValue) && 252Contract.Assert((uSpan / uRangeSize) < Int32.MaxValue); 286Contract.Assert(i == nNumRanges - 1); 302Contract.Assert(m_indexRanges != null && m_indexRanges.Length != 0);
system\threading\Tasks\ProducerConsumerQueues.cs (15)
147Contract.Assert(INIT_SEGMENT_SIZE > 0, "Initial segment size must be > 0."); 148Contract.Assert((INIT_SEGMENT_SIZE & (INIT_SEGMENT_SIZE - 1)) == 0, "Initial segment size must be a power of 2"); 149Contract.Assert(INIT_SEGMENT_SIZE <= MAX_SEGMENT_SIZE, "Initial segment size should be <= maximum."); 150Contract.Assert(MAX_SEGMENT_SIZE < Int32.MaxValue / 2, "Max segment size * 2 must be < Int32.MaxValue, or else overflow could occur."); 180Contract.Requires(segment != null, "Expected a non-null segment."); 190Contract.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 235Contract.Requires(segment != null, "Expected a non-null segment."); 236Contract.Requires(array != null, "Expected a non-null item array."); 293Contract.Requires(segment != null, "Expected a non-null segment."); 294Contract.Requires(array != null, "Expected a non-null item array."); 359Contract.Requires(segment != null, "Expected a non-null segment."); 360Contract.Requires(array != null, "Expected a non-null item array."); 463Contract.Assert(syncObj != null, "The syncObj parameter is null."); 485Contract.Requires((size & (size - 1)) == 0, "Size must be a power of 2"); 524Contract.Requires(queue != null, "Expected a non-null queue.");
system\threading\Tasks\Task.cs (113)
230Contract.Requires(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 353Contract.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 565Contract.EndContractBlock(); 630Contract.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 631Contract.Assert((((int)creationOptions) | OptionsMask) == OptionsMask, "TaskConstructorCore: options take too many bits"); 658Contract.Assert((internalOptions & 751Contract.Assert(targetTask != null, 775Contract.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 803Contract.Assert((OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 853Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 861Contract.Assert(success, "Tried to set enabled on completed Task"); 898Contract.Assert(tasks != null, "Expected non-null array of tasks"); 938Contract.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 958Contract.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 1003Contract.Assert(Task.InternalCurrent == this || this.IsSelfReplicatingRoot, "Task.AddNewChild(): Called from an external context"); 1026Contract.Assert(Task.InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 1029Contract.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1165Contract.EndContractBlock(); 1176Contract.Requires(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1247Contract.Assert( 1264Contract.Assert((m_stateFlags & TASK_STATE_CANCELED) != 0, "Task.RunSynchronously: expected TASK_STATE_CANCELED to be set"); 1286Contract.EndContractBlock(); 1415Contract.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1509Contract.Assert(m_contingentProperties == null, "Expected props to be null after checking and with needsProtection == false"); 1914Contract.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1915Contract.Assert((m_stateFlags & TASK_STATE_STARTED) == 0, "task has already started"); 1969Contract.Assert( 1989Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 2000Contract.Requires(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 2105Contract.Assert(m_contingentProperties != null); // ExceptionRecorded ==> m_contingentProperties != null 2124Contract.Assert(exceptionsAvailable, "Must only be used when the task has faulted with exceptions."); 2134Contract.Assert(IsCanceled, "Must only be used when the task has canceled."); 2147Contract.Requires(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 2370Contract.Requires(childTask != null); 2371Contract.Requires(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 2373Contract.Assert(childTask.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2433Contract.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2437Contract.Assert(exceptionHolder != null); 2464Contract.Assert(!bTAEAddedToExceptionHolder || (m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null), 2859Contract.Assert(task != null, "expected a task object"); 2870Contract.Assert(m_action != null, "Null action in InnerInvoke()"); 2883Contract.Assert(false, "Invalid m_action in Task"); 2908Contract.Requires(unhandledException != null); 2966Contract.Requires(continuationAction != null); 3019Contract.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 3159Contract.EndContractBlock(); 3187Contract.Assert((m_stateFlags & TASK_STATE_FAULTED) == 0, "Task.Wait() completing when in Faulted state."); 3263Contract.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3393Contract.Requires((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3458Contract.Assert(!mustCleanup, "Possibly an invalid state transition call was made in InternalCancel()"); 3500Contract.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3501Contract.Assert(m_contingentProperties.m_cancellationToken == default(CancellationToken)); 3541Contract.Assert((m_stateFlags & (TASK_STATE_CANCELED | TASK_STATE_COMPLETION_RESERVED)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3575Contract.Assert(this == Task.InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3576Contract.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3707Contract.Assert(currentContinuation is ITaskCompletionAction, "Expected continuation element to be Action, TaskContinuation, or ITaskContinuationAction"); 3910Contract.EndContractBlock(); 4112Contract.EndContractBlock(); 4327Contract.EndContractBlock(); 4546Contract.EndContractBlock(); 4636Contract.Requires(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4637Contract.Requires(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4638Contract.Requires(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4729Contract.Requires(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4753Contract.Assert((list != null) || (m_continuationObject == s_taskCompletionSentinel), 4793Contract.Requires(tc != null); 5051Contract.EndContractBlock(); 5157Contract.Assert(exceptions != null, "Should have seen at least one exception"); 5182Contract.Assert(tasks != null, "Expected a non-null list of tasks"); 5183Contract.Assert(tasks.Count > 0, "Expected at least one task"); 5229Contract.Assert(count > 0, "Expected count > 0"); 5236Contract.Assert(_count >= 0, "Count should never go below 0"); 5246Contract.Requires(tasks != null); 5325Contract.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5464Contract.EndContractBlock(); 5496Contract.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5498Contract.Assert(signaledTaskIndex >= 0); 5538Contract.EndContractBlock(); 5542Contract.Assert(succeeded, "This should always succeed on a new task."); 5553Contract.EndContractBlock(); 5573Contract.EndContractBlock(); 5593Contract.EndContractBlock(); 5597Contract.Assert(succeeded, "This should always succeed on a new task."); 5709Contract.EndContractBlock(); 5760Contract.EndContractBlock(); 5870Contract.EndContractBlock(); 6050Contract.EndContractBlock(); 6071Contract.Requires(tasks != null, "Expected a non-null tasks array"); 6102Contract.Requires(tasks != null, "Expected a non-null task array"); 6103Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array"); 6142Contract.Assert(task != null, "Constituent task in WhenAll should never be null"); 6162Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6184Contract.Assert(m_count >= 0, "Count should never go below 0"); 6302Contract.EndContractBlock(); 6322Contract.Requires(tasks != null, "Expected a non-null tasks array"); 6346Contract.Requires(tasks != null, "Expected a non-null task array"); 6347Contract.Requires(tasks.Length > 0, "Expected a non-zero length task array"); 6387Contract.Assert(task != null, "Constituent task in WhenAll should never be null"); 6400Contract.Assert(task.Status == TaskStatus.RanToCompletion); 6412Contract.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6434Contract.Assert(m_count >= 0, "Count should never go below 0"); 6476Contract.EndContractBlock(); 6511Contract.EndContractBlock(); 6593Contract.Requires(outerTask != null); 6626Contract.Assert(continuationTask.m_action == null); 7051Contract.Assert(m_inliningDepth >= 0, "Inlining depth count should never go negative."); 7152Contract.Requires(outerTask != null, "Expected non-null outerTask"); 7210Contract.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7213Contract.Assert(false, "UnwrapPromise in illegal state"); 7238Contract.Requires(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7239Contract.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7251Contract.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7269Contract.Requires(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
system\threading\Tasks\TaskCompletionSource.cs (1)
215Contract.Assert(exceptions != null);
system\threading\Tasks\TaskContinuation.cs (32)
37Contract.Requires(action is Action<Task> || action is Action<Task, object>, 51Contract.Assert(antecedent != null, 59Contract.Assert(m_action != null); 72Contract.Assert(false, "Invalid m_action in ContinuationTaskFromTask"); 85Contract.Requires(function is Func<Task, TResult> || function is Func<Task, object, TResult>, 99Contract.Assert(antecedent != null, 107Contract.Assert(m_action != null); 120Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromTask"); 133Contract.Requires(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object>, 147Contract.Assert(antecedent != null, 155Contract.Assert(m_action != null); 168Contract.Assert(false, "Invalid m_action in ContinuationTaskFromResultTask"); 181Contract.Requires(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object, TResult>, 195Contract.Assert(antecedent != null, 203Contract.Assert(m_action != null); 216Contract.Assert(false, "Invalid m_action in ContinuationResultTaskFromResultTask"); 244Contract.Requires(task != null); 245Contract.Assert(task.m_taskScheduler != null); 305Contract.Requires(task != null, "TaskContinuation ctor: task is null"); 306Contract.Requires(scheduler != null, "TaskContinuation ctor: scheduler is null"); 324Contract.Assert(completedTask != null); 325Contract.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed"); 405Contract.Assert(context != null); 496Contract.Assert(scheduler != null); 559Contract.Requires(action != null); 575Contract.Requires(action != null); 590Contract.Requires(action != null); 591Contract.Requires(scheduler != null); 748Contract.Requires(callback != null); 749Contract.Assert(currentTask == Task.t_currentTask); 796Contract.Assert(currentTask == Task.t_currentTask); 865Contract.Assert(m_action != null);
system\threading\Tasks\TaskExceptionHolder.cs (14)
63Contract.Requires(task != null, "Expected a non-null task."); 189Contract.Requires(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 190Contract.Requires( 206Contract.Requires(exceptionObject != null, "Expected exceptionObject to be non-null."); 208Contract.Assert(m_cancellationException == null, 213Contract.Assert(m_faultExceptions == null, 227Contract.Assert(edi != null && edi.SourceException is OperationCanceledException, 243Contract.Requires(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject"); 248else Contract.Assert(exceptions.Count > 0, "Expected existing exceptions list to have > 0 exceptions."); 376Contract.Assert(exceptions != null, "Expected an initialized list."); 377Contract.Assert(exceptions.Count > 0, "Expected at least one exception."); 406Contract.Assert(exceptions != null, "Expected an initialized list."); 407Contract.Assert(exceptions.Count > 0, "Expected at least one exception."); 422Contract.Assert(edi == null || edi.SourceException is OperationCanceledException,
system\threading\Tasks\TaskFactory.cs (44)
233Contract.EndContractBlock(); 1641Contract.Requires((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1672Contract.Assert(_count >= 0, "Count should never go below 0"); 1693Contract.Requires(tasksCopy != null); 1719Contract.Requires((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1750Contract.Assert(_count >= 0, "Count should never go below 0"); 1771Contract.Requires(tasksCopy != null); 1804Contract.EndContractBlock(); 1836Contract.EndContractBlock(); 1873Contract.EndContractBlock(); 1921Contract.EndContractBlock(); 1948Contract.EndContractBlock(); 1982Contract.EndContractBlock(); 2021Contract.EndContractBlock(); 2070Contract.EndContractBlock(); 2100Contract.EndContractBlock(); 2136Contract.EndContractBlock(); 2177Contract.EndContractBlock(); 2229Contract.EndContractBlock(); 2261Contract.EndContractBlock(); 2298Contract.EndContractBlock(); 2341Contract.EndContractBlock(); 2394Contract.EndContractBlock(); 2422Contract.Requires(tasks != null, "Expected non-null collection of tasks"); 2450Contract.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 2477Contract.Requires(tasks != null); 2548Contract.EndContractBlock(); 2579Contract.EndContractBlock(); 2616Contract.EndContractBlock(); 2664Contract.EndContractBlock(); 2695Contract.EndContractBlock(); 2730Contract.EndContractBlock(); 2771Contract.EndContractBlock(); 2823Contract.EndContractBlock(); 2889Contract.EndContractBlock(); 2932Contract.EndContractBlock(); 2985Contract.EndContractBlock(); 3013Contract.EndContractBlock(); 3046Contract.EndContractBlock(); 3085Contract.EndContractBlock(); 3134Contract.EndContractBlock(); 3148Contract.EndContractBlock(); 3168Contract.EndContractBlock(); 3215Contract.EndContractBlock();
system\threading\Tasks\TaskScheduler.cs (2)
271Contract.Requires(task != null); 595Contract.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed");
system\threading\Tasks\TaskToApm.cs (8)
47Contract.Requires(task != null); 82Contract.Assert(task != null, "TaskWrapperAsyncResult should never wrap a null Task."); 107Contract.Assert(twar.Task != null, "TaskWrapperAsyncResult should never wrap a null Task."); 127Contract.Requires(antecedent != null); 128Contract.Requires(callback != null); 129Contract.Requires(asyncResult != null); 174Contract.Requires(task != null); 175Contract.Requires(!completedSynchronously || task.IsCompleted, "If completedSynchronously is true, the task must be completed.");
system\threading\Tasks\ThreadPoolTaskScheduler.cs (2)
45Contract.Requires(obj != null, "TaskScheduler.LongRunningThreadWork: obj is null"); 47Contract.Assert(t != null, "TaskScheduler.LongRunningThreadWork: t is null");
system\threading\thread.cs (21)
234Contract.EndContractBlock(); 245Contract.EndContractBlock(); 253Contract.EndContractBlock(); 264Contract.EndContractBlock(); 402Contract.Assert(Thread.CurrentThread == this); 765Contract.Assert(ProcessorIdRefreshRate <= ProcessorIdCacheCountDownMask); 823Contract.Ensures(Contract.Result<Thread>() != null); 1148Contract.Ensures(Contract.Result<CultureInfo>() != null); 1166Contract.EndContractBlock(); 1222Contract.Ensures(Contract.Result<CultureInfo>() != null); 1266Contract.Ensures(Contract.Result<CultureInfo>() != null); 1287Contract.EndContractBlock(); 1332Contract.Ensures(Contract.Result<CultureInfo>() != null); 1470Contract.Ensures(Contract.Result<AppDomain>() != null); 1479Contract.Assert(CurrentThread.m_Context == null || CurrentThread.m_Context.AppDomain == ad, "AppDomains on the managed & unmanaged threads should match");
system\threading\ThreadLocal.cs (5)
199Contract.Assert(id >= 0 || !m_initialized, "expected id >= 0 if initialized"); 556Contract.Assert(table.Length < minLength); 594Contract.Assert(minSize > 0); 743Contract.Assert(slotArray != null); 771Contract.Assert(linkedSlot.Previous != null);
system\threading\threadpool.cs (32)
180Contract.Assert(m_headIndex <= m_tailIndex); 242Contract.Assert(unused == obj); 442Contract.Assert(upper >= lower); 443Contract.Assert(upper <= nodes.Length); 444Contract.Assert(lower <= nodes.Length); 445Contract.Assert(upper >= 0); 446Contract.Assert(lower >= 0); 451Contract.Assert(newUpper >= newLower); 452Contract.Assert(newUpper <= nodes.Length); 453Contract.Assert(newLower <= nodes.Length); 454Contract.Assert(newUpper >= 0); 455Contract.Assert(newLower >= 0); 456Contract.Assert(newUpper >= prevUpper); 457Contract.Assert(newLower >= prevLower); 458Contract.Assert(newUpper == prevUpper ^ newLower == prevLower); 471Contract.Assert(QueueSegmentLength <= SixteenBits); 494Contract.Assert(null != node); 506Contract.Assert(Volatile.Read(ref nodes[upper]) == null); 665Contract.Assert(null != callback); 674Contract.Assert(null != callback); 702Contract.Assert(null != callback); 862Contract.Assert(false); 902Contract.Assert(null != cb); 1272Contract.Assert(null != wc); 1328Contract.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!"); 1450Contract.EndContractBlock(); 1491Contract.EndContractBlock(); 1508Contract.EndContractBlock(); 1525Contract.EndContractBlock(); 1542Contract.EndContractBlock(); 1656Contract.Assert(null != workItem); 1673Contract.Assert(null != workItem);
system\threading\timer.cs (19)
157Contract.Assert(!m_isAppDomainTimerScheduled); 158Contract.Assert(m_appDomainTimer == null); 164Contract.Assert(!m_isAppDomainTimerScheduled); 207Contract.Assert(id == 0); 283Contract.Assert(timer.m_dueTime != Timeout.UnsignedInfinite); 284Contract.Assert(resumedTicks >= timer.m_startTicks); 357Contract.Assert(timer.m_dueTime != Timeout.UnsignedInfinite); 749Contract.Assert(timer is TimerQueueTimer || timer is NetCore.TimerQueueTimer); 750Contract.Assert((timer is NetCore.TimerQueueTimer) == Timer.UseNetCoreTimer); 785Contract.Assert(!Timer.UseNetCoreTimer); 786Contract.Assert(m_timer is TimerQueueTimer); 797Contract.Assert(Timer.UseNetCoreTimer); 798Contract.Assert(m_timer is NetCore.TimerQueueTimer); 856Contract.EndContractBlock(); 912Contract.EndContractBlock(); 939Contract.EndContractBlock(); 987Contract.EndContractBlock(); 1013Contract.EndContractBlock(); 1022Contract.EndContractBlock();
system\threading\waithandle.cs (6)
198Contract.EndContractBlock(); 242Contract.EndContractBlock(); 264Contract.EndContractBlock(); 327Contract.EndContractBlock(); 434Contract.EndContractBlock(); 564Contract.EndContractBlock();
system\throwhelper.cs (2)
233Contract.Assert(false, "The enum value is not defined, please checked ExceptionArgumentName Enum."); 434Contract.Assert( false, "The enum value is not defined, please checked ExceptionArgumentName Enum.");
system\timespan.cs (3)
200Contract.EndContractBlock(); 231Contract.EndContractBlock(); 250Contract.EndContractBlock();
system\timezoneinfo.cs (19)
174Contract.Ensures(Contract.Result<TimeZoneInfo>() != null); 343Contract.EndContractBlock(); 380Contract.EndContractBlock(); 708Contract.EndContractBlock(); 731Contract.EndContractBlock(); 763Contract.EndContractBlock(); 893Contract.EndContractBlock(); 985Contract.EndContractBlock(); 1030Contract.Ensures(Contract.Result<TimeZoneInfo>() != null); 1073Contract.Ensures(Contract.Result<TimeZoneInfo>() != null); 1241Contract.EndContractBlock(); 2950Contract.EndContractBlock(); 3200Contract.EndContractBlock(); 3226Contract.EndContractBlock(); 3457Contract.EndContractBlock(); 3486Contract.EndContractBlock();
system\tuple.cs (1)
1071Contract.Assert(false, "Missed all cases for computing Tuple hash code");
system\type.cs (39)
387Contract.Ensures(Contract.Result<int>() >= 0); 414Contract.EndContractBlock(); 426Contract.EndContractBlock(); 485Contract.EndContractBlock(); 502Contract.EndContractBlock(); 515Contract.EndContractBlock(); 528Contract.EndContractBlock(); 539Contract.EndContractBlock(); 547Contract.EndContractBlock(); 603Contract.EndContractBlock(); 652Contract.EndContractBlock(); 662Contract.EndContractBlock(); 670Contract.EndContractBlock(); 680Contract.EndContractBlock(); 690Contract.EndContractBlock(); 700Contract.EndContractBlock(); 710Contract.EndContractBlock(); 718Contract.EndContractBlock(); 1218Contract.EndContractBlock(); 1318Contract.Ensures(Contract.Result<Type>() != null); 1364Contract.Ensures(Contract.Result<Type>() != null); 1390Contract.Ensures(Contract.Result<String[]>() != null); 1404Contract.Ensures(Contract.Result<Array>() != null); 1421Contract.Ensures(Contract.ValueAtReturn<String[]>(out enumNames) != null); 1422Contract.Ensures(Contract.ValueAtReturn<Array>(out enumValues) != null); 1472Contract.Ensures(Contract.Result<Type>() != null); 1488Contract.EndContractBlock(); 1542Contract.EndContractBlock(); 1720Contract.Requires(ifaceType != null); 1721Contract.Requires(ifaceType.IsInterface, "ifaceType must be an interface type"); 1769Contract.EndContractBlock();
system\typedreference.cs (1)
34Contract.EndContractBlock();
system\typeloadexception.cs (2)
109Contract.EndContractBlock(); 129Contract.EndContractBlock();
system\typenameparser.cs (7)
89Contract.EndContractBlock(); 143Contract.Assert(asmName != null); 171Contract.Assert(throwOnError == false); 183Contract.Assert(typeArguments[i] != null); 193Contract.Assert(throwOnError == false); 211Contract.Requires(asmName != null && asmName.Length > 0); 249Contract.Requires(names != null && names.Length > 0);
system\uint16.cs (8)
83Contract.Ensures(Contract.Result<String>() != null); 89Contract.Ensures(Contract.Result<String>() != null); 96Contract.Ensures(Contract.Result<String>() != null); 102Contract.Ensures(Contract.Result<String>() != null);
system\uint32.cs (8)
94Contract.Ensures(Contract.Result<String>() != null); 100Contract.Ensures(Contract.Result<String>() != null); 106Contract.Ensures(Contract.Result<String>() != null); 112Contract.Ensures(Contract.Result<String>() != null);
system\uint64.cs (8)
90Contract.Ensures(Contract.Result<String>() != null); 96Contract.Ensures(Contract.Result<String>() != null); 102Contract.Ensures(Contract.Result<String>() != null); 108Contract.Ensures(Contract.Result<String>() != null);
system\uintptr.cs (3)
79Contract.EndContractBlock(); 115Contract.Ensures(Contract.Result<String>() != null);
system\unityserializationholder.cs (1)
171Contract.EndContractBlock();
system\unsafecharbuffer.cs (3)
28Contract.Assert( buffer != null, "buffer pointer can't be null." ); 29Contract.Assert( bufferSize >= 0, "buffer size can't be negative." ); 50Contract.Assert(m_length <= m_totalSize, "Buffer has been overflowed!");
system\variant.cs (3)
327Contract.Assert(obj != null, "obj != null"); 333Contract.Assert(obj != null, "obj != null"); 358Contract.EndContractBlock();
system\version.cs (9)
54Contract.EndContractBlock(); 72Contract.EndContractBlock(); 85Contract.EndContractBlock(); 341Contract.Assert(num >= 0, "AppendPositiveNumber expect positive numbers"); 358Contract.EndContractBlock(); 453Contract.EndContractBlock(); 460Contract.EndContractBlock(); 520Contract.Assert(false, "Int32.Parse() did not throw exception but TryParse failed: " + m_exceptionArgument); 523Contract.Assert(false, "Unmatched case in Version.GetVersionParseException() for value: " + m_failure);
system\weakreference.cs (2)
59Contract.EndContractBlock(); 116Contract.EndContractBlock();
system\weakreferenceoft.cs (2)
52Contract.EndContractBlock(); 111Contract.EndContractBlock();
System (313)
compmod\system\collections\specialized\marshalinghelpers.cs (6)
160Contract.Assert(false, "This class is never instantiated"); 202Contract.Assert(false, "This class is never instantiated"); 246Contract.Assert(false, "This class is never instantiated"); 288Contract.Assert(false, "This class is never instantiated"); 337Contract.Assert(false, "This class is never instantiated"); 399Contract.Assert(false, "This class is never instantiated");
compmod\system\collections\specialized\notifycollectionchangedeventargs.cs (1)
315Contract.Assert(false, String.Format("Unsupported action: {0}", action.ToString()));
net\System\Net\_ChunkParser.cs (44)
100Contract.Requires(dataSource != null); 101Contract.Requires(internalBuffer != null); 102Contract.Requires(internalBuffer.Length >= chunkLengthBuffer, 104Contract.Requires((initialBufferCount >= 0) && (initialBufferCount <= internalBuffer.Length)); 105Contract.Requires((initialBufferOffset >= 0) && 160Contract.Requires(userBuffer != null); 161Contract.Requires((userBufferCount > 0) && (userBufferCount <= userBuffer.Length)); 162Contract.Requires((userBufferOffset >= 0) && (userBufferOffset + userBufferCount <= userBuffer.Length)); 170Contract.Assert(userAsyncResult == null, "Overlapped read operations are not allowed."); 171Contract.Assert((readState == ReadState.ChunkLength) || (readState == ReadState.PayloadEnd) || 192Contract.Assert(userAsyncResult == null, 210Contract.Assert(readState < ReadState.Done, "We're already done. No need to process state."); 239Contract.Assert(false, "Unknown state"); 271Contract.Assert(false, "Unknown state"); 305Contract.Assert(result is int); 358Contract.Assert(bufferCurrentPos <= bufferFillLength); 388Contract.Assert(currentPos == 0); 389Contract.Assert(bufferFillLength == buffer.Length); 462Contract.Assert(currentOperationBytesRead == 0, 487Contract.Assert(bufferCurrentPos == bufferFillLength, 489Contract.Assert(currentOperationBytesRead < userBufferCount); 518Contract.Requires(bytesRead >= 0); 519Contract.Assert(readState == ReadState.Payload, 530Contract.Assert(currentChunkBytesRead <= currentChunkLength, 547Contract.Assert(currentChunkLength == noChunkLength); 637Contract.Assert(currentChunkBytesRead == currentChunkLength); 680Contract.Assert(result != DataParseStatus.ContinueParsing, 703Contract.Ensures((Contract.Result<DataParseStatus>() != DataParseStatus.Done) || 704(Contract.Result<DataParseStatus>() != DataParseStatus.DataTooBig)); 724Contract.Ensures((Contract.Result<DataParseStatus>() == DataParseStatus.ContinueParsing) || 725(Contract.Result<DataParseStatus>() == DataParseStatus.NeedMoreData) || 726(Contract.Result<DataParseStatus>() != DataParseStatus.DataTooBig)); 755Contract.Ensures((Contract.Result<DataParseStatus>() != DataParseStatus.Done) || 756(Contract.Result<DataParseStatus>() != DataParseStatus.DataTooBig)); 787Contract.Assert(currentPos < bufferFillLength, 826Contract.Ensures((Contract.Result<DataParseStatus>() != DataParseStatus.Done) || 827(Contract.Result<DataParseStatus>() != DataParseStatus.DataTooBig)); 879Contract.Ensures((Contract.Result<DataParseStatus>() != DataParseStatus.Done) || 880(Contract.Result<DataParseStatus>() != DataParseStatus.DataTooBig));
net\System\Net\NetworkInformation\SystemNetworkInterface.cs (2)
77Contract.Ensures(Contract.Result<NetworkInterface[]>() != null);
net\System\Net\NetworkInformation\SystemUnicastIPAddressInformation.cs (3)
151Contract.Requires((0 <= prefixLength) && (prefixLength <= 126)); 152Contract.Requires((family == AddressFamily.InterNetwork) || (family == AddressFamily.InterNetworkV6)); 161Contract.Assert(prefixLength < (addressBytes.Length * 8));
net\System\Net\SocketAddress.cs (2)
178Contract.Assert(Size >= IPv6AddressSize); 193Contract.Assert(Size >= IPv4AddressSize);
net\System\Net\Sockets\Socket.cs (2)
8499Contract.EndContractBlock(); 8522Contract.EndContractBlock();
net\System\Net\WebRequest.cs (4)
694Contract.Ensures(Contract.Result<WebHeaderCollection>() != null); 820Contract.Ensures(Contract.Result<WebResponse>() != null);
net\System\Net\WebResponse.cs (4)
188Contract.Ensures(Contract.Result<Stream>() != null); 240Contract.Ensures(Contract.Result<WebHeaderCollection>() != null);
net\System\Net\WebSockets\ClientWebSocket.cs (3)
112Contract.Assert(false, "NotImplemented: " + state); 163Contract.Assert(response != null, "Not an HttpWebResponse"); 608Contract.Assert(!isReadOnly, "Already set");
net\System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
46Contract.Assert(requestUri != null, "requestUri shouldn't be null"); 47Contract.Assert(headers != null, "headers shouldn't be null"); 48Contract.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 49Contract.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 50Contract.Assert(webSocket != null, "webSocket shouldn't be null");
net\System\Net\WebSockets\InternalClientWebSocket.cs (3)
45Contract.Assert(m_SessionHandle != null, "'m_SessionHandle MUST NOT be NULL."); 54Contract.Assert(m_Properties != null, "'m_Properties' MUST NOT be NULL."); 57Contract.Assert(sessionHandle != null, "'sessionHandle MUST NOT be NULL.");
net\System\Net\WebSockets\ServerWebSocket.cs (3)
48Contract.Assert(m_SessionHandle != null, "'m_SessionHandle MUST NOT be NULL."); 57Contract.Assert(m_Properties != null, "'m_Properties' MUST NOT be NULL."); 62Contract.Assert(sessionHandle != null, "'sessionHandle MUST NOT be NULL.");
net\System\Net\WebSockets\WebSocketBase.cs (42)
75Contract.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL."); 146Contract.Assert(m_State != WebSocketState.None, "'m_State' MUST NOT be 'WebSocketState.None'."); 179Contract.Assert(m_InternalBuffer != null, "'m_InternalBuffer' MUST NOT be NULL."); 207Contract.Assert(buffer != null); 306Contract.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text, 308Contract.Assert(buffer != null); 691Contract.Assert(thisLockTakenSnapshot, "'thisLockTakenSnapshot' MUST be 'true' at this point."); 819Contract.Assert(m_CloseReceivedTaskCompletionSource != null, 964Contract.Assert(ownsSendCancellationSource, "'ownsSendCancellationSource' MUST be 'true' at this point."); 1060Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); 1074Contract.Assert(m_ThisLock != null, "'m_ThisLock' MUST NOT be NULL."); 1075Contract.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL."); 1083Contract.Assert(m_ThisLock != null, "'m_ThisLock' MUST NOT be NULL."); 1084Contract.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL."); 1169Contract.Assert(lockObject != null, "'lockObject' MUST NOT be NULL."); 1187Contract.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text, 1230Contract.Assert(false, 1280Contract.Assert(error != null, "'error' MUST NOT be NULL."); 1302Contract.Assert(exception != null, "'exception' MUST NOT be NULL."); 1472Contract.Assert(false, 1533Contract.Assert(sender != null, "'sender' MUST NOT be NULL."); 1534Contract.Assert((sender as WebSocketBase) != null, "'sender as WebSocketBase' MUST NOT be NULL."); 1616Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 1648Contract.Assert(BufferCount >= 1 && BufferCount <= 2, "'bufferCount' MUST ONLY BE '1' or '2'."); 1689Contract.Assert(ReceiveResult.Count == 0, "'receiveResult.Count' MUST be 0."); 1690Contract.Assert(ReceiveResult.CloseStatus != null, "'receiveResult.CloseStatus' MUST NOT be NULL for message type 'Close'."); 1852Contract.Assert(false, assertMessage); 1908Contract.Assert(buffer != null, "'buffer' MUST NOT be NULL."); 1922Contract.Assert(false, "'originalReceiveState' MUST NEVER be ReceiveState.Application at this point."); 1934Contract.Assert(false, 1969Contract.Assert(ReceiveResult != null, 1989Contract.Assert(buffer != null, "'buffer MUST NOT be NULL."); 2116Contract.Assert(!m_BufferHasBeenPinned, "'m_BufferHasBeenPinned' MUST NOT be pinned at this point."); 2133Contract.Assert(ReceiveResult == null, "'ReceiveResult' MUST be NULL."); 2157Contract.Assert(buffer == null, "'buffer' MUST BE NULL."); 2170Contract.Assert(blob.Length <= WebSocketHelpers.MaxControlFramePayloadLength, 2265Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 2266Contract.Assert(webSocket.m_KeepAliveTracker != null, 2269Contract.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE."); 2363Contract.Assert(operationsOutstanding >= 1, "'operationsOutstanding' must never be smaller than 1."); 2381Contract.Assert(m_OperationsOutstanding >= 0, "'m_OperationsOutstanding' must never be smaller than 0."); 2411Contract.Assert(m_CancellationTokenSource == null, "'m_CancellationTokenSource' MUST be NULL.");
net\System\Net\WebSockets\WebSocketBuffer.cs (46)
60Contract.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL."); 61Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 63Contract.Assert(sendBufferSize >= MinSendBufferSize, 65Contract.Assert(receiveBufferSize <= MaxBufferSize, 67Contract.Assert(sendBufferSize <= MaxBufferSize, 105Contract.Assert(internalBuffer.Count >= GetInternalBufferSize(receiveBufferSize, sendBufferSize, false), 114Contract.Assert(internalBuffer.Count >= GetInternalBufferSize(receiveBufferSize, sendBufferSize, true), 203Contract.Assert(false, "'m_SendBufferState' MUST BE 'None' at this point."); 232Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.Array, 250Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_PinnedSendBuffer.Array, 326Contract.Assert(m_PayloadOffset == 0, 328Contract.Assert(m_BufferedPayloadReceiveResult == null || m_BufferedPayloadReceiveResult.Count == 0, 397Contract.Assert(false, "'buffer' MUST reference a memory segment within the pinned InternalBuffer."); 430Contract.Assert(false, "'buffer' MUST reference a memory segment within the pinned InternalBuffer."); 448Contract.Assert(dataBufferCount <= (uint)int.MaxValue, 450Contract.Assert(dataBuffers != null, "'dataBuffers' MUST NOT be NULL."); 455Contract.Assert(false, "'dataBufferCount' MUST NOT be bigger than 'dataBuffers.Length'."); 492Contract.Assert(false, 502Contract.Assert(false, 515Contract.Assert(false, "At least one 'dataBuffer.Buffer' MUST NOT be NULL."); 549Contract.Assert(false, 575Contract.Assert(m_BufferedPayloadReceiveResult != null, 577Contract.Assert(m_BufferedPayloadReceiveResult.Count >= 0, 579Contract.Assert(m_PayloadOffset >= 0, "'m_PayloadOffset' MUST NOT be smaller than 0."); 580Contract.Assert(m_PayloadOffset <= m_PayloadBuffer.Count, 582Contract.Assert(m_PayloadOffset + m_BufferedPayloadReceiveResult.Count <= m_PayloadBuffer.Count, 588Contract.Assert(pBuffer != IntPtr.Zero, "'pBuffer' MUST NOT be IntPtr.Zero."); 591Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 605Contract.Assert(buffer != null, "'buffer' MUST NOT be NULL."); 606Contract.Assert(m_NativeBuffer.Array != null, "'m_NativeBuffer.Array' MUST NOT be NULL."); 607Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 608Contract.Assert(count >= 0, "'count' MUST NOT be negative."); 609Contract.Assert(offset + count <= buffer.Length, "'offset + count' MUST NOT exceed 'buffer.Length'."); 618Contract.Assert(offset >= 0, "'offset' MUST NOT be negative."); 619Contract.Assert(m_StartAddress + offset - m_InternalBuffer.Offset <= m_EndAddress, "'offset' is TOO BIG."); 626Contract.Assert(pBuffer != IntPtr.Zero, "'pBuffer' MUST NOT be NULL."); 627Contract.Assert(bufferSize <= GetMaxBufferSize(), 633Contract.Assert(Marshal.UnsafeAddrOfPinnedArrayElement(m_InternalBuffer.Array, m_InternalBuffer.Offset).ToInt64() == m_StartAddress, 659Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 661Contract.Assert(sendBufferSize >= MinSendBufferSize, 670Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 672Contract.Assert(sendBufferSize >= MinSendBufferSize, 685Contract.Assert(receiveBufferSize >= MinReceiveBufferSize, 687Contract.Assert(sendBufferSize >= MinSendBufferSize, 690Contract.Assert(receiveBufferSize <= MaxBufferSize, 692Contract.Assert(sendBufferSize <= MaxBufferSize,
net\System\Net\WebSockets\WebSocketConnectionStream.cs (31)
35Contract.Assert(connectStream != null, 37Contract.Assert(connectStream.Connection != null, 39Contract.Assert(connectStream.Connection.NetworkStream != null, 41Contract.Assert(!string.IsNullOrEmpty(connectionGroupName), 129Contract.Assert(false, "'bytesRead' MUST be '0' at this point. Instead more payload was received ('" + buffer[0].ToString() + "')"); 183Contract.Assert(this.m_ConnectStream.Connection.ServicePoint != null, "connection.ServicePoint should not be null."); 291Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 292Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 315Contract.Assert(this.SupportsMultipleWrite, "This method MUST NOT be used for custom NetworkStream implementations."); 371Contract.Assert(state != null, "'state' MUST NOT be NULL."); 373Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 487Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 488Contract.Assert(connection.NetworkStream != null, "'connection.NetworkStream' MUST NOT be NULL."); 585Contract.Assert(m_InnerStream.NetworkStream != null, "'m_InnerStream.NetworkStream' MUST NOT be NULL."); 599Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 600Contract.Assert(asyncState != null, "'asyncState' MUST NOT be NULL."); 602Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 618Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL."); 619Contract.Assert(asyncResult.AsyncState != null, "'asyncResult.AsyncState' MUST NOT be NULL."); 621Contract.Assert(connection != null, "'connection' MUST NOT be NULL."); 630Contract.Assert(this.SupportsMultipleWrite, "This method MUST NOT be used for custom NetworkStream implementations."); 768Contract.Assert(m_ReadEventArgs != null, "'m_ReadEventArgs' MUST NOT be NULL."); 832Contract.Assert(state != null, "'state' MUST NOT be NULL."); 834Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 868Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 869Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 882Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 891Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 893Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 923Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 925Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL.");
net\System\Net\WebSockets\WebSocketHelpers.cs (2)
145Contract.Assert(responseStream != null, "'responseStream' MUST be castable to System.Net.HttpResponseStream."); 542Contract.Requires(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
net\System\Net\WebSockets\WebSocketHttpListenerDuplexStream.cs (37)
55Contract.Assert(inputStream != null, "'inputStream' MUST NOT be NULL."); 56Contract.Assert(outputStream != null, "'outputStream' MUST NOT be NULL."); 57Contract.Assert(context != null, "'context' MUST NOT be NULL."); 58Contract.Assert(inputStream.CanRead, "'inputStream' MUST support read operations."); 59Contract.Assert(outputStream.CanWrite, "'outputStream' MUST support write operations."); 223Contract.Assert(eventArgs.Buffer != null, "'BufferList' is not supported for read operations."); 244Contract.Assert(!m_InputStream.BufferedDataChunksAvailable, "'m_InputStream.BufferedDataChunksAvailable' MUST BE 'FALSE' at this point."); 245Contract.Assert(dataRead <= eventArgs.Count, "'dataRead' MUST NOT be bigger than 'eventArgs.Count'."); 345Contract.Assert(m_InOpaqueMode, "The stream MUST be in opaque mode at this point."); 346Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 347Contract.Assert(sendBuffers.Count == 1 || sendBuffers.Count == 2, 361Contract.Assert(sendBuffers != null, "'sendBuffers' MUST NOT be NULL."); 362Contract.Assert(sendBuffers.Count == 2, "'sendBuffers.Count' MUST be '2' at this point."); 715Contract.Assert(state != null, "'state' MUST NOT be NULL."); 717Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 753Contract.Assert(webSocket != null, "'webSocket' MUST NOT be NULL."); 754Contract.Assert(m_OutputStream != null, "'m_OutputStream' MUST NOT be NULL."); 755Contract.Assert(m_OutputStream.InternalHttpContext != null, 757Contract.Assert(m_OutputStream.InternalHttpContext.Response != null, 759Contract.Assert(m_OutputStream.InternalHttpContext.Response.SentHeaders, 761Contract.Assert(!m_InOpaqueMode, "SwitchToOpaqueMode MUST NOT be called multiple times."); 783Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 785Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 813Contract.Assert(eventArgs != null, "'eventArgs' MUST NOT be NULL."); 815Contract.Assert(thisPtr != null, "'thisPtr' MUST NOT be NULL."); 902Contract.Assert(!m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'false' at this point."); 903Contract.Assert(value == null || m_Buffer == null, 905Contract.Assert(m_Operating == Free, 907Contract.Assert(value == null || value.Count == 2, 1071Contract.Assert(false, "Only one outstanding async operation is allowed per HttpListenerAsyncEventArgs instance."); 1110Contract.Assert(!m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'false' at this point."); 1111Contract.Assert(buffer == null || m_BufferList == null, "Either 'm_Buffer' or 'm_BufferList' MUST be NULL."); 1129Contract.Assert(m_Buffer == null || m_BufferList == null, "Either 'm_Buffer' or 'm_BufferList' MUST be NULL."); 1130Contract.Assert(m_ShouldCloseOutput || m_Buffer != null || m_BufferList != null, "Either 'm_Buffer' or 'm_BufferList' MUST NOT be NULL."); 1141Contract.Assert(m_BufferList != null && m_BufferList.Count == 2, 1149Contract.Assert(m_ShouldCloseOutput, "'m_ShouldCloseOutput' MUST be 'true' at this point."); 1237Contract.Assert(m_CompletedOperation == HttpListenerAsyncOperation.Send,
net\System\Net\WebSockets\WebSocketProtocolComponent.cs (35)
404Contract.Assert(version != null, "'version' MUST NOT be NULL."); 474Contract.Assert(key != null, "'key' MUST NOT be NULL."); 511Contract.Assert(webSocketHandle != null, "'webSocketHandle' MUST NOT be NULL at this point."); 519Contract.Assert(propertyCount >= 0, "'propertyCount' MUST NOT be negative."); 520Contract.Assert((properties == null && propertyCount == 0) || 566Contract.Assert(webSocketHandle != null, "'webSocketHandle' MUST NOT be NULL at this point."); 572Contract.Assert(webSocketHandle != null && !webSocketHandle.IsInvalid, 585Contract.Assert(webSocketPtr != IntPtr.Zero, "'webSocketPtr' MUST NOT be IntPtr.Zero."); 594Contract.Assert(webSocket != null, 596Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 618Contract.Assert(webSocket != null, 620Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 641Contract.Assert(webSocket != null, 643Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 670Contract.Assert(webSocket != null, 672Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 674Contract.Assert(dataBufferCount >= 0, "'dataBufferCount' MUST NOT be negative."); 675Contract.Assert((dataBuffers == null && dataBufferCount == 0) || 706Contract.Assert(dataBufferCount >= 0); 707Contract.Assert((dataBufferCount == 0 && dataBuffers == null) || 716Contract.Assert(webSocket != null, 718Contract.Assert(webSocket.SessionHandle != null && !webSocket.SessionHandle.IsInvalid, 720Contract.Assert(actionContext != IntPtr.Zero, "'actionContext' MUST NOT be IntPtr.Zero."); 721Contract.Assert(bytesTransferred >= 0, "'bytesTransferred' MUST NOT be negative."); 745Contract.Assert(errorCode == 0, "errorCode: " + errorCode); 753Contract.Assert(webSocketHandle != null && !webSocketHandle.IsInvalid, 776Contract.Assert(errorCode == 0, "'errorCode' MUST be 0."); 792Contract.Assert(httpHeaderPtr != IntPtr.Zero, "'currentHttpHeaderPtr' MUST NOT be IntPtr.Zero."); 797Contract.Assert(length >= 0, "'length' MUST NOT be negative."); 807Contract.Assert(false, "The length of 'httpHeader.Name' MUST MATCH 'length'."); 830Contract.Assert(false, "The length of 'httpHeader.Value' MUST MATCH 'length'."); 838Contract.Assert(nativeHeaderCount >= 0, "'nativeHeaderCount' MUST NOT be negative."); 839Contract.Assert(nativeHeadersPtr != IntPtr.Zero || nativeHeaderCount == 0, 860Contract.Assert(httpHeaders != null); 861Contract.Assert(httpHeaders.Length == nativeHeaderCount);
net\System\Net\WebSockets\WebSocketReceiveResult.cs (2)
43Contract.Assert(count >= 0, "'count' MUST NOT be negative."); 44Contract.Assert(count <= this.Count, "'count' MUST NOT be bigger than 'this.Count'.");
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (4)
470Contract.Assert(null != ZLibStreamHandle.zlibLibraryHandle); 471Contract.Assert(!ZLibStreamHandle.zlibLibraryHandle.IsInvalid); 645Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in DeflateInit2_ should always succeed, but it did not."); 702Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in InflateInit2_ should always succeed, but it did not.");
security\system\security\permissions\typedescriptorpermission.cs (1)
174Contract.EndContractBlock();
services\monitoring\system\diagnosticts\ProcessManager.cs (2)
569Contract.Ensures(Contract.Result<ModuleInfo[]>().Length >= 1);
sys\system\collections\concurrent\ConcurrentBag.cs (7)
345Contract.Assert(Monitor.IsEntered(GlobalListsLock)); 747Contract.Assert(m_locals != null); 764Contract.Assert(!Monitor.IsEntered(GlobalListsLock)); 798Contract.Assert(Monitor.IsEntered(GlobalListsLock)); 844Contract.Assert(Monitor.IsEntered(GlobalListsLock)); 867Contract.Assert(Monitor.IsEntered(GlobalListsLock)); 889Contract.Assert(Monitor.IsEntered(GlobalListsLock));
sys\System\IO\compression\DeflaterZLib.cs (14)
136Contract.Assert(NeedsInput(), "We have something left in previous input!"); 137Contract.Assert(null != inputBuffer); 138Contract.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 139Contract.Assert(!_inputBufferHandle.IsAllocated); 157Contract.Ensures(Contract.Result<int>() >= 0 && Contract.Result<int>() <= outputBuffer.Length); 159Contract.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 160Contract.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 161Contract.Assert(_inputBufferHandle.IsAllocated); 194Contract.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 195Contract.Assert(NeedsInput(), "We have something left in previous input!"); 196Contract.Assert(!_inputBufferHandle.IsAllocated); 213Contract.Assert(_inputBufferHandle.IsAllocated);
sys\System\IO\compression\DeflateStream.cs (1)
127Contract.EndContractBlock();
sys\system\io\ports\SerialStream.cs (1)
821Contract.Assert(false, String.Format("Unexpected error code from EscapeCommFunction in SerialPort.Dispose(bool) Error code: 0x{0:x}", (uint)hr));
sys\system\runtime\versioning\FrameworkName.cs (6)
32Contract.Assert(m_identifier != null); 39Contract.Assert(m_version != null); 46Contract.Assert(m_profile != null); 67Contract.Assert(m_fullName != null); 117Contract.EndContractBlock(); 135Contract.EndContractBlock();
System.AddIn (184)
System\Addin\AddInAttribute.cs (1)
41System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Hosting\ActivationWorker.cs (8)
36System.Diagnostics.Contracts.Contract.Requires(pipeline != null); 37System.Diagnostics.Contracts.Contract.Requires(pipeline.PipelineRootDirectory != null); 132System.Diagnostics.Contracts.Contract.Assert(addIn != null, "CreateInstance didn't create the add-in"); 177System.Diagnostics.Contracts.Contract.Ensures(System.Diagnostics.Contracts.Contract.Result<System.AddIn.Contract.IContract>() != null); 188System.Diagnostics.Contracts.Contract.Assert(addInAdapter != null, "CreateInstance didn't create the add-in adapter"); 202System.Diagnostics.Contracts.Contract.Assert(_pipeline != null); 243System.Diagnostics.Contracts.Contract.Assert(false);
System\Addin\Hosting\AddInActivator.cs (13)
44System.Diagnostics.Contracts.Contract.EndContractBlock(); 59System.Diagnostics.Contracts.Contract.EndContractBlock(); 74System.Diagnostics.Contracts.Contract.EndContractBlock(); 185System.Diagnostics.Contracts.Contract.EndContractBlock(); 198System.Diagnostics.Contracts.Contract.EndContractBlock(); 219System.Diagnostics.Contracts.Contract.EndContractBlock(); 252System.Diagnostics.Contracts.Contract.EndContractBlock(); 330System.Diagnostics.Contracts.Contract.Assert(addIn != null, "Bypass couldn't create the add-in"); 383System.Diagnostics.Contracts.Contract.EndContractBlock(); 519System.Diagnostics.Contracts.Contract.EndContractBlock(); 629System.Diagnostics.Contracts.Contract.Assert(false, "Did the AddIn Model upgrade the contract to the default loader context using an assembly resolve event? Either that, or your HAV's constructor threw an ArgumentException"); 648System.Diagnostics.Contracts.Contract.Assert(_contract != null); 689System.Diagnostics.Contracts.Contract.Requires(assembly != null);
System\Addin\Hosting\AddInController.cs (1)
49System.Diagnostics.Contracts.Contract.Requires(impl != null);
System\Addin\Hosting\AddInControllerImpl.cs (6)
63System.Diagnostics.Contracts.Contract.Requires(environment != null); 64System.Diagnostics.Contracts.Contract.Requires(token != null); 78System.Diagnostics.Contracts.Contract.EndContractBlock(); 105System.Diagnostics.Contracts.Contract.Requires(addIn != null); 156System.Diagnostics.Contracts.Contract.Requires(hostAddinView != null); 181System.Diagnostics.Contracts.Contract.Requires(value != null);
System\Addin\Hosting\AddInEnvironment.cs (2)
37System.Diagnostics.Contracts.Contract.EndContractBlock(); 53System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Hosting\AddInStore.cs (14)
77System.Diagnostics.Contracts.Contract.EndContractBlock(); 136System.Diagnostics.Contracts.Contract.EndContractBlock(); 154System.Diagnostics.Contracts.Contract.EndContractBlock(); 191System.Diagnostics.Contracts.Contract.EndContractBlock(); 301System.Diagnostics.Contracts.Contract.EndContractBlock(); 364System.Diagnostics.Contracts.Contract.EndContractBlock(); 379System.Diagnostics.Contracts.Contract.EndContractBlock(); 446System.Diagnostics.Contracts.Contract.EndContractBlock(); 458System.Diagnostics.Contracts.Contract.EndContractBlock(); 482System.Diagnostics.Contracts.Contract.EndContractBlock(); 586System.Diagnostics.Contracts.Contract.EndContractBlock(); 665System.Diagnostics.Contracts.Contract.EndContractBlock(); 1033System.Diagnostics.Contracts.Contract.Assert(serializedData.Length <= Int32.MaxValue); 1182System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch in Discover!");
System\Addin\Hosting\AddInToken.cs (11)
129System.Diagnostics.Contracts.Contract.Requires(hostAdapter != null); 130System.Diagnostics.Contracts.Contract.Requires(contract != null); 131System.Diagnostics.Contracts.Contract.Requires(addinAdapter != null); 132System.Diagnostics.Contracts.Contract.Requires(addinBase != null); 133System.Diagnostics.Contracts.Contract.Requires(addin != null); 154System.Diagnostics.Contracts.Contract.Requires(value != null); 155System.Diagnostics.Contracts.Contract.Assert(AddInStore.Contains(_hostAddinViews, value)); 166System.Diagnostics.Contracts.Contract.Requires(value != null); 178System.Diagnostics.Contracts.Contract.Requires(value != null); 292System.Diagnostics.Contracts.Contract.EndContractBlock(); 349System.Diagnostics.Contracts.Contract.Requires(rootDir != null || PipelineRootDirectory != null);
System\Addin\Hosting\InspectionWorker.cs (4)
124System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch in the inspection assembly resolve event!"); 194System.Diagnostics.Contracts.Contract.Requires(assemblyFileName != null); 195System.Diagnostics.Contracts.Contract.Requires(pipelineRootDirectory != null); 298System.Diagnostics.Contracts.Contract.Assert(false, "Fell through switch - unrecognized componentType in InspectionWorker.Inspect");
System\Addin\Hosting\PartialToken.cs (5)
37System.Diagnostics.Contracts.Contract.Requires(hostAdapter != null); 38System.Diagnostics.Contracts.Contract.Requires(contract != null); 39System.Diagnostics.Contracts.Contract.Requires(addinAdapter != null); 40System.Diagnostics.Contracts.Contract.Requires(addinBase != null); 55System.Diagnostics.Contracts.Contract.Requires(value != null);
System\Addin\Hosting\ReadOnlyDictionary.cs (1)
29System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Hosting\RemotingHelper.cs (1)
65System.Diagnostics.Contracts.Contract.Requires(guid != null && guid != s_emptyGuid);
System\Addin\Hosting\Store\AddIn.cs (1)
52System.Diagnostics.Contracts.Contract.Requires(Path.IsPathRooted(fullPathToAddin));
System\Addin\Hosting\Store\AddInAdapter.cs (2)
52System.Diagnostics.Contracts.Contract.Assert(type.Assembly.ReflectionOnly && IContractInReflectionLoaderContext.Assembly.ReflectionOnly, 104System.Diagnostics.Contracts.Contract.Requires(addInBase != null);
System\Addin\Hosting\Store\PipelineComponent.cs (17)
71System.Diagnostics.Contracts.Contract.EndContractBlock(); 128System.Diagnostics.Contracts.Contract.Assert(s_IContractInReflectionLoaderContext != null); 135System.Diagnostics.Contracts.Contract.Assert(s_ContractAttrInReflectionLoaderContext != null); 142System.Diagnostics.Contracts.Contract.Assert(s_AddInAdapterAttrInReflectionLoaderContext != null); 149System.Diagnostics.Contracts.Contract.Assert(s_AddInBaseAttrInReflectionLoaderContext != null); 156System.Diagnostics.Contracts.Contract.Assert(s_AddInAttrInReflectionLoaderContext != null); 164System.Diagnostics.Contracts.Contract.Requires(systemAddInInReflLoaderContext != null); 165System.Diagnostics.Contracts.Contract.Requires(systemAddInInReflLoaderContext.ReflectionOnly); 166System.Diagnostics.Contracts.Contract.Requires(systemAddInContractsInReflLoaderContext != null); 167System.Diagnostics.Contracts.Contract.Requires(systemAddInContractsInReflLoaderContext.ReflectionOnly); 179System.Diagnostics.Contracts.Contract.Requires(Path.IsPathRooted(root)); 183System.Diagnostics.Contracts.Contract.Assert(!Path.IsPathRooted(_relativeLocation)); 192System.Diagnostics.Contracts.Contract.Assert(_haveSetRootDirectory, "You must set this component's root directory before getting an absolute path. Either call SetRootDirectory or use RelativeLocation instead."); 205System.Diagnostics.Contracts.Contract.Ensures(System.Diagnostics.Contracts.Contract.Result<String>() != null); 214System.Diagnostics.Contracts.Contract.Ensures(System.Diagnostics.Contracts.Contract.Result<String>() != null);
System\Addin\Hosting\Utils.cs (15)
52System.Diagnostics.Contracts.Contract.Requires(typeof(Attribute).IsAssignableFrom(attributeType)); 149System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(path)); 150System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(root)); 153System.Diagnostics.Contracts.Contract.Requires(String.Equals(path, Path.GetFullPath(path))); 154System.Diagnostics.Contracts.Contract.Requires(String.Equals(root, Path.GetFullPath(root))); 155System.Diagnostics.Contracts.Contract.Ensures(!Path.IsPathRooted(System.Diagnostics.Contracts.Contract.Result<String>())); 156System.Diagnostics.Contracts.Contract.EndContractBlock(); 173System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(assemblyRef)); 174System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(assemblyDef)); 183System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(assemblyDef1)); 184System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(assemblyDef2)); 193System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(typeAndAssemblyName1)); 194System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(typeAndAssemblyName2)); 205System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(assemblyRef));
System\Addin\MiniReflection\MetadataReader\Metadata.cs (1)
18System.Diagnostics.Contracts.Contract.Requires((index & 0xFF000000U) == 0);
System\Addin\MiniReflection\MiniAssembly.cs (13)
51System.Diagnostics.Contracts.Contract.Requires(assembly != null); 83System.Diagnostics.Contracts.Contract.Assert(attrs == MDFileAttributes.ContainsMetaData); 98System.Diagnostics.Contracts.Contract.Assert(!IsReflectionAssembly); // Can be implemented using Assembly.GetType 105System.Diagnostics.Contracts.Contract.Requires(typeName != null); 130System.Diagnostics.Contracts.Contract.EndContractBlock(); 143System.Diagnostics.Contracts.Contract.Requires(token.Table == MDTables.Tables.AssemblyRef); 195System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(simpleName)); 196System.Diagnostics.Contracts.Contract.Requires(searchDirs != null); 254System.Diagnostics.Contracts.Contract.Requires(assemblyA != null); 255System.Diagnostics.Contracts.Contract.Requires(peFileB != null); 256System.Diagnostics.Contracts.Contract.Requires(assemblyRefB.Table == MDTables.Tables.AssemblyRef); 276System.Diagnostics.Contracts.Contract.Requires(peFile != null); 277System.Diagnostics.Contracts.Contract.Requires(assemblyRef.Table == MDTables.Tables.AssemblyRef);
System\Addin\MiniReflection\MiniConstructorInfo.cs (1)
29System.Diagnostics.Contracts.Contract.Requires(parameters != null);
System\Addin\MiniReflection\MiniModule.cs (8)
36System.Diagnostics.Contracts.Contract.Requires(peFileName != null); 71System.Diagnostics.Contracts.Contract.Ensures(System.Diagnostics.Contracts.Contract.Result<MiniAssembly>() != null); 72System.Diagnostics.Contracts.Contract.Assert(_assembly != null); 76System.Diagnostics.Contracts.Contract.Requires(value != null); 89System.Diagnostics.Contracts.Contract.EndContractBlock(); 123System.Diagnostics.Contracts.Contract.EndContractBlock(); 153System.Diagnostics.Contracts.Contract.Assert(caType.Table == MDTables.Tables.MethodDef);
System\Addin\MiniReflection\MiniParameterInfo.cs (4)
30System.Diagnostics.Contracts.Contract.Requires(elementType <= CorElementType.String || 39System.Diagnostics.Contracts.Contract.Requires(parameterType != null); 40System.Diagnostics.Contracts.Contract.Requires(IsValid(elementType)); 116System.Diagnostics.Contracts.Contract.Assert(false, "Unrecognized CorElementType.");
System\Addin\MiniReflection\TypeInfo.cs (42)
78System.Diagnostics.Contracts.Contract.Requires(assembly != null); 79System.Diagnostics.Contracts.Contract.Requires(typeDef.Table == MDTables.Tables.TypeDef); 96System.Diagnostics.Contracts.Contract.Requires(assembly != null); 97System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(typeName)); 98System.Diagnostics.Contracts.Contract.Requires(typeDef.Table == MDTables.Tables.TypeDef); 110System.Diagnostics.Contracts.Contract.Requires(assembly != null); 111System.Diagnostics.Contracts.Contract.Requires(module != null); 112System.Diagnostics.Contracts.Contract.Requires(!String.IsNullOrEmpty(typeName)); 113System.Diagnostics.Contracts.Contract.Requires(typeDef.Table == MDTables.Tables.TypeDef); 136System.Diagnostics.Contracts.Contract.Requires(referencingAssembly != null); 137System.Diagnostics.Contracts.Contract.Requires(typeRefToken.Table == MDTables.Tables.TypeRef); 188System.Diagnostics.Contracts.Contract.Requires(type != null); 200System.Diagnostics.Contracts.Contract.Assert(_assembly == null); // Don't do this, or we might serialize assemblies! 212System.Diagnostics.Contracts.Contract.Assert((_representation & Representation.ReflectionType) == 0); 237System.Diagnostics.Contracts.Contract.Assert(HasReflectionType); 267System.Diagnostics.Contracts.Contract.Ensures(System.Diagnostics.Contracts.Contract.Result<MiniAssembly>() != null); 274System.Diagnostics.Contracts.Contract.Assert(HasReflectionType); 316System.Diagnostics.Contracts.Contract.Assert(HasToken); 357System.Diagnostics.Contracts.Contract.Assert(HasName); 364System.Diagnostics.Contracts.Contract.Assert(HasName); 373System.Diagnostics.Contracts.Contract.Assert(HasName); 377System.Diagnostics.Contracts.Contract.Assert(!HasTypeRef); 391System.Diagnostics.Contracts.Contract.Assert(_assembly != null || HasAssemblyQualifiedName); 400System.Diagnostics.Contracts.Contract.Assert(_assembly != null); 418System.Diagnostics.Contracts.Contract.Assert(HasToken); 419System.Diagnostics.Contracts.Contract.Assert(!HasTypeRef); 465System.Diagnostics.Contracts.Contract.Assert(HasToken/* || HasReflectionType*/, "GetConstructors needs a token (or you should uncomment the support for Reflection types)"); 480System.Diagnostics.Contracts.Contract.Assert(_mdToken.Table == MDTables.Tables.TypeDef); 661System.Diagnostics.Contracts.Contract.Assert(false, "Unrecognized CorElementType"); 724System.Diagnostics.Contracts.Contract.Requires(ifaceType != null); 725System.Diagnostics.Contracts.Contract.Assert(HasToken || HasReflectionType || HasTypeRef); 729System.Diagnostics.Contracts.Contract.Assert(ifaceType.HasAssemblyQualifiedName); 752System.Diagnostics.Contracts.Contract.Assert(_mdToken.Table == MDTables.Tables.TypeDef); 760System.Diagnostics.Contracts.Contract.Requires(typeDefToken.Table == MDTables.Tables.TypeDef); 817System.Diagnostics.Contracts.Contract.Assert(false, "Checking whether a type implements a TypeSpec is NYI (generic interface?)"); 821System.Diagnostics.Contracts.Contract.Assert(false, "Support for this interface type is NYI"); 837System.Diagnostics.Contracts.Contract.Requires(typeRef.Table == MDTables.Tables.TypeRef); 846System.Diagnostics.Contracts.Contract.Assert(resolutionScope.Table == MDTables.Tables.AssemblyRef); 884System.Diagnostics.Contracts.Contract.Assert(_mdToken.Table == MDTables.Tables.TypeDef); 933System.Diagnostics.Contracts.Contract.Assert(HasName); 976System.Diagnostics.Contracts.Contract.Assert(caType.Table == MDTables.Tables.MethodDef);
System\Addin\Pipeline\ContractAdapter.cs (3)
32System.Diagnostics.Contracts.Contract.EndContractBlock(); 48System.Diagnostics.Contracts.Contract.EndContractBlock(); 73System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Pipeline\ContractBase.cs (2)
65System.Diagnostics.Contracts.Contract.EndContractBlock(); 250System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Pipeline\ContractHandle.cs (3)
38System.Diagnostics.Contracts.Contract.EndContractBlock(); 92System.Diagnostics.Contracts.Contract.EndContractBlock(); 101System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Pipeline\ContractListAdapter.cs (3)
36System.Diagnostics.Contracts.Contract.EndContractBlock(); 78System.Diagnostics.Contracts.Contract.EndContractBlock(); 161System.Diagnostics.Contracts.Contract.EndContractBlock();
System\Addin\Pipeline\ListContractAdapter.cs (2)
35System.Diagnostics.Contracts.Contract.EndContractBlock(); 114System.Diagnostics.Contracts.Contract.EndContractBlock();
System.Core (1201)
Microsoft\Win32\SafeHandles\BCryptSafeHandles.cs (1)
54Contract.Requires(value != IntPtr.Zero);
Microsoft\Win32\SafeHandles\CapiSafeHandles.cs (6)
292Contract.Requires(!IsInvalid && !IsClosed); 293Contract.Ensures(Contract.Result<SafeCapiKeyHandle>() != null && !Contract.Result<SafeCapiKeyHandle>().IsInvalid && !Contract.Result<SafeCapiKeyHandle>().IsClosed); 371Contract.Requires(!IsInvalid && !IsClosed);
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (29)
119Contract.Requires((m_ownershipState == OwnershipState.Duplicate && m_holder != null) || 121Contract.Requires(m_holder == null || m_holder.m_ownershipState == OwnershipState.Holder); 128Contract.Ensures(m_holder.m_ownershipState == OwnershipState.Holder); 129Contract.Ensures(m_ownershipState == OwnershipState.Duplicate); 134Contract.Assert(m_ownershipState != OwnershipState.Duplicate); 135Contract.Assert(value.m_ownershipState == OwnershipState.Holder); 220Contract.Ensures(Contract.Result<T>() != null); 221Contract.Ensures(m_ownershipState == OwnershipState.Duplicate); 222Contract.Ensures(Contract.Result<T>().m_ownershipState == OwnershipState.Duplicate); 230Contract.Assert(m_ownershipState != OwnershipState.Holder); 231Contract.Assert(typeof(T) == this.GetType()); 249Contract.Ensures(m_ownershipState == OwnershipState.Duplicate); 250Contract.Ensures(Contract.Result<T>() != null && 251Contract.Result<T>().m_ownershipState == OwnershipState.Duplicate); 258Contract.Assert(m_ownershipState == OwnershipState.Duplicate); 259Contract.Assert(typeof(T) == this.GetType()); 285Contract.Ensures(m_ownershipState == OwnershipState.Duplicate); 286Contract.Ensures(Contract.Result<T>() != null && 287Contract.Result<T>().m_ownershipState == OwnershipState.Duplicate); 294Contract.Assert(m_ownershipState == OwnershipState.Owner); 295Contract.Assert(typeof(T) == this.GetType()); 418Contract.Requires(newHandleValue != IntPtr.Zero); 419Contract.Requires(!IsClosed); 420Contract.Ensures(!IsInvalid); 421Contract.Assert(handle == IntPtr.Zero);
System\Collections\Generic\HashSet.cs (16)
134Contract.EndContractBlock(); 214Contract.EndContractBlock(); 475Contract.EndContractBlock(); 500Contract.EndContractBlock(); 536Contract.EndContractBlock(); 563Contract.EndContractBlock(); 609Contract.EndContractBlock(); 654Contract.EndContractBlock(); 696Contract.EndContractBlock(); 742Contract.EndContractBlock(); 781Contract.EndContractBlock(); 805Contract.EndContractBlock(); 839Contract.EndContractBlock(); 876Contract.EndContractBlock(); 1011Contract.Assert(HashHelpers.IsPrime(newSize), "New size is not prime!"); 1013Contract.Assert(m_buckets != null, "SetCapacity called on a set with no elements");
System\IO\Pipes\IOCancellationHelper.cs (4)
32Contract.Assert(handle != null, "Handle cannot be null"); 33Contract.Assert(!handle.IsInvalid, "Handle cannot be invalid"); 34Contract.Assert(overlapped != null, "Overlapped cannot be null"); 35Contract.Assert(this._handle == null && this._overlapped == null, "Cancellation is already allowed.");
System\Linq\Parallel\Channels\AsynchronousChannel.cs (17)
118Contract.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Contract.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 291Contract.Assert(chunk != null); 292Contract.Assert(!m_done, "can't continue producing after the production is over"); 296Contract.Assert(!IsFull, "expected a non-full buffer"); 386Contract.Assert(1 <= m_producerChunkIndex && m_producerChunkIndex <= m_chunkSize); 413Contract.Assert(m_consumerChunk == null); 421Contract.Assert(m_consumerChunk != null, "consumer chunk is null"); 422Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds"); 491Contract.Assert(m_consumerChunk == null); 499Contract.Assert(m_consumerChunk != null, "consumer chunk is null"); 500Contract.Assert(0 <= m_consumerChunkIndex && m_consumerChunkIndex < m_consumerChunk.Length, "chunk index out of bounds"); 592Contract.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 611Contract.Assert(!IsChunkBufferEmpty); 669Contract.Assert(m_done, "Expected channel to be done before disposing"); 670Contract.Assert(m_producerEvent != null); 671Contract.Assert(m_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (4)
71Contract.Assert(m_queue != null); 93Contract.Assert(m_queue != null); 119Contract.Assert(array != null); 134Contract.Assert(m_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (4)
29Contract.Assert(source != null); 30Contract.Assert(sign == -1 || sign == 1); 105Contract.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 122Contract.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs (2)
36Contract.Assert(wrappedEnumerable != null); 65Contract.Assert(wrappedEnumerator != null);
System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs (1)
33Contract.Assert(sortOp is IOrderedEnumerable<TSource>);
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (3)
36Contract.Assert(source != null); 75Contract.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null."); 95Contract.Assert(m_wrappedEnumerable != null);
System\Linq\Parallel\Enumerables\ParallelQuery.cs (4)
54Contract.Assert(false, "The derived class must override this method."); 66Contract.Assert(false, "The derived class must override this method."); 78Contract.Assert(false, "The derived class must override this method."); 127Contract.Assert(false, "The derived class must override this method.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
37Contract.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (5)
51Contract.Assert(channels != null); 156Contract.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 168Contract.Assert(m_channels[currChannelIndex].IsDone, "thought this channel was done"); 169Contract.Assert(m_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty"); 272Contract.Assert(currChannelIndex == m_channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (6)
52Contract.Assert(partitions != null); 89Contract.Assert(m_asyncChannels == null || m_asyncChannels.Length == partitions.PartitionCount); 90Contract.Assert(m_syncChannels == null || m_syncChannels.Length == partitions.PartitionCount); 91Contract.Assert(m_channelEnumerator != null, "enumerator can't be null if we're not ignoring output"); 120Contract.Assert(m_partitions.PartitionCount == 1); 130Contract.Assert(m_ignoreOutput || m_channelEnumerator != null);
System\Linq\Parallel\Merging\MergeEnumerator.cs (2)
34Contract.Assert(taskGroupState != null); 72Contract.Assert(m_taskGroupState.CancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Merging\MergeExecutor.cs (7)
58Contract.Assert(partitions != null); 59Contract.Assert(partitions.PartitionCount > 0); 60Contract.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "@BUGBUG: pipelining w/ no output not supported -- need it?"); 67Contract.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered); 106Contract.Assert(m_mergeHelper != null); 122Contract.Assert(m_mergeHelper != null); 151Contract.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
45Contract.Assert(partitions != null); 73Contract.Assert(m_results.Value != null);
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (9)
122Contract.Assert(partitions != null); 139Contract.Assert(typeof(TKey) == typeof(int)); 174Contract.Assert(false, "An ordered pipelining merge is not intended to be used this way."); 372Contract.Assert(false, "QueryEnd() should have thrown an exception."); 409Contract.Assert(m_mergeHelper.m_producerDone[producer]); 415Contract.Assert(buffer.Count > 0, "Producer's buffer should not be empty here."); 446Contract.Assert(gotElement); 465Contract.Assert(m_privateBuffer[producer].Count == 0); 523Contract.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (4)
42Contract.Assert(channels != null); 84Contract.Assert(m_channels != null); 96Contract.Assert(current != null); 115Contract.Assert(m_channelIndex == m_channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (13)
72Contract.Assert(source != null); 73Contract.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 74Contract.Assert(repartitionStream != null); 75Contract.Assert(barrier != null); 76Contract.Assert(valueExchangeMatrix != null); 77Contract.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 78Contract.Assert(valueExchangeMatrix.GetLength(1) == partitionCount, "expected square matrix of buffers (NxN)"); 79Contract.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 135Contract.Assert(mutables.m_currentBufferIndex != ENUMERATION_NOT_STARTED); 158Contract.Assert(mutables.m_currentBuffer == null || mutables.m_currentBuffer.Count > 0); 202Contract.Assert(mutables != null); 225Contract.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 229Contract.Assert(0 <= destinationIndex && destinationIndex < m_partitionCount,
System\Linq\Parallel\Partitioning\HashRepartitionStream.cs (2)
58Contract.Assert(m_keyComparer == null || m_elementComparer == null); 59Contract.Assert(m_elementComparer == null || typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (18)
74Contract.Assert(source != null); 75Contract.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 76Contract.Assert(repartitionStream != null); 77Contract.Assert(barrier != null); 78Contract.Assert(valueExchangeMatrix != null); 79Contract.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 80Contract.Assert(valueExchangeMatrix.GetLength(1) == partitionCount, "expected square matrix of buffers (NxN)"); 81Contract.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 136Contract.Assert(mutables.m_currentBufferIndex != ENUMERATION_NOT_STARTED); 148Contract.Assert(mutables.m_currentKeyBuffer != null); 154Contract.Assert(mutables.m_currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 164Contract.Assert(mutables.m_currentBuffer == null || mutables.m_currentBuffer.Count > 0); 165Contract.Assert((mutables.m_currentBuffer == null) == (mutables.m_currentKeyBuffer == null)); 166Contract.Assert(mutables.m_currentBuffer == null || mutables.m_currentBuffer.Count == mutables.m_currentKeyBuffer.Count); 211Contract.Assert(mutables != null); 235Contract.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 239Contract.Assert(0 <= destinationIndex && destinationIndex < m_partitionCount, 252Contract.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
78Contract.Assert(source != null); 79Contract.Assert(partitionCount > 0); 86Contract.Assert(source != null); 145Contract.Assert(partitions.Length == partitionCount); 168Contract.Assert(source != null); 169Contract.Assert(partitionCount > 0); 245Contract.Assert(data != null, "data musn't be null"); 246Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 247Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 248Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 249Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 258Contract.Assert(sectionSize > 0); 288Contract.Assert(mutables != null); 289Contract.Assert(mutables.m_currentPositionInChunk >= mutables.m_currentChunkSize); 351Contract.Assert(data != null, "data musn't be null"); 352Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 353Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 354Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 371Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 423Contract.Assert(data != null, "data musn't be null"); 424Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 425Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 426Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 427Contract.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 436Contract.Assert(sectionSize > 0); 466Contract.Assert(mutables != null); 467Contract.Assert(mutables.m_currentPositionInChunk >= mutables.m_currentChunkSize); 529Contract.Assert(data != null, "data musn't be null"); 530Contract.Assert(partitionCount > 0, "partitionCount must be positive"); 531Contract.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 532Contract.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 549Contract.Assert(m_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 616Contract.Assert(source != null); 617Contract.Assert(sourceSyncLock != null); 618Contract.Assert(currentIndex != null); 639Contract.Assert(mutables.m_chunkBuffer != null); 649Contract.Assert(m_source != null); 650Contract.Assert(chunkBuffer != null); 651Contract.Assert(mutables.m_currentChunkSize > 0); 652Contract.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 666Contract.Assert(0 <= mutables.m_nextChunkMaxSize && mutables.m_nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\Partitioning\PartitionedStream.cs (7)
44Contract.Assert(partitionCount > 0); 61Contract.Assert(m_partitions != null); 62Contract.Assert(0 <= index && index < m_partitions.Length, "index out of bounds"); 67Contract.Assert(m_partitions != null); 68Contract.Assert(value != null); 69Contract.Assert(0 <= index && index < m_partitions.Length, "index out of bounds"); 82Contract.Assert(m_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (16)
85Contract.Assert(child != null, "child data source cannot be null"); 86Contract.Assert(intermediateReduce != null, "need an intermediate reduce function"); 87Contract.Assert(finalReduce != null, "need a final reduce function"); 88Contract.Assert(resultSelector != null, "need a result selector function"); 89Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum out of valid range"); 90Contract.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 91Contract.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 112Contract.Assert(m_finalReduce != null); 113Contract.Assert(m_resultSelector != null); 220Contract.Assert(false, "This method should never be called. Associative aggregation can always be parallelized."); 258Contract.Assert(source != null); 259Contract.Assert(reduceOperator != null); 277Contract.Assert(m_reduceOperator != null); 278Contract.Assert(m_reduceOperator.m_intermediateReduce != null, "expected a compiled operator"); 302Contract.Assert(typeof(TInput) == typeof(TIntermediate)); 335Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (12)
38Contract.Assert(left != null && right != null, "child data sources cannot be null"); 60Contract.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 160Contract.Assert(leftSource != null); 161Contract.Assert(rightSource != null); 175Contract.Assert(m_leftSource != null); 176Contract.Assert(m_rightSource != null); 224Contract.Assert(m_leftSource != null && m_rightSource != null); 249Contract.Assert(leftSource != null); 250Contract.Assert(rightSource != null); 265Contract.Assert(m_leftSource != null); 266Contract.Assert(m_rightSource != null); 327Contract.Assert(m_leftSource != null && m_rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (5)
49Contract.Assert(left != null && right != null, "child data sources cannot be null"); 50Contract.Assert(leftKeySelector != null, "left key selector must not be null"); 51Contract.Assert(rightKeySelector != null, "right key selector must not be null"); 52Contract.Assert(resultSelector != null, "need a result selector function"); 80Contract.Assert(rightStream.PartitionCount == leftStream.PartitionCount);
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (11)
72Contract.Assert(leftSource != null); 73Contract.Assert(rightSource != null); 74Contract.Assert(singleResultSelector != null || groupResultSelector != null); 98Contract.Assert(m_singleResultSelector != null || m_groupResultSelector != null, "expected a compiled result selector"); 99Contract.Assert(m_leftSource != null); 100Contract.Assert(m_rightSource != null); 207Contract.Assert(mutables.m_currentRightMatches == null || mutables.m_currentRightMatches.Count > 0, 249Contract.Assert(m_singleResultSelector != null); 250Contract.Assert(mutables.m_currentRightMatches != null); 251Contract.Assert(0 <= mutables.m_currentRightMatchesIndex && mutables.m_currentRightMatchesIndex < mutables.m_currentRightMatches.Count); 264Contract.Assert(m_leftSource != null && m_rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (12)
37Contract.Assert(left != null && right != null, "child data sources cannot be null"); 62Contract.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount); 149Contract.Assert(leftSource != null); 150Contract.Assert(rightSource != null); 164Contract.Assert(m_leftSource != null); 165Contract.Assert(m_rightSource != null); 215Contract.Assert(m_leftSource != null && m_rightSource != null); 253Contract.Assert(leftSource != null); 254Contract.Assert(rightSource != null); 269Contract.Assert(m_leftSource != null); 270Contract.Assert(m_rightSource != null); 331Contract.Assert(m_leftSource != null && m_rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (5)
65Contract.Assert(left != null && right != null, "child data sources cannot be null"); 66Contract.Assert(leftKeySelector != null, "left key selector must not be null"); 67Contract.Assert(rightKeySelector != null, "right key selector must not be null"); 68Contract.Assert(resultSelector != null, "need a result selector function"); 83Contract.Assert(rightStream.PartitionCount == leftStream.PartitionCount);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (10)
37Contract.Assert(left != null && right != null, "child data sources cannot be null"); 64Contract.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 208Contract.Assert(leftSource != null); 209Contract.Assert(rightSource != null); 230Contract.Assert(m_hashLookup != null); 325Contract.Assert(leftSource != null); 326Contract.Assert(rightSource != null); 350Contract.Assert(m_leftSource != null); 351Contract.Assert(m_rightSource != null); 412Contract.Assert(m_leftSource != null && m_rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (3)
65Contract.Assert(resultSelector != null, "operator cannot be null"); 182Contract.Assert(m_leftChildResults.IsIndexible); 183Contract.Assert(m_rightChildResults.IsIndexible);
System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs (2)
46Contract.Assert(leftChild != null && rightChild != null); 109Contract.Assert(IsIndexible == (m_op.OrdinalIndexState == OrdinalIndexState.Indexible));
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (2)
93Contract.Assert(source != null); 137Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (2)
103Contract.Assert(source != null); 152Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (3)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 121Contract.Assert(source != null); 182Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (2)
91Contract.Assert(source != null); 134Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (2)
103Contract.Assert(source != null); 152Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (3)
41Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 127Contract.Assert(source != null); 189Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (2)
93Contract.Assert(source != null); 135Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (2)
103Contract.Assert(source != null); 152Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (3)
40Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 125Contract.Assert(source != null); 186Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (2)
95Contract.Assert(source != null); 138Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (2)
41Contract.Assert(child != null, "child data source cannot be null"); 150Contract.Assert(false, "This method should never be called. Associative aggregation can always be parallelized.");
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (2)
103Contract.Assert(source != null); 152Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (3)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 121Contract.Assert(source != null); 183Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (2)
95Contract.Assert(source != null); 141Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (2)
103Contract.Assert(source != null); 152Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (2)
95Contract.Assert(source != null); 140Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (3)
36Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 122Contract.Assert(source != null); 184Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (2)
94Contract.Assert(source != null); 140Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (2)
99Contract.Assert(source != null); 140Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (3)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 117Contract.Assert(source != null); 179Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (2)
88Contract.Assert(source != null); 131Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (2)
99Contract.Assert(source != null); 140Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (3)
39Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 125Contract.Assert(source != null); 189Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (2)
88Contract.Assert(source != null); 132Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (2)
99Contract.Assert(source != null); 141Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (3)
39Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 125Contract.Assert(source != null); 189Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (2)
88Contract.Assert(source != null); 131Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (2)
99Contract.Assert(source != null); 141Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (3)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 117Contract.Assert(source != null); 178Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (2)
91Contract.Assert(source != null); 136Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (2)
100Contract.Assert(source != null); 141Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (3)
33Contract.Assert(sign == -1 || sign == 1, "invalid sign"); 118Contract.Assert(source != null); 180Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (2)
92Contract.Assert(source != null); 138Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (3)
136Contract.Assert(m_settings.DegreeOfParallelism.HasValue); 240Contract.Assert(m_sourceEnumerator != null); 270Contract.Assert(m_sourceEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
57Contract.Assert(queryOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperator.cs (6)
146Contract.Assert(mergeOptions != null); 186Contract.Assert(querySettings.TaskScheduler != null); 187Contract.Assert(querySettings.DegreeOfParallelism.HasValue); 188Contract.Assert(querySettings.ExecutionMode.HasValue); 305Contract.Assert(source != null); 331Contract.Assert(sourceAsOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs (1)
66Contract.Assert(operatorEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryResults.cs (2)
67Contract.Assert(false, "GetElement property is not supported by non-indexible query results"); 82Contract.Assert(false, "ElementsCount property is not supported by non-indexible query results");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (12)
47Contract.Assert(m_cancellationState != null); 100Contract.Assert(m_cancellationState != null); 156Contract.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified."); 166Contract.Assert(settings.CancellationState.InternalCancellationTokenSource != null); 167Contract.Assert(settings.CancellationState.MergedCancellationToken.CanBeCanceled); 168Contract.Assert(settings.CancellationState.TopLevelDisposedFlag != null); 209Contract.Assert(settings.TaskScheduler != null); 210Contract.Assert(settings.DegreeOfParallelism.HasValue); 211Contract.Assert(settings.DegreeOfParallelism.Value >= 1 && settings.DegreeOfParallelism <= Scheduling.MAX_SUPPORTED_DOP); 212Contract.Assert(settings.ExecutionMode != null); 213Contract.Assert(settings.MergeOptions != null); 215Contract.Assert(settings.MergeOptions != ParallelMergeOptions.Default);
System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs (2)
38Contract.Assert(data != null); 65Contract.Assert(settings.DegreeOfParallelism.HasValue);
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (8)
58Contract.Assert(child != null, "child data source cannot be null"); 59Contract.Assert(predicate != null, "need a predicate function"); 132Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false."); 169Contract.Assert(source != null); 170Contract.Assert(predicate != null); 171Contract.Assert(resultFoundFlag != null); 189Contract.Assert(m_predicate != null); 237Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\ConcatQueryOperator.cs (10)
46Contract.Assert(firstChild != null, "first child data source cannot be null"); 47Contract.Assert(secondChild != null, "second child data source cannot be null"); 94Contract.Assert(!ExchangeUtilities.IsWorseThan(leftStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 113Contract.Assert(!ExchangeUtilities.IsWorseThan(rightStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 177Contract.Assert(firstSource != null); 178Contract.Assert(secondSource != null); 194Contract.Assert(m_firstSource != null); 195Contract.Assert(m_secondSource != null); 264Contract.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible); 279Contract.Assert(m_leftChildCount >= 0 && m_rightChildCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (7)
44Contract.Assert(child != null, "child data source cannot be null"); 119Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false."); 156Contract.Assert(source != null); 157Contract.Assert(comparer != null); 158Contract.Assert(resultFoundFlag != null); 176Contract.Assert(m_comparer != null); 223Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (7)
44Contract.Assert(child != null, "child data source cannot be null"); 127Contract.Assert(source != null); 128Contract.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 129Contract.Assert(partitionCount > 0); 130Contract.Assert(sharedEmptyCount != null); 131Contract.Assert(sharedLatch != null); 148Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (9)
38Contract.Assert(source != null, "child data source cannot be null"); 139Contract.Assert(source != null); 151Contract.Assert(m_source != null); 152Contract.Assert(m_hashLookup != null); 182Contract.Assert(m_source != null); 215Contract.Assert(source != null); 231Contract.Assert(m_source != null); 232Contract.Assert(m_hashLookup != null); 277Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (9)
44Contract.Assert(child != null, "child data source cannot be null"); 45Contract.Assert(index >= 0, "index can't be less than 0"); 79Contract.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexible); 106Contract.Assert(false, "This method should never be called as fallback to sequential is handled in Aggregate()."); 155Contract.Assert(!e.MoveNext(), "expected enumerator to be empty"); 185Contract.Assert(source != null); 186Contract.Assert(index >= 0); 187Contract.Assert(resultFoundFlag != null); 228Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (7)
43Contract.Assert(child != null, "child data source cannot be null"); 104Contract.Assert(false, "This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 145Contract.Assert(source != null); 146Contract.Assert(operatorState != null); 147Contract.Assert(sharedBarrier != null); 148Contract.Assert(keyComparer != null); 165Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (9)
39Contract.Assert(child != null, "child data source cannot be null"); 40Contract.Assert(elementAction != null, "need a function"); 51Contract.Assert(m_elementAction != null); 69Contract.Assert(enumerator == null); 108Contract.Assert(false, "AsSequentialQuery is not supported on ForAllOperator"); 139Contract.Assert(source != null); 140Contract.Assert(elementAction != null); 154Contract.Assert(m_elementAction != null, "expected a compiled operator"); 177Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (28)
60Contract.Assert(child != null, "child data source cannot be null"); 61Contract.Assert(keySelector != null, "need a selector function"); 62Contract.Assert(elementSelector != null || 118Contract.Assert(typeof(TSource) == typeof(TElement)); 158Contract.Assert(typeof(TSource) == typeof(TElement)); 198Contract.Assert(typeof(TElement) == typeof(TSource)); 250Contract.Assert(source != null); 265Contract.Assert(m_source != null); 276Contract.Assert(mutables.m_hashLookup != null); 353Contract.Assert(currentValue != null); 384Contract.Assert(elementSelector != null); 417Contract.Assert(currentValue != null); 457Contract.Assert(source != null); 458Contract.Assert(keySelector != null); 475Contract.Assert(m_source != null); 476Contract.Assert(m_keySelector != null); 487Contract.Assert(mutables.m_hashLookup != null); 594Contract.Assert(currentValue != null); 629Contract.Assert(elementSelector != null); 670Contract.Assert(currentValue != null); 703Contract.Assert(keyValues.Value != null); 725Contract.Assert(m_keyValues.Value != null); 774Contract.Assert(m_values != null); 779Contract.Assert(valueArray.Length >= valueCount); // valueArray.Length may be larger than valueCount 797Contract.Assert(m_values != null); 798Contract.Assert(m_orderKeys != null); 809Contract.Assert(m_values != null); 810Contract.Assert(m_orderKeys != null);
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (9)
51Contract.Assert(child != null, "child data source cannot be null"); 52Contract.Assert(selector != null, "need a selector function"); 75Contract.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 107Contract.Assert(typeof(TKey) == typeof(int)); 150Contract.Assert(source != null); 151Contract.Assert(selector != null); 166Contract.Assert(m_selector != null, "expected a compiled selection function"); 223Contract.Assert(m_childQueryResults.IsIndexible); 232Contract.Assert(m_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (7)
50Contract.Assert(child != null, "child data source cannot be null"); 51Contract.Assert(predicate != null, "need a filter function"); 101Contract.Assert(typeof(TKey) == typeof(int)); 157Contract.Assert(source != null); 158Contract.Assert(predicate != null); 170Contract.Assert(m_predicate != null, "expected a compiled operator"); 194Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (7)
44Contract.Assert(child != null, "child data source cannot be null"); 100Contract.Assert(false, "This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 141Contract.Assert(source != null); 142Contract.Assert(operatorState != null); 143Contract.Assert(sharedBarrier != null); 144Contract.Assert(keyComparer != null); 161Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (8)
45Contract.Assert(child != null, "child data source cannot be null"); 61Contract.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexible, "Don't take this code path if the child is indexible."); 124Contract.Assert(source != null); 201Contract.Assert(m_childQueryResults.IsIndexible); 214Contract.Assert(m_count >= 0); 221Contract.Assert(m_count >= 0); 222Contract.Assert(index >= 0); 223Contract.Assert(index < m_count);
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (17)
62Contract.Assert(leftChild != null, "left child data source cannot be null"); 63Contract.Assert(rightChildSelector != null || indexedRightChildSelector != null, 65Contract.Assert(rightChildSelector == null || indexedRightChildSelector == null, 67Contract.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 212Contract.Assert(m_indexedRightChildSelector != null); 265Contract.Assert(leftSource != null); 266Contract.Assert(selectManyOperator != null); 302Contract.Assert(rightChild != null); 305Contract.Assert(m_currentRightSource != null); 316Contract.Assert(m_currentRightSourceAsOutput == m_currentRightSource, 335Contract.Assert(m_currentRightSourceAsOutput != null); 395Contract.Assert(leftSource != null); 396Contract.Assert(selectManyOperator != null); 432Contract.Assert(rightChild != null); 435Contract.Assert(m_currentRightSource != null); 446Contract.Assert(m_currentRightSourceAsOutput == m_currentRightSource, 465Contract.Assert(m_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (9)
46Contract.Assert(child != null, "child data source cannot be null"); 47Contract.Assert(selector != null, "need a selector function"); 109Contract.Assert(source != null); 110Contract.Assert(selector != null); 125Contract.Assert(m_selector != null, "expected a compiled operator"); 168Contract.Assert(op.m_selector != null); 170Contract.Assert(m_childQueryResults.IsIndexible); 186Contract.Assert(index >= 0); 187Contract.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (5)
43Contract.Assert(child != null, "child data source cannot be null"); 81Contract.Assert(false, "This method should never be called as it is an ending operator with LimitsParallelism=false."); 117Contract.Assert(source != null); 118Contract.Assert(totalElementCount != null); 131Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (6)
39Contract.Assert(keySelector != null, "key selector must not be null"); 212Contract.Assert(source != null); 213Contract.Assert(keySelector != null, "need a key comparer"); 214Contract.Assert(keyComparer != null, "expected a compiled operator"); 237Contract.Assert(m_source != null); 251Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (13)
55Contract.Assert(child != null, "child data source cannot be null"); 93Contract.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexible, "Don't take this code path if the child is indexible."); 176Contract.Assert(source != null); 177Contract.Assert(sharedIndices != null); 178Contract.Assert(sharedBarrier != null); 179Contract.Assert(keyComparer != null); 196Contract.Assert(m_sharedIndices != null); 297Contract.Assert(m_count <= 0 || m_keyComparer.Compare(currentKey, minKey) > 0, 359Contract.Assert(m_childQueryResults.IsIndexible); 373Contract.Assert(m_childCount >= 0); 387Contract.Assert(m_childCount >= 0); 388Contract.Assert(index >= 0); 389Contract.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (10)
75Contract.Assert(child != null, "child data source cannot be null"); 76Contract.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 142Contract.Assert(m_indexedPredicate == null || typeof(TKey) == typeof(int)); 236Contract.Assert(source != null); 237Contract.Assert(predicate != null || indexedPredicate != null); 238Contract.Assert(operatorState != null); 239Contract.Assert(sharedBarrier != null); 240Contract.Assert(keyComparer != null); 307Contract.Assert(m_indexedPredicate != null); 390Contract.Assert(m_keyComparer.Compare(currentKey, m_operatorState.m_currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (6)
45Contract.Assert(child != null, "child data source cannot be null"); 46Contract.Assert(predicate != null, "need a filter function"); 121Contract.Assert(source != null); 122Contract.Assert(predicate != null); 135Contract.Assert(m_predicate != null, "expected a compiled operator"); 158Contract.Assert(m_source != null);
System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs (1)
115Contract.Assert(IsIndexible == (m_op.OrdinalIndexState == OrdinalIndexState.Indexible));
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (12)
70Contract.Requires(partition != null); 71Contract.Requires(taskGroupState != null); 72Contract.Requires(consumerWaiting != null); 73Contract.Requires(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 74Contract.Requires(producerDone != null && producerDone.Length == consumerWaiting.Length); 75Contract.Requires(buffers != null && buffers.Length == consumerWaiting.Length); 76Contract.Requires(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 157Contract.Requires(groupState != null); 158Contract.Requires(partitions != null); 159Contract.Requires(producerDone != null && producerDone.Length == partitions.PartitionCount); 160Contract.Requires(buffers != null && buffers.Length == partitions.PartitionCount); 161Contract.Requires(bufferLocks != null);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (9)
52Contract.Requires(groupState != null); 53Contract.Requires(results != null); 54Contract.Requires(sortHelper != null); 78Contract.Requires(groupState != null); 79Contract.Requires(partitions != null); 80Contract.Requires(results != null); 81Contract.Requires(results.Value == null); 135Contract.Assert(m_sortHelper != null); 147Contract.Assert(sortedOutput != null);
System\Linq\Parallel\Scheduling\QueryTask.cs (4)
40Contract.Assert(groupState != null); 66Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 84Contract.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 97Contract.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (4)
80Contract.Assert(rootTask != null, "Expected a non-null task"); 81Contract.Assert(m_rootTask == null, "Cannot begin a query more than once"); 93Contract.Assert(m_rootTask != null); 164Contract.Assert(m_cancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
102Contract.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Scheduling\SpoolingTask.cs (8)
41Contract.Requires(partitions.PartitionCount == channels.Length); 42Contract.Requires(groupState != null); 94Contract.Requires(partitions.PartitionCount == channels.Length); 95Contract.Requires(groupState != null); 139Contract.Requires(groupState != null); 210Contract.Requires(source != null); 299Contract.Assert(source != null); 386Contract.Assert(source != null);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
79Contract.Assert(returnValue.PartitionCount == partitionCount);
System\Linq\Parallel\Utils\FixedMaxHeap.cs (3)
44Contract.Assert(comparer != null); 141Contract.Assert(m_count > 0); 152Contract.Assert(m_count > 0);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
60Contract.Assert(newSize > m_array.Length);
System\Linq\Parallel\Utils\ListChunk.cs (2)
35Contract.Assert(size > 0); 85Contract.Assert(curr.m_chunkCount == curr.m_chunk.Length || curr.m_nextChunk == null);
System\Linq\Parallel\Utils\Lookup.cs (2)
119Contract.Assert(m_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup."); 125Contract.Assert(!m_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (26)
67Contract.Assert(source != null); 68Contract.Assert(groupState != null); 69Contract.Assert(sharedIndices != null); 70Contract.Assert(sharedkeys != null); 71Contract.Assert(sharedValues != null); 72Contract.Assert(sharedBarriers != null); 73Contract.Assert(groupState.CancellationState.MergedCancellationToken != null); 74Contract.Assert(sharedIndices.Length <= sharedkeys.Length); 75Contract.Assert(sharedIndices.Length == sharedValues.Length); 76Contract.Assert(sharedIndices.Length == sharedBarriers.GetLength(1)); 77Contract.Assert(groupState.CancellationState.MergedCancellationToken != null); 90Contract.Assert(m_sharedKeys.Length >= m_sharedValues.Length); 200Contract.Assert(sourceValues != null, "values weren't populated"); 201Contract.Assert(sourceKeys != null, "keys weren't populated"); 275Contract.Assert(keys != null); 276Contract.Assert(values != null); 277Contract.Assert(keys.Count == values.Count); 430Contract.Assert(myKeysArr != null); 500Contract.Assert(leftValues != null); 501Contract.Assert(leftKeys != null); 581Contract.Assert(keys != null, "need a non-null keyset"); 582Contract.Assert(keys.Length >= indices.Length); 583Contract.Assert(left <= right); 584Contract.Assert(0 <= left && left < keys.Length); 585Contract.Assert(0 <= right && right < keys.Length); 605Contract.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\Parallel\Utils\TraceHelpers.cs (1)
149Contract.Assert(assertCondition, "NYI: " + message);
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
42Contract.Assert(m_comparer != null); 48Contract.Assert(m_comparer != null);
System\Linq\ParallelEnumerable.cs (11)
1581Contract.Assert(source != null); 1582Contract.Assert(reduce != null); 1583Contract.Assert(Enum.IsDefined(typeof(QueryAggregationOptions), options), "enum is out of range"); 1605Contract.Assert(source != null); 1606Contract.Assert(func != null); 1607Contract.Assert(seedIsSpecified || typeof(TSource) == typeof(TAccumulate)); 4927Contract.Assert(input != null); 5199Contract.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>); 5286Contract.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>); 5381Contract.Assert(queryOp != null, "expected query operator"); 5400Contract.Assert(!e.MoveNext(), "expected only a single element");
System\Security\Cryptography\AesCryptoServiceProvider.cs (37)
38Contract.Ensures(m_cspHandle != null && !m_cspHandle.IsInvalid && !m_cspHandle.IsClosed); 76Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); 77Contract.Ensures(Contract.Result<byte[]>() != null && 78Contract.Result<byte[]>().Length == KeySizeValue / 8); 93Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); 145Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 159Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 187Contract.Requires(key != null); 188Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 206Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 225Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 253Contract.Requires(key != null); 254Contract.Ensures(Contract.Result<ICryptoTransform>() != null); 271Contract.Ensures(!disposing || m_key == null || m_key.IsClosed); 272Contract.Ensures(!disposing || m_cspHandle == null || m_cspHandle.IsClosed); 300Contract.Requires(csp != null); 301Contract.Ensures(Contract.Result<KeySizes[]>() != null); 305Contract.Ensures(Contract.Result<KeySizes[]>().Length == 0 || 306(Contract.ValueAtReturn<int>(out defaultKeySize) > 0 && Contract.ValueAtReturn<int>(out defaultKeySize) % 8 == 0)); 369Contract.Ensures(m_key != null && !m_key.IsInvalid & !m_key.IsClosed); 370Contract.Assert(m_cspHandle != null); 402Contract.Ensures(IVValue != null && IVValue.Length == BlockSizeValue / 8); 403Contract.Assert(m_cspHandle != null); 404Contract.Assert(BlockSizeValue % 8 == 0); 419Contract.Ensures( 420((((int)Contract.Result<CapiNative.AlgorithmId>()) & (int)CapiNative.AlgorithmClass.DataEncryption) == (int)CapiNative.AlgorithmClass.DataEncryption) || 421Contract.Result<CapiNative.AlgorithmId>() == CapiNative.AlgorithmId.None);
System\Security\Cryptography\AesManaged.cs (2)
23Contract.Ensures(m_impl != null); 67Contract.Ensures(m_impl.Mode != CipherMode.CFB && m_impl.Mode != CipherMode.OFB);
System\Security\Cryptography\BCryptHashAlgorithm.cs (13)
68Contract.Requires(algorithm != null); 69Contract.Requires(!String.IsNullOrEmpty(implementation)); 70Contract.Ensures(m_algorithmHandle != null && !m_algorithmHandle.IsInvalid && !m_algorithmHandle.IsClosed); 71Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 93Contract.Ensures(m_hashHandle == null || m_hashHandle.IsClosed); 94Contract.Ensures(m_algorithmHandle == null || m_algorithmHandle.IsClosed); 114Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 115Contract.Assert(m_algorithmHandle != null); 177Contract.Assert(m_hashHandle != null); 214Contract.Ensures(Contract.Result<byte[]>() != null); 215Contract.Assert(m_hashHandle != null); 234Contract.Requires(stream != null);
System\Security\Cryptography\BCryptNative.cs (13)
481Contract.Requires(algorithm != null); 482Contract.Requires(property == HashPropertyName.HashLength || 493Contract.Requires(algorithm != null); 494Contract.Requires(!String.IsNullOrEmpty(property)); 495Contract.Ensures(Contract.Result<byte[]>() != null); 536Contract.Requires(!String.IsNullOrEmpty(algorithm)); 579Contract.Requires(!String.IsNullOrEmpty(algorithm)); 580Contract.Requires(!String.IsNullOrEmpty(implementation)); 581Contract.Ensures(Contract.Result<SafeBCryptAlgorithmHandle>() != null && 582!Contract.Result<SafeBCryptAlgorithmHandle>().IsInvalid && 583!Contract.Result<SafeBCryptAlgorithmHandle>().IsClosed);
System\Security\Cryptography\CapiHashAlgorithm.cs (12)
32Contract.Requires(!String.IsNullOrEmpty(provider)); 33Contract.Requires((CapiNative.AlgorithmClass)((uint)algorithm & (uint)CapiNative.AlgorithmClass.Hash) == CapiNative.AlgorithmClass.Hash); 34Contract.Ensures(m_cspHandle != null && !m_cspHandle.IsInvalid && !m_cspHandle.IsClosed); 35Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 48Contract.Ensures(m_hashHandle == null || m_hashHandle.IsClosed); 49Contract.Ensures(m_cspHandle == null || m_cspHandle.IsClosed); 66Contract.Ensures(m_hashHandle != null && !m_hashHandle.IsInvalid && !m_hashHandle.IsClosed); 67Contract.Assert(m_cspHandle != null); 109Contract.Assert(m_hashHandle != null); 139Contract.Ensures(Contract.Result<byte[]>() != null); 140Contract.Assert(m_hashHandle != null);
System\Security\Cryptography\CapiNative.cs (27)
511Contract.Ensures(Contract.Result<SafeCspHandle>() != null && 512!Contract.Result<SafeCspHandle>().IsInvalid && 513!Contract.Result<SafeCspHandle>().IsClosed); 542Contract.Requires(key != null); 543Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length > 0); 598Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>())); 608Contract.Requires(hashHandle != null); 609Contract.Requires(CapiNative.HashParameter.AlgorithmId <= parameter && parameter <= CapiNative.HashParameter.HashSize); 610Contract.Ensures(Contract.Result<byte[]>() != null); 646Contract.Requires(provider != null); 647Contract.Requires(parameter == ProviderParameter.EnumerateAlgorithms); 718Contract.Requires(provider != null); 719Contract.Requires(((int)algorithm & (int)AlgorithmClass.DataEncryption) == (int)AlgorithmClass.DataEncryption); 720Contract.Requires(key != null); 721Contract.Ensures(Contract.Result<SafeCapiKeyHandle>() != null && 722!Contract.Result<SafeCapiKeyHandle>().IsInvalid && 723!Contract.Result<SafeCapiKeyHandle>().IsClosed); 777Contract.Requires(key != null); 778Contract.Requires(parameter == KeyParameter.Mode || parameter == KeyParameter.ModeBits); 789Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 790Contract.Requires(value != null);
System\Security\Cryptography\CapiSymmetricAlgorithm.cs (59)
50Contract.Requires(0 < blockSize && blockSize % 8 == 0); 51Contract.Requires(0 <= feedbackSize); 52Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 53Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 54Contract.Ensures(m_provider != null && !m_provider.IsInvalid && !m_provider.IsClosed); 86Contract.Ensures(m_key == null || m_key.IsClosed); 87Contract.Ensures(m_provider == null || m_provider.IsClosed); 88Contract.Ensures(m_depadBuffer == null); 107Contract.Requires(m_key != null); 108Contract.Requires(inputBuffer != null && inputCount <= inputBuffer.Length - inputOffset); 109Contract.Requires(inputOffset >= 0); 110Contract.Requires(inputCount > 0 && inputCount % InputBlockSize == 0); 111Contract.Requires(outputBuffer != null && inputCount <= outputBuffer.Length - outputOffset); 112Contract.Requires(inputOffset >= 0); 113Contract.Requires(m_depadBuffer == null || (m_paddingMode != PaddingMode.None && m_paddingMode != PaddingMode.Zeros)); 114Contract.Ensures(Contract.Result<int>() >= 0); 166Contract.Requires(block != null && count >= block.Length - offset); 167Contract.Requires(0 <= offset); 168Contract.Requires(0 <= count); 169Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length <= block.Length); 243Contract.Requires(m_key != null); 244Contract.Requires(buffer != null && count <= buffer.Length - offset); 245Contract.Requires(offset >= 0); 246Contract.Requires(count > 0 && count % InputBlockSize == 0); 247Contract.Ensures(Contract.Result<int>() >= 0); 278Contract.Requires(m_provider != null); 279Contract.Requires(block != null && count <= block.Length - offset); 280Contract.Requires(0 <= offset); 281Contract.Requires(0 <= count); 282Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length % InputBlockSize == 0); 364Contract.Requires(blockSize % 8 == 0); 365Contract.Ensures(cipherMode == CipherMode.ECB || 366(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length == blockSize / 8)); 393Contract.Requires(m_key != null); 394Contract.Requires(buffer != null && count <= buffer.Length - offset); 395Contract.Requires(offset >= 0); 396Contract.Requires(count > 0 && count % InputBlockSize == 0); 397Contract.Ensures(Contract.Result<int>() >= 0); 427Contract.Requires(m_key != null); 428Contract.Ensures(m_depadBuffer == null); 475Contract.Ensures(Contract.Result<int>() >= 0); 515Contract.Ensures(Contract.Result<byte[]>() != null); 581Contract.Requires(key != null); 582Contract.Requires(cipherMode == CipherMode.ECB || iv != null); 583Contract.Requires(0 <= feedbackSize); 584Contract.Ensures(Contract.Result<SafeCapiKeyHandle>() != null && 585!Contract.Result<SafeCapiKeyHandle>().IsInvalid && 586!Contract.Result<SafeCapiKeyHandle>().IsClosed);
System\Security\Cryptography\CngAlgorithm.cs (34)
38Contract.Ensures(!String.IsNullOrEmpty(m_algorithm)); 55Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>())); 78Contract.Assert(m_algorithm != null); 92Contract.Assert(m_algorithm != null); 97Contract.Assert(m_algorithm != null); 107Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 117Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 129Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 141Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 153Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 165Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 177Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 189Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 201Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 213Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 225Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 237Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 249Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 261Contract.Ensures(Contract.Result<CngAlgorithm>() != null);
System\Security\Cryptography\CngAlgorithmGroup.cs (16)
30Contract.Ensures(!String.IsNullOrEmpty(m_algorithmGroup)); 47Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>())); 72Contract.Assert(m_algorithmGroup != null); 86Contract.Assert(m_algorithmGroup != null); 91Contract.Assert(m_algorithmGroup != null); 101Contract.Ensures(Contract.Result<CngAlgorithmGroup>() != null); 113Contract.Ensures(Contract.Result<CngAlgorithmGroup>() != null); 126Contract.Ensures(Contract.Result<CngAlgorithmGroup>() != null); 139Contract.Ensures(Contract.Result<CngAlgorithmGroup>() != null); 151Contract.Ensures(Contract.Result<CngAlgorithmGroup>() != null);
System\Security\Cryptography\CngKey.cs (53)
39Contract.Requires(keyHandle != null && !keyHandle.IsInvalid && !keyHandle.IsClosed); 40Contract.Requires(kspHandle != null && !kspHandle.IsInvalid && !kspHandle.IsClosed); 41Contract.Ensures(m_keyHandle != null && !m_keyHandle.IsInvalid && !m_keyHandle.IsClosed); 42Contract.Ensures(kspHandle != null && !kspHandle.IsInvalid && !kspHandle.IsClosed); 59Contract.Assert(m_keyHandle != null); 79Contract.Assert(m_keyHandle != null); 93Contract.Assert(m_keyHandle != null); 118Contract.Assert(m_keyHandle != null); 135Contract.Assert(m_keyHandle != null); 160Contract.Assert(m_keyHandle != null); 175Contract.Assert(m_keyHandle != null); 192Contract.Assert(m_keyHandle != null); 211Contract.Assert(m_keyHandle != null); 241Contract.Assert(m_keyHandle != null); 255Contract.Assert(m_keyHandle != null); 264Contract.Assert(m_keyHandle != null); 278Contract.Assert(m_kspHandle != null); 299Contract.Assert(m_kspHandle != null); 311Contract.Assert(m_keyHandle != null); 330Contract.Ensures(Contract.Result<CngUIPolicy>() != null); 331Contract.Assert(m_keyHandle != null); 360Contract.Ensures(Contract.Result<KeyContainerPermission>() != null || IsEphemeral); 361Contract.Assert(m_keyHandle != null); 362Contract.Assert(m_kspHandle != null); 399Contract.Ensures(Contract.Result<CngKey>() != null); 404Contract.Ensures(Contract.Result<CngKey>() != null); 410Contract.Ensures(Contract.Result<CngKey>() != null); 464Contract.Assert(m_keyHandle != null); 552Contract.Ensures(Contract.Result<CngKey>() != null); 557Contract.Ensures(Contract.Result<CngKey>() != null); 562Contract.Ensures(Contract.Result<CngKey>() != null); 569Contract.Ensures(Contract.Result<CngKey>() != null); 620Contract.Assert(m_keyHandle != null); 640Contract.Assert(m_keyHandle != null); 662Contract.Assert(m_keyHandle != null); 679Contract.Ensures(Contract.Result<CngKey>() != null); 684Contract.Ensures(Contract.Result<CngKey>() != null); 690Contract.Ensures(Contract.Result<CngKey>() != null); 797Contract.Requires(keyHandle != null && !keyHandle.IsInvalid && !keyHandle.IsClosed); 798Contract.Requires(creationParameters != null); 859Contract.Assert(m_keyHandle != null);
System\Security\Cryptography\CngKeyBlobFormat.cs (22)
33Contract.Ensures(!String.IsNullOrEmpty(m_format)); 50Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>())); 73Contract.Assert(m_format != null); 87Contract.Assert(m_format != null); 92Contract.Assert(m_format != null); 102Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 114Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 126Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 138Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 150Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 162Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 174Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 186Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null);
System\Security\Cryptography\CngKeyCreationParameters.cs (6)
70Contract.Ensures(Contract.Result<CngPropertyCollection>() != null); 80Contract.Ensures(Contract.Result<CngPropertyCollection>() != null); 90Contract.Ensures(Contract.Result<CngProvider>() != null);
System\Security\Cryptography\CngProperty.cs (2)
45Contract.Ensures(Contract.Result<string>() != null);
System\Security\Cryptography\CngProvider.cs (10)
27Contract.Ensures(!String.IsNullOrEmpty(m_provider)); 44Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>())); 67Contract.Assert(m_provider != null); 81Contract.Assert(m_provider != null); 86Contract.Assert(m_provider != null); 98Contract.Ensures(Contract.Result<CngProvider>() != null); 110Contract.Ensures(Contract.Result<CngProvider>() != null);
System\Security\Cryptography\ECDiffieHellmanCng.cs (34)
49Contract.Ensures(LegalKeySizesValue != null); 53Contract.Ensures(LegalKeySizesValue != null); 70Contract.Ensures(LegalKeySizesValue != null); 71Contract.Ensures(m_key != null && m_key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 123Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 128Contract.Ensures(m_hashAlgorithm != null); 152Contract.Ensures(Contract.Result<ECDiffieHellmanKeyDerivationFunction>() >= ECDiffieHellmanKeyDerivationFunction.Hash && 153Contract.Result<ECDiffieHellmanKeyDerivationFunction>() <= ECDiffieHellmanKeyDerivationFunction.Tls); 159Contract.Ensures(m_kdf >= ECDiffieHellmanKeyDerivationFunction.Hash && 211Contract.Ensures(Contract.Result<CngKey>() != null); 212Contract.Ensures(Contract.Result<CngKey>().AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 213Contract.Ensures(m_key != null && m_key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 255Contract.Requires(value != null); 256Contract.Ensures(m_key != null && m_key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 298Contract.Ensures(Contract.Result<ECDiffieHellmanPublicKey>() != null); 314Contract.Ensures(Contract.Result<byte[]>() != null); 315Contract.Assert(m_kdf >= ECDiffieHellmanKeyDerivationFunction.Hash && 338Contract.Ensures(Contract.Result<byte[]>() != null); 339Contract.Assert(m_kdf >= ECDiffieHellmanKeyDerivationFunction.Hash && 418Contract.Ensures(Contract.Result<byte[]>() != null); 444Contract.Ensures(Contract.Result<byte[]>() != null); 470Contract.Ensures(Contract.Result<byte[]>() != null); 603Contract.Ensures(Contract.Result<string>() != null);
System\Security\Cryptography\ECDiffieHellmanCngPublicKey.cs (13)
29Contract.Requires(format != null); 30Contract.Ensures(m_format != null); 42Contract.Ensures(Contract.Result<CngKeyBlobFormat>() != null); 43Contract.Assert(m_format != null); 79Contract.Requires(key != null && key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 80Contract.Ensures(Contract.Result<ECDiffieHellmanCngPublicKey>() != null); 118Contract.Ensures(Contract.Result<CngKey>() != null); 119Contract.Assert(m_format != null); 131Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>()));
System\Security\Cryptography\ECDiffieHellmanPublicKey.cs (2)
25Contract.Ensures(m_keyBlob != null); 43Contract.Assert(m_keyBlob != null);
System\Security\Cryptography\ECDsaCng.cs (22)
31Contract.Ensures(LegalKeySizesValue != null); 35Contract.Ensures(LegalKeySizesValue != null); 52Contract.Ensures(LegalKeySizesValue != null); 53Contract.Ensures(m_key != null && IsEccAlgorithmGroup(m_key.AlgorithmGroup)); 104Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 109Contract.Ensures(m_hashAlgorithm != null); 124Contract.Ensures(Contract.Result<CngKey>() != null); 125Contract.Ensures(IsEccAlgorithmGroup(Contract.Result<CngKey>().AlgorithmGroup)); 126Contract.Ensures(m_key != null && IsEccAlgorithmGroup(m_key.AlgorithmGroup)); 168Contract.Requires(value != null); 169Contract.Ensures(m_key != null && IsEccAlgorithmGroup(m_key.AlgorithmGroup)); 258Contract.Ensures(Contract.Result<byte[]>() != null); 269Contract.Ensures(Contract.Result<byte[]>() != null); 291Contract.Ensures(Contract.Result<byte[]>() != null); 342Contract.Ensures(Contract.Result<string>() != null);
System\Security\Cryptography\MD5Cng.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 41Contract.Assert(m_hashAlgorithm != null); 46Contract.Assert(m_hashAlgorithm != null); 51Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\NCryptNative.cs (115)
939Contract.Requires(!String.IsNullOrEmpty(algorithm)); 940Contract.Ensures(Contract.Result<byte[]>() != null); 979Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 980Contract.Requires(!String.IsNullOrEmpty(algorithm)); 981Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 982!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 983!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 1004Contract.Requires(key != null); 1026Contract.Requires(secretAgreement != null); 1027Contract.Requires(!String.IsNullOrEmpty(kdf)); 1028Contract.Requires(!String.IsNullOrEmpty(hashAlgorithm)); 1029Contract.Requires(hmacKey == null || kdf == BCryptNative.KeyDerivationFunction.Hmac); 1030Contract.Ensures(Contract.Result<byte[]>() != null); 1107Contract.Requires(secretAgreement != null); 1108Contract.Requires(!String.IsNullOrEmpty(kdf)); 1109Contract.Requires(parameters != null); 1110Contract.Ensures(Contract.Result<byte[]>() != null); 1160Contract.Requires(secretAgreement != null); 1161Contract.Requires(!String.IsNullOrEmpty(hashAlgorithm)); 1162Contract.Ensures(Contract.Result<byte[]>() != null); 1183Contract.Requires(secretAgreement != null); 1184Contract.Requires(!String.IsNullOrEmpty(hashAlgorithm)); 1185Contract.Ensures(Contract.Result<byte[]>() != null); 1204Contract.Requires(secretAgreement != null); 1205Contract.Requires(label != null && seed != null); 1206Contract.Ensures(Contract.Result<byte[]>() != null); 1238Contract.Requires(privateKey != null); 1239Contract.Requires(otherPartyPublicKey != null); 1240Contract.Ensures(Contract.Result<SafeNCryptSecretHandle>() != null && 1241!Contract.Result<SafeNCryptSecretHandle>().IsClosed && 1242!Contract.Result<SafeNCryptSecretHandle>().IsInvalid); 1262Contract.Requires(key != null); 1263Contract.Requires(!String.IsNullOrEmpty(format)); 1264Contract.Ensures(Contract.Result<byte[]>() != null); 1304Contract.Requires(key != null); 1305Contract.Requires(keySize > 0); 1306Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length >= keySize / 8); 1331Contract.Requires(key != null && !key.IsInvalid && !key.IsClosed); 1347Contract.Requires(ncryptObject != null); 1348Contract.Requires(propertyName != null); 1397Contract.Requires(ncryptObject != null); 1398Contract.Requires(propertyName != null); 1416Contract.Requires(ncryptObject != null); 1417Contract.Requires(propertyName != null); 1445Contract.Requires(ncryptObject != null); 1446Contract.Requires(propertyName != null); 1478Contract.Requires(ncryptObject != null); 1479Contract.Requires(propertyName != null); 1508Contract.Requires(ncryptObject != null); 1509Contract.Requires(propertyName != null); 1532Contract.Requires(provider != null); 1533Contract.Requires(keyBlob != null); 1534Contract.Requires(!String.IsNullOrEmpty(format)); 1535Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 1536!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1537!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 1561Contract.Requires(provider != null); 1562Contract.Requires(keyBlob != null); 1563Contract.Requires(!String.IsNullOrEmpty(format)); 1564Contract.Ensures(Contract.Result<SafeNCryptKeyHandle>() != null && 1565!Contract.Result<SafeNCryptKeyHandle>().IsInvalid && 1566!Contract.Result<SafeNCryptKeyHandle>().IsClosed); 1593Contract.Requires(provider != null && !provider.IsInvalid && !provider.IsClosed); 1594Contract.Requires(name != null); 1611Contract.Requires(!String.IsNullOrEmpty(providerName)); 1612Contract.Ensures(Contract.Result<SafeNCryptProviderHandle>() != null && 1613!Contract.Result<SafeNCryptProviderHandle>().IsInvalid && 1614!Contract.Result<SafeNCryptProviderHandle>().IsClosed); 1632Contract.Requires(buffer != null); 1633Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length == buffer.Length); 1645Contract.Requires(buffer != null); 1646Contract.Requires(offset >= 0 && offset < buffer.Length); 1647Contract.Requires(count >= 0 && buffer.Length - count >= offset); 1648Contract.Ensures(Contract.Result<byte[]>() != null); 1649Contract.Ensures(Contract.Result<byte[]>().Length == (padWithZeroByte ? count + 1 : count)); 1650Contract.Ensures(padWithZeroByte ? Contract.Result<byte[]>()[count] == 0 : true); 1678Contract.Requires(ncryptObject != null); 1679Contract.Requires(propertyName != null); 1692Contract.Requires(ncryptObject != null); 1693Contract.Requires(propertyName != null); 1714Contract.Requires(ncryptObject != null); 1715Contract.Requires(propertyName != null); 1752Contract.Requires(ncryptObject != null); 1753Contract.Requires(propertyName != null); 1771Contract.Requires(key != null); 1772Contract.Requires(hash != null); 1773Contract.Ensures(Contract.Result<byte[]>() != null); 1816Contract.Requires(key != null); 1817Contract.Requires(hash != null); 1818Contract.Ensures(Contract.Result<byte[]>() != null); 1866Contract.Requires(blob != null && blob.Length > 2 * sizeof(int)); 1889Contract.Requires(key != null); 1890Contract.Requires(hash != null); 1891Contract.Requires(signature != null);
System\Security\Cryptography\Rfc4050KeyFormatter.cs (11)
64Contract.Requires(xml != null); 65Contract.Ensures(Contract.Result<CngKey>() != null); 98Contract.Requires(navigator != null); 99Contract.Ensures(Contract.Result<CngAlgorithm>() != null); 155Contract.Requires(navigator != null); 249Contract.Requires(writer != null); 300Contract.Requires(writer != null); 356Contract.Ensures(Contract.Result<String>() != null);
System\Security\Cryptography\SHA1Cng.cs (4)
20Contract.Ensures(m_hashAlgorithm != null); 38Contract.Assert(m_hashAlgorithm != null); 43Contract.Assert(m_hashAlgorithm != null); 48Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA256Cng.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 37Contract.Assert(m_hashAlgorithm != null); 42Contract.Assert(m_hashAlgorithm != null); 47Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 41Contract.Assert(m_hashAlgorithm != null); 49Contract.Assert(m_hashAlgorithm != null); 57Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA384Cng.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 37Contract.Assert(m_hashAlgorithm != null); 42Contract.Assert(m_hashAlgorithm != null); 47Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 38Contract.Assert(m_hashAlgorithm != null); 43Contract.Assert(m_hashAlgorithm != null); 48Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA512Cng.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 37Contract.Assert(m_hashAlgorithm != null); 42Contract.Assert(m_hashAlgorithm != null); 47Contract.Assert(m_hashAlgorithm != null);
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (4)
19Contract.Ensures(m_hashAlgorithm != null); 41Contract.Assert(m_hashAlgorithm != null); 49Contract.Assert(m_hashAlgorithm != null); 57Contract.Assert(m_hashAlgorithm != null);
System.Drawing (26)
commonui\System\Drawing\Bitmap.cs (4)
629Contract.Ensures(Contract.Result<BitmapData>() != null); 644Contract.Ensures(Contract.Result<BitmapData>() != null);
commonui\System\Drawing\Graphics.cs (2)
235Contract.Ensures(Contract.Result<Graphics>() != null);
commonui\System\Drawing\SystemIcons.cs (20)
43Contract.Ensures(Contract.Result<Icon>() != null); 57Contract.Ensures(Contract.Result<Icon>() != null); 71Contract.Ensures(Contract.Result<Icon>() != null); 85Contract.Ensures(Contract.Result<Icon>() != null); 99Contract.Ensures(Contract.Result<Icon>() != null); 113Contract.Ensures(Contract.Result<Icon>() != null); 127Contract.Ensures(Contract.Result<Icon>() != null); 141Contract.Ensures(Contract.Result<Icon>() != null); 155Contract.Ensures(Contract.Result<Icon>() != null); 169Contract.Ensures(Contract.Result<Icon>() != null);
System.Numerics (114)
System\Numerics\BigInteger.cs (18)
67Contract.Assert(_sign == 1 || _sign == -1 /*, "_sign must be +1 or -1 when _bits is non-null"*/); 68Contract.Assert(Length(_bits) > 0 /*, "_bits must contain at least 1 element or be null"*/); 70Contract.Assert(_bits[0] >= kuMaskHighBit /*, "Wasted space _bits[0] could have been packed into _sign"*/); 73Contract.Assert(_sign > int.MinValue /*, "Int32.MinValue should not be stored in the _sign field"*/); 443Contract.Assert(value != 0); 478Contract.EndContractBlock(); 492Contract.EndContractBlock(); 505Contract.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 540Contract.EndContractBlock(); 678Contract.EndContractBlock(); 1012Contract.EndContractBlock(); 1051Contract.EndContractBlock(); 1737Contract.Assert(sign == +1 || sign == -1); 1745Contract.Assert(man < (1UL << 53)); 1746Contract.Assert(exp <= 0 || man >= (1UL << 52)); 1775Contract.Assert(0 <= cbit && cbit < kcbitUint); 1776Contract.Assert(cu >= 1); 1798Contract.Assert(cu >= 2 && rgu[cu - 2] != 0);
System\Numerics\BigIntegerBuilder.cs (82)
41Contract.Assert(_iuLast == 0); 42Contract.Assert(!_fWritable || _rgu != null); 45Contract.Assert(_rgu != null && _rgu.Length > _iuLast); 46Contract.Assert(!fTrimmed || _rgu[_iuLast] != 0); 104Contract.Requires(sign == +1 || sign == -1); 125Contract.Requires(sign == +1 || sign == -1); 134Contract.Requires(signSrc == +1 || signSrc == -1); 155Contract.Assert(cuExtra >= 0); 219Contract.Assert(cbit < kcbitUint); 237Contract.Assert(_iuLast > 0); 250Contract.Requires(cu > 0); 267Contract.Requires(cu > 0); 288Contract.Requires(cu > 0 && cuExtra >= 0); 319Contract.Requires(cu > 1 && cuExtra >= 0); 339Contract.Requires(cuExtra >= 0); 341Contract.Assert(_iuLast > 0); 365Contract.Requires(cuExtra >= 0); 435Contract.Assert(_iuLast > 0); 443Contract.Assert(uCarry <= 1); 453Contract.Requires(sign == +1 || sign == -1); 481Contract.Requires(sign == +1 || sign == -1); 531Contract.Assert(_iuLast > 0); 535Contract.Assert(reg._iuLast > 0); 548Contract.Assert(uBorrow <= 1); 551Contract.Assert(uBorrow == 1 && cuSub <= _iuLast); 560Contract.Assert(0 < _iuLast && _iuLast <= reg._iuLast); 561Contract.Assert(_iuLast < reg._iuLast || _rgu[_iuLast] < reg._rgu[_iuLast]); 568Contract.Assert(_iuLast > 0); 575Contract.Assert(uBorrow <= 1); 578Contract.Assert(uBorrow == 1); 669Contract.Assert(reg1._iuLast > 0 && reg2._iuLast > 0); 791Contract.Assert(regNum._iuLast > 0 && regDen._iuLast > 0); 797Contract.Assert(0 < regDen._iuLast && regDen._iuLast <= regNum._iuLast); 832Contract.Assert((uDen & 0x80000000) != 0); 835Contract.Assert(cuQuo + cuDen == regNum._iuLast + 1 || cuQuo + cuDen == regNum._iuLast + 2); 841Contract.Assert(uNumHi <= regDen._rgu[cuDen - 1]); 855Contract.Assert(uuQuo <= (ulong)uint.MaxValue + 2); 878Contract.Assert(uNumHi == uuBorrow || uNumHi == uuBorrow - 1); 884Contract.Assert(uCarry <= 1); 886Contract.Assert(uCarry == 1); 900Contract.Assert(cuDen > 1 && regNum._iuLast > 0); 918Contract.Requires(cuShift >= 0); 919Contract.Requires(0 <= cbitShift); 920Contract.Assert(cbitShift < kcbitUint); 941Contract.Assert(_rgu.Length > _iuLast); 969Contract.Requires(cuShift >= 0); 970Contract.Requires(0 <= cbitShift); 971Contract.Assert(cbitShift < kcbitUint); 1017Contract.Requires(cu >= 2); 1018Contract.Assert(_iuLast > 0); 1019Contract.Assert(cu > _iuLast); 1031Contract.Requires(0 <= iu); 1032Contract.Assert(_fWritable && _iuLast > 0); 1033Contract.Assert(iu <= _iuLast + 1); 1049Contract.Requires(0 < iuMin); 1050Contract.Assert(_fWritable && _iuLast > 0); 1051Contract.Assert(iuMin <= _iuLast); 1059Contract.Assert(false, "Invalid call to ApplyBorrow"); 1129Contract.Assert(cuMax == reg1._iuLast + 1); 1130Contract.Assert(cuMin == reg2._iuLast + 1); 1153Contract.Assert(uu1 != 0 && uu2 != 0); 1171Contract.Assert(uu1 >= uu2); // We ensured this above. 1176Contract.Assert(cuMax == cuMin); 1178Contract.Assert(reg1._iuLast < cuMin - 1); 1193Contract.Assert(uu1 + a > a); // no overflow 1194Contract.Assert(uu2 + d > d); 1195Contract.Assert(uu1 > b); 1196Contract.Assert(uu2 > c); 1197Contract.Assert(uu2 + d <= uu1 - b); 1220Contract.Assert(uQuo == (uu1 + a - 1) / (uu2 - c)); 1221Contract.Assert(uQuo == (uu1 - b) / (uu2 + d)); 1228Contract.Assert(uu1 == b); 1232Contract.Assert(uu1 + a > a); // no overflow 1233Contract.Assert(uu2 + d > d); 1234Contract.Assert(uu2 > c); 1235Contract.Assert(uu1 > b); 1236Contract.Assert(uu1 + a <= uu2 - c); 1259Contract.Assert(uQuo == (uu2 + d - 1) / (uu1 - b)); 1260Contract.Assert(uQuo == (uu2 - c) / (uu1 + a)); 1267Contract.Assert(uu2 == c); 1273Contract.Assert(a == 1 && c == 0 && d == 1); 1274Contract.Assert(uu1 > uu2); // We ensured this above.
System\Numerics\BigNumber.cs (3)
395Contract.Assert(c >= 'a' && c <= 'f'); 554Contract.Assert(rguDst[iuDst] < kuBase); 600Contract.Assert(uDig < kuBase);
System\Numerics\NumericsHelpers.cs (11)
29Contract.Ensures(Contract.ValueAtReturn(out sign) == +1 || Contract.ValueAtReturn(out sign) == -1); 70Contract.Assert((man & 0xFFF0000000000000) == 0x0010000000000000); 89Contract.Assert(du.uu != 0); 152Contract.Assert(u2 <= u1); 165Contract.Assert(u1 < u2); 185Contract.Assert(uu2 <= uu1); 200Contract.Assert(uu1 < uu2); 222Contract.Assert(u2 <= u1); 235Contract.Assert(u1 < u2);
System.ServiceModel (2)
System\ServiceModel\Configuration\ServiceModelConfigurationElement.cs (2)
24Contract.Assert(configurationProperty != null, "Parameter 'propertyName' should be the name of a configuration property of type T"); 25Contract.Assert(configurationProperty.Type.IsAssignableFrom(typeof(T)), "Parameter 'propertyName' should be the name of a configuration property of type T");
System.Windows.Forms (96)
winforms\Managed\System\WinForms\Control.cs (81)
7948Contract.Requires(e != null); 7961Contract.Requires(e != null); 8001Contract.Requires(e != null); 8030Contract.Requires(e != null); 8049Contract.Requires(e != null); 8076Contract.Requires(e != null); 8100Contract.Requires(e != null); 8113Contract.Requires(e != null); 8126Contract.Requires(e != null); 8149Contract.Requires(e != null); 8164Contract.Requires(e != null); 8206Contract.Requires(e != null); 8255Contract.Requires(e != null); 8284Contract.Requires(e != null); 8328Contract.Requires(e != null); 8341Contract.Requires(e != null); 8351Contract.Requires(e != null); 8363Contract.Requires(e != null); 8375Contract.Requires(e != null); 8387Contract.Requires(e != null); 8445Contract.Requires(e != null); 8458Contract.Requires(e != null); 8470Contract.Requires(e != null); 8499Contract.EndContractBlock(); 8547Contract.Requires(e != null); 8560Contract.Requires(e != null); 8573Contract.Requires(e != null); 8588Contract.Requires(e != null); 8627Contract.Requires(e != null); 8645Contract.Requires(e != null); 8665Contract.Requires(e != null); 8676Contract.Requires(e != null); 8689Contract.Requires(e != null); 8700Contract.Requires(e != null); 8721Contract.Requires(e != null); 8846Contract.Requires(e != null); 8864Contract.Requires(e != null); 8917Contract.Requires(e != null); 8934Contract.Requires(drgevent != null); 8946Contract.Requires(drgevent != null); 8958Contract.Requires(e != null); 8970Contract.Requires(drgevent != null); 8983Contract.Requires(gfbevent != null); 8994Contract.Requires(e != null); 9019Contract.Requires(e != null); 9039Contract.Requires(hevent != null); 9061Contract.Requires(e != null); 9088Contract.Requires(e != null); 9099Contract.Requires(e != null); 9110Contract.Requires(e != null); 9125Contract.Requires(levent != null); 9169Contract.Requires(e != null); 9194Contract.Requires(e != null); 9204Contract.Requires(e != null); 9215Contract.Requires(e != null); 9226Contract.Requires(e != null); 9237Contract.Requires(e != null); 9248Contract.Requires(e != null); 9259Contract.Requires(e != null); 9270Contract.Requires(e != null); 9290Contract.Requires(e != null); 9308Contract.Requires(e != null); 9318Contract.Requires(e != null); 9329Contract.Requires(e != null); 9340Contract.Requires(e != null); 9351Contract.Requires(e != null); 9362Contract.Requires(e != null); 9376Contract.Requires(e != null); 9382Contract.Requires(e != null); 9400Contract.Requires(pevent != null); 9411Contract.Requires(e != null); 9435Contract.Requires(qcdevent != null); 9446Contract.Requires(e != null); 9459Contract.Requires(e != null); 9480Contract.Requires(e != null); 9493Contract.Requires(e != null); 9509Contract.Requires(e != null); 9521Contract.Requires(e != null); 9533Contract.Requires(e != null); 9556Contract.Requires(e != null); 9567Contract.Requires(e != null);
winforms\Managed\System\WinForms\TreeView.cs (15)
2191Contract.Requires(e != null); 2200Contract.Requires(e != null); 2209Contract.Requires(e != null); 2218Contract.Requires(e != null); 2227Contract.Requires(e != null); 2236Contract.Requires(e != null); 2245Contract.Requires(e != null); 2254Contract.Requires(e != null); 2263Contract.Requires(e != null); 2272Contract.Requires(e != null); 2281Contract.Requires(e != null); 2290Contract.Requires(e != null); 2299Contract.Requires(e != null); 2308Contract.Requires(e != null); 2370Contract.Requires(e != null);
System.Xml (6)
System\Xml\XPath\XPathNavigator.cs (6)
1004Contract.Ensures(Contract.Result<XPathNodeIterator>() != null); 1010Contract.Ensures(Contract.Result<XPathNodeIterator>() != null); 1016Contract.Ensures(Contract.Result<XPathNodeIterator>() != null);
WindowsBase (4)
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (4)
470Contract.Assert(null != ZLibStreamHandle.zlibLibraryHandle); 471Contract.Assert(!ZLibStreamHandle.zlibLibraryHandle.IsInvalid); 645Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in DeflateInit2_ should always succeed, but it did not."); 702Contract.Assert(addRefSuccess, "zlibLibraryHandle.DangerousAddRef in InflateInit2_ should always succeed, but it did not.");