1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
|
<?xml version="1.0" encoding="utf-8"?>
<Type Name="Contract" FullName="System.Diagnostics.Contracts.Contract">
<TypeSignature Language="C#" Value="public static class Contract" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit Contract extends System.Object" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Code contract classes let you specify preconditions, postconditions, and object invariants in your code. Preconditions are requirements that must be met when entering a method or property. Postconditions describe expectations at the time the method or property code exits. Object invariants describe the expected state for a class that has no condition problems. For more information about preconditions, postconditions, and object invariants, see <format type="text/html"><a href="84526045-496f-489d-8517-a258cf76f040">Code Contracts</a></format>.</para>
<para>For tools and detailed instructions for using code contracts, see <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site.</para>
<block subset="none" type="note">
<para>You must use a binary rewriter to insert run-time enforcement of contracts. Otherwise, contracts such as the <see cref="Overload:System.Diagnostics.Contracts.Contract.Ensures" /> method can only be tested statically and will not throw exceptions during run time if a contract is violated. You can download the binary rewriter CCRewrite from <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site. CCRewrite comes with a Visual Studio add-in that enables you to activate run-time contract enforcement from the project <ui>Properties</ui> page. The binary rewriter and the Visual Studio add-in do not ship with vs_dev10_long or the Windows SDK.</para>
</block>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Contains static methods for representing program contracts such as preconditions, postconditions, and object invariants.</para>
</summary>
</Docs>
<Members>
<Member MemberName="Assert">
<MemberSignature Language="C#" Value="public static void Assert (bool condition);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Assert(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("DEBUG")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The default escalation policy is to notify the attached debugger about a contract failure or to display an <ui>Assert</ui> dialog box if a debugger is not attached. Optionally, the analyzer can be instructed to throw an exception.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Checks for a condition; if the condition is false, follows the escalation policy set for the analyzer.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
</Docs>
</Member>
<Member MemberName="Assert">
<MemberSignature Language="C#" Value="public static void Assert (bool condition, string userMessage);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Assert(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("DEBUG")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The default escalation policy is to notify the attached debugger about a contract failure or to display an <ui>Assert</ui> dialog box if a debugger is not attached. Optionally, the analyzer can be instructed to throw an exception. The <paramref name="userMessage" /> parameter is passed to the debugger output. If <paramref name="userMessage" /> is not a constant string literal, tools may not be able to read it.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Checks for a condition; if the condition is false, follows the escalation policy set by the analyzer and displays the specified message.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />A message to display if the condition is not met.</param>
</Docs>
</Member>
<Member MemberName="Assume">
<MemberSignature Language="C#" Value="public static void Assume (bool condition);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Assume(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("DEBUG")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>At run time, using this method is equivalent to using the <see cref="M:System.Diagnostics.Contracts.Contract.Assert(System.Boolean)" /> method.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Instructs code analysis tools to assume that the specified condition is true, even if it cannot be statically proven to always be true.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to assume true.</param>
</Docs>
</Member>
<Member MemberName="Assume">
<MemberSignature Language="C#" Value="public static void Assume (bool condition, string userMessage);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Assume(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("DEBUG")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>If <paramref name="userMessage" /> is not a constant string literal, the contract may not be understood by tools.</para>
<para>At run time, using this method is equivalent to using the <see cref="M:System.Diagnostics.Contracts.Contract.Assert(System.Boolean,System.String)" /> method.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Instructs code analysis tools to assume that a condition is true, even if it cannot be statically proven to always be true, and displays a message if the assumption fails.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to assume true.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to post if the assumption fails.</param>
</Docs>
</Member>
<Member MemberName="ContractFailed">
<MemberSignature Language="C#" Value="public static event EventHandler<System.Diagnostics.Contracts.ContractFailedEventArgs> ContractFailed;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler`1<class System.Diagnostics.Contracts.ContractFailedEventArgs> ContractFailed" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler<System.Diagnostics.Contracts.ContractFailedEventArgs></ReturnType>
</ReturnValue>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The event information for this event is supplied by the <see cref="T:System.Diagnostics.Contracts.ContractFailedEventArgs" /> object that is passed to the event handler. This event notifies a managed application environment such as an interactive interpreter or a Web browser host that a contract has failed. Before doing so, it will raise an event that an application can handle as it sees fit. For example, if code is being run in a testing framework, you can log a test failure and then end the test. </para>
<para>The default implementation of the <see cref="M:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent(System.Diagnostics.Contracts.ContractFailureKind,System.String,System.String,System.Exception)" /> method in the .NET Framework class library is to call each handler that is registered with the <see cref="E:System.Diagnostics.Contracts.Contract.ContractFailed" /> event. Exceptions thrown by handlers are ignored, but each handler can indicate whether the failure is handled by calling the <see cref="M:System.Diagnostics.Contracts.ContractFailedEventArgs.SetHandled" /> method for the event arguments. If any handler sets the failure as handled, the method returns null and no further action is taken. Alternatively, handlers can call the <see cref="M:System.Diagnostics.Contracts.ContractFailedEventArgs.SetUnwind" /> method to instruct the code to unwind. In that case, an exception is thrown after all handlers have executed.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Occurs when a contract fails.</para>
</summary>
</Docs>
</Member>
<Member MemberName="EndContractBlock">
<MemberSignature Language="C#" Value="public static void EndContractBlock ();" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void EndContractBlock() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Most code already contains some parameter validation in the form of if-then-throw code. The contract tools recognize if-then-throw statements as preconditions when the statements appear first inside a method, and the entire set of such statements is followed by an explicit <see cref="T:System.Diagnostics.Contracts.Contract" /> method call, such as a <see cref="Overload:System.Diagnostics.Contracts.Contract.Requires" />, <see cref="Overload:System.Diagnostics.Contracts.Contract.Ensures" />, <see cref="Overload:System.Diagnostics.Contracts.Contract.EnsuresOnThrow" />, or <see cref="M:System.Diagnostics.Contracts.Contract.EndContractBlock" />.</para>
<para>When if-then-throw statements appear in this form, the contract tools recognize them as legacy-require statements. The <see cref="M:System.Diagnostics.Contracts.Contract.EndContractBlock" /> form is used only if no other contracts follow the if-then-throw sequences, but they should still be tagged as legacy-requires.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Marks the end of the contract section when a method's contracts contain only preconditions in the if-then-throw form.</para>
</summary>
</Docs>
</Member>
<Member MemberName="Ensures">
<MemberSignature Language="C#" Value="public static void Ensures (bool condition);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Ensures(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="condition" /> parameter specifies a postcondition that is expected to be true when the enclosing method or property returns normally.</para>
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>You must use the binary rewriter (available at <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site) for run-time enforcement of this postcondition. </para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a postcondition contract for the enclosing method or property.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test. The expression may include <see cref="M:System.Diagnostics.Contracts.Contract.OldValue``1(``0)" />, <see cref="M:System.Diagnostics.Contracts.Contract.ValueAtReturn``1(``0@)" />, and <see cref="M:System.Diagnostics.Contracts.Contract.Result``1" /> values. </param>
</Docs>
</Member>
<Member MemberName="Ensures">
<MemberSignature Language="C#" Value="public static void Ensures (bool condition, string userMessage);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Ensures(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="condition" /> parameter specifies a postcondition that is expected to be true when the enclosing method or property returns normally. </para>
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>You must use the binary rewriter (available at <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site) for run-time enforcement of this postcondition.</para>
</item>
<item>
<para>If <paramref name="userMessage" /> is not a constant string literal, the contract may not be understood by tools.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a postcondition contract for a provided exit condition and a message to display if the condition is false.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test. The expression may include <see cref="M:System.Diagnostics.Contracts.Contract.OldValue``1(``0)" /> and <see cref="M:System.Diagnostics.Contracts.Contract.Result``1" /> values. </param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to display if the expression is not true.</param>
</Docs>
</Member>
<Member MemberName="EnsuresOnThrow<TException>">
<MemberSignature Language="C#" Value="public static void EnsuresOnThrow<TException> (bool condition) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void EnsuresOnThrow<(class System.Exception) TException>(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="condition" /> parameter specifies a postcondition that is expected to be true when the enclosing method or property terminates abnormally and an exception of type <paramref name="TException" /> is thrown.</para>
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>You must use the binary rewriter for run-time enforcement of this postcondition.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a postcondition contract for the enclosing method or property, based on the provided exception and condition.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<typeparam name="TException">
<attribution license="cc4" from="Microsoft" modified="false" />The type of exception that invokes the postcondition check.</typeparam>
</Docs>
</Member>
<Member MemberName="EnsuresOnThrow<TException>">
<MemberSignature Language="C#" Value="public static void EnsuresOnThrow<TException> (bool condition, string userMessage) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void EnsuresOnThrow<(class System.Exception) TException>(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="condition" /> parameter specifies a postcondition that is expected to be true when the enclosing method or property terminates abnormally and an exception of type <paramref name="TException" /> is thrown. The <paramref name="message" /> parameter specifies a message to display if the condition is false.</para>
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>You must use the binary rewriter for run-time enforcement of this postcondition.</para>
</item>
<item>
<para>If <paramref name="userMessage" /> is not a constant string literal, the contract may not be understood by tools.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a postcondition contract and a message to display if the condition is false for the enclosing method or property, based on the provided exception and condition.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to display if the expression is false.</param>
<typeparam name="TException">
<attribution license="cc4" from="Microsoft" modified="false" />The type of exception that invokes the postcondition check.</typeparam>
</Docs>
</Member>
<Member MemberName="Exists">
<MemberSignature Language="C#" Value="public static bool Exists (int fromInclusive, int toExclusive, Predicate<int> predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Exists(int32 fromInclusive, int32 toExclusive, class System.Predicate`1<int32> predicate) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fromInclusive" Type="System.Int32" />
<Parameter Name="toExclusive" Type="System.Int32" />
<Parameter Name="predicate" Type="System.Predicate<System.Int32>" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="toExclusive" /> parameter is one more than the last integer to facilitate using the length of a range of integers starting at 0. For example, it would be set to 5 for integers 0 through 4.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Determines whether a specified test is true for any integer within a range of integers.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
true if <paramref name="predicate" /> returns true for any integer starting from <paramref name="fromInclusive" /> to <paramref name="toExclusive" /> - 1.</para>
</returns>
<param name="fromInclusive">
<attribution license="cc4" from="Microsoft" modified="false" />The first integer to pass to <paramref name="predicate" />.</param>
<param name="toExclusive">
<attribution license="cc4" from="Microsoft" modified="false" />One more than the last integer to pass to <paramref name="predicate" />.</param>
<param name="predicate">
<attribution license="cc4" from="Microsoft" modified="false" />The function to evaluate for any value of the integer in the specified range.</param>
</Docs>
</Member>
<Member MemberName="Exists<T>">
<MemberSignature Language="C#" Value="public static bool Exists<T> (System.Collections.Generic.IEnumerable<T> collection, Predicate<T> predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool Exists<T>(class System.Collections.Generic.IEnumerable`1<!!T> collection, class System.Predicate`1<!!T> predicate) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Parameters>
<Parameter Name="collection" Type="System.Collections.Generic.IEnumerable<T>" />
<Parameter Name="predicate" Type="System.Predicate<T>" />
</Parameters>
<Docs>
<remarks>This method can be used within a contract condition to allow contracts to be applied to collections.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Determines whether an element within a collection of elements exists within a function.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
true if and only if <paramref name="predicate" /> returns true for any element of type <paramref name="T" /> in <paramref name="collection" />.</para>
</returns>
<param name="collection">
<attribution license="cc4" from="Microsoft" modified="false" />The collection from which elements of type <paramref name="T" /> will be drawn to pass to <paramref name="predicate" />.</param>
<param name="predicate">
<attribution license="cc4" from="Microsoft" modified="false" />The function to evaluate for an element in <paramref name="collection" />.</param>
<typeparam name="T">
<attribution license="cc4" from="Microsoft" modified="false" />The type that is contained in <paramref name="collection" />.</typeparam>
</Docs>
</Member>
<Member MemberName="ForAll">
<MemberSignature Language="C#" Value="public static bool ForAll (int fromInclusive, int toExclusive, Predicate<int> predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool ForAll(int32 fromInclusive, int32 toExclusive, class System.Predicate`1<int32> predicate) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fromInclusive" Type="System.Int32" />
<Parameter Name="toExclusive" Type="System.Int32" />
<Parameter Name="predicate" Type="System.Predicate<System.Int32>" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>The <paramref name="toExclusive" /> parameter is one more than the last integer to facilitate using the length of a range of integers starting at 0. For example, it would be set to 5 for integers 0 through 4.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Determines whether a particular condition is valid for all integers in a specified range.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
true if <paramref name="predicate" /> returns true for all integers starting from <paramref name="fromInclusive" /> to <paramref name="toExclusive" /> - 1.</para>
</returns>
<param name="fromInclusive">
<attribution license="cc4" from="Microsoft" modified="false" />The first integer to pass to <paramref name="predicate" />.</param>
<param name="toExclusive">
<attribution license="cc4" from="Microsoft" modified="false" />One more than the last integer to pass to <paramref name="predicate" />.</param>
<param name="predicate">
<attribution license="cc4" from="Microsoft" modified="false" />The function to evaluate for the existence of the integers in the specified range.</param>
</Docs>
</Member>
<Member MemberName="ForAll<T>">
<MemberSignature Language="C#" Value="public static bool ForAll<T> (System.Collections.Generic.IEnumerable<T> collection, Predicate<T> predicate);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool ForAll<T>(class System.Collections.Generic.IEnumerable`1<!!T> collection, class System.Predicate`1<!!T> predicate) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Parameters>
<Parameter Name="collection" Type="System.Collections.Generic.IEnumerable<T>" />
<Parameter Name="predicate" Type="System.Predicate<T>" />
</Parameters>
<Docs>
<remarks>This method can be used within a contract condition to allow contracts to be applied to collections.</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Determines whether all the elements in a collection exist within a function.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
true if and only if <paramref name="predicate" /> returns true for all elements of type <paramref name="T" /> in <paramref name="collection" />.</para>
</returns>
<param name="collection">
<attribution license="cc4" from="Microsoft" modified="false" />The collection from which elements of type <paramref name="T" /> will be drawn to pass to <paramref name="predicate" />.</param>
<param name="predicate">
<attribution license="cc4" from="Microsoft" modified="false" />The function to evaluate for the existence of all the elements in <paramref name="collection" />.</param>
<typeparam name="T">
<attribution license="cc4" from="Microsoft" modified="false" />The type that is contained in <paramref name="collection" />.</typeparam>
</Docs>
</Member>
<Member MemberName="Invariant">
<MemberSignature Language="C#" Value="public static void Invariant (bool condition);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Invariant(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Diagnostics.Contracts.Contract.Invariant(System.Boolean)" /> contracts are contained within a method that is identified by the <see cref="T:System.Diagnostics.Contracts.ContractInvariantMethodAttribute" /> attribute; typically, the method is named ObjectInvariant.</para>
<list type="bullet">
<item>
<para>This contract can be specified only in a dedicated invariant method that is declared on a class. If the method is not sealed, it should refer only to protected members, not private members, so that subclasses can be sure to maintain the invariants.</para>
</item>
<item>
<para>This contract is not exposed to clients; therefore, it may reference members that are less visible than the enclosing method.</para>
</item>
<item>
<para>You must use the binary rewriter for run-time enforcement of this invariant.</para>
</item>
</list>
<para>Invariants are conditionally defined based on the presence of the CONTRACTS FULL symbol. During run-time checking, invariants are checked at the end of each public method. If an invariant mentions a public method in the same class, the invariant check that would normally happen at the end of that public method is disabled and checked only at the end of the outermost method call to that class. This also happens if the class is re-entered because of a call to a method on another class. </para>
<list type="bullet">
<item>
<para />
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies an invariant contract for the enclosing method or property. </para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
</Docs>
</Member>
<Member MemberName="Invariant">
<MemberSignature Language="C#" Value="public static void Invariant (bool condition, string userMessage);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Invariant(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>
<see cref="M:System.Diagnostics.Contracts.Contract.Invariant(System.Boolean,System.String)" /> contracts are contained within a method that is identified by the <see cref="T:System.Diagnostics.Contracts.ContractInvariantMethodAttribute" /> attribute; typically, the method is named ObjectInvariant.</para>
<list type="bullet">
<item>
<para>This contract can be specified only in a dedicated invariant method that is declared on a class.</para>
</item>
<item>
<para>This contract is not exposed to clients; therefore, it may reference members that are less visible than the enclosing method.</para>
</item>
<item>
<para>You must use the binary rewriter for run-time enforcement of this invariant.</para>
</item>
<item>
<para>Invariants are conditionally defined on the CONTRACTS FULL symbol. During run-time checking, invariants are checked at the end of each public method. If an invariant mentions a public method in the same class, the invariant check that would normally happen at the end of that public method is disabled and checked only at the end of the outermost method call to that class. This also happens if the class is re-entered because of a call to a method on another class.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies an invariant contract for the enclosing method or property, and displays a message if the condition for the contract fails.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to display if the condition is false.</param>
</Docs>
</Member>
<Member MemberName="OldValue<T>">
<MemberSignature Language="C#" Value="public static T OldValue<T> (T value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T OldValue<T>(!!T value) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>T</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Parameters>
<Parameter Name="value" Type="T" />
</Parameters>
<Docs>
<typeparam name="T">The type of the value.</typeparam>
<param name="value">The field or parameter of which to represent the initial value.</param>
<summary>Used within a postcondition to represent an initial value.</summary>
<returns>The initial value.</returns>
<remarks>The code contract rewriter tool must be used for this method to be effective. Otherwise the default value for the type is returned.</remarks>
</Docs>
</Member>
<Member MemberName="Requires">
<MemberSignature Language="C#" Value="public static void Requires (bool condition);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>Use this method instead of the <see cref="M:System.Diagnostics.Contracts.Contract.Requires``1(System.Boolean)" /> method when backward compatibility does not force you to throw a particular exception.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a precondition contract for the enclosing method or property.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
</Docs>
</Member>
<Member MemberName="Requires">
<MemberSignature Language="C#" Value="public static void Requires (bool condition, string userMessage);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>Use this method instead of the <see cref="M:System.Diagnostics.Contracts.Contract.Requires``1(System.Boolean,System.String)" /> method when backward compatibility does not force you to throw a particular exception.</para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a precondition contract for the enclosing method or property, and displays a message if the condition for the contract fails.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to display if the condition is false.</param>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<block subset="none" type="note">
<para>You must turn on run-time checking to use the <see cref="M:System.Diagnostics.Contracts.Contract.Requires``1(System.Boolean)" /> method. If run-time checking is turned off, the process will be terminated. To obtain the tools for runtime checking, see <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site. </para>
</block>
<list type="bullet">
<item>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>Use this method instead of the <see cref="M:System.Diagnostics.Contracts.Contract.Requires(System.Boolean)" /> method when you want to throw an exception if the precondition fails. </para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<typeparam name="TException">
<attribution license="cc4" from="Microsoft" modified="false" />The exception to throw if the condition is false.</typeparam>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition) where TException : Exception;" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<typeparam name="TException">The exception type that causes this precondition to be verified.</typeparam>
<param name="condition">The precondition to verify.</param>
<summary>Specifies a precondition contract for when an exception is thrown.</summary>
<remarks>All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.</remarks>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<typeparam name="TException">To be added.</typeparam>
<param name="condition">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
</Parameters>
<Docs>
<typeparam name="TException">To be added.</typeparam>
<param name="condition">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition, string userMessage) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<list type="bullet">
<item>
<block subset="none" type="note">
<para>You must turn on run-time checking to use the <see cref="M:System.Diagnostics.Contracts.Contract.Requires``1(System.Boolean,System.String)" /> method. If run-time checking is turned off, the process will be terminated. To obtain the tools for runtime checking, see <see cref="http://go.microsoft.com/fwlink/?LinkId=152461">Code Contracts</see> on the MSDN DevLabs Web site.</para>
</block>
<para>This method call must be at the beginning of a method or property, before any other code.</para>
</item>
<item>
<para>This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method.</para>
</item>
<item>
<para>Use this method instead of the <see cref="M:System.Diagnostics.Contracts.Contract.Requires(System.Boolean,System.String)" /> method when you want to throw an exception if the precondition fails. </para>
</item>
</list>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Specifies a precondition contract for the enclosing method or property, and throws an exception with the provided message if the condition for the contract fails.</para>
</summary>
<param name="condition">
<attribution license="cc4" from="Microsoft" modified="false" />The conditional expression to test.</param>
<param name="userMessage">
<attribution license="cc4" from="Microsoft" modified="false" />The message to display if the condition is false.</param>
<typeparam name="TException">
<attribution license="cc4" from="Microsoft" modified="false" />The exception to throw if the condition is false.</typeparam>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition, string userMessage) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<typeparam name="TException">To be added.</typeparam>
<param name="condition">To be added.</param>
<param name="userMessage">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition, string userMessage) where TException : Exception;" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<typeparam name="TException">The exception type that causes this precondition to be verified.</typeparam>
<param name="condition">The precondition to verify.</param>
<param name="userMessage">Message to display on contract failure.</param>
<summary>Specifies a precondition contract for when an exception is thrown.</summary>
<remarks>All code contract method calls must be at the beginning of the method or property. The code contract rewriter tool must be used to enable contracts to be verified at runtime.</remarks>
</Docs>
</Member>
<Member MemberName="Requires<TException>">
<MemberSignature Language="C#" Value="public static void Requires<TException> (bool condition, string userMessage) where TException : Exception;" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void Requires<(class System.Exception) TException>(bool condition, string userMessage) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="TException">
<Constraints>
<BaseTypeName>System.Exception</BaseTypeName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Parameters>
<Parameter Name="condition" Type="System.Boolean" />
<Parameter Name="userMessage" Type="System.String" />
</Parameters>
<Docs>
<typeparam name="TException">To be added.</typeparam>
<param name="condition">To be added.</param>
<param name="userMessage">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Result<T>">
<MemberSignature Language="C#" Value="public static T Result<T> ();" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T Result<T>() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>T</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Parameters />
<Docs>
<remarks>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>This method can be used only in the conditional expression for the <see cref="Overload:System.Diagnostics.Contracts.Contract.Ensures" /> contract.</para>
</remarks>
<summary>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Represents the return value of a method or property.</para>
</summary>
<returns>
<attribution license="cc4" from="Microsoft" modified="false" />
<para>Return value of the enclosing method or property.</para>
</returns>
<typeparam name="T">
<attribution license="cc4" from="Microsoft" modified="false" />Type of return value of the enclosing method or property.</typeparam>
</Docs>
</Member>
<Member MemberName="ValueAtReturn<T>">
<MemberSignature Language="C#" Value="public static T ValueAtReturn<T> (out T value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T ValueAtReturn<T>(!!T value) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>T</ReturnType>
</ReturnValue>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Parameters>
<Parameter Name="value" Type="T&" RefType="out" />
</Parameters>
<Docs>
<typeparam name="T">The type of the out parameter.</typeparam>
<param name="value">The out parameter.</param>
<summary>Used within a postcondition to represent the final value of an out parameter.</summary>
<returns>The final value of the out parameter.</returns>
<remarks>The code contract rewriter tool must be used for this method to be effective. Otherwise the default value for the type is returned in the out parameter and the return value.</remarks>
</Docs>
</Member>
</Members>
</Type>
|