﻿<?xml version="1.0" encoding="utf-8"?><Type Name="ContractOptionAttribute" FullName="System.Diagnostics.Contracts.ContractOptionAttribute"><TypeSignature Language="C#" Value="public sealed class ContractOptionAttribute : Attribute" /><TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ContractOptionAttribute extends System.Attribute" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>System.Attribute</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=true, Inherited=false)</AttributeName></Attribute><Attribute><AttributeName>System.Diagnostics.Conditional("CONTRACTS_FULL")</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The following table shows the currently supported options.</para><list type="table"><listheader><item><term><para>Category</para></term><description><para>Setting</para></description><description><para>Value/effect</para></description></item></listheader><item><term><para>contract</para></term><description><para>inheritance</para></description><description><para>true to turn contract inheritance on; false to turn it off.  The default is true.</para></description></item><item><term><para>runtime</para></term><description><para>checking</para></description><description><para>true to turn run-time checking on; false to turn it off. The default is true.</para></description></item></list><para>You can use this attribute as illustrated in the following examples.</para><para>To turn off run-time checking for the entire assembly:</para><code>[assembly:ContractOption("runtime", "checking", false)]</code><para>To turn run-time contract checking on for a specific type:</para><code>   [ContractOption("runtime", "checking", true)]
   class TypeWithRuntimeChecking {
 
       ...
</code><para>To turn run-time checking off for a specific method:</para><code>// Turn off all contract inheritance from interface IList&lt;T&gt;
[ContractOption("contract", "inheritance", false)]
class MyConcurrentList&lt;T&gt; : IList&lt;T&gt; {
   ...
}
 
[ContractOption("runtime", "checking", false)]
public override MyMethod(int x) {
   // no inherited contracts checked at runtime,
   // no invariants checked at runtime.
   ...
}
  
       [ContractOption("runtime", "checking", false)]
       public void MethodWithoutRuntimeChecking(...) {
          ...
       }
   }
</code></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Enables you to set contract and tool options at assembly, type, or method granularity.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public ContractOptionAttribute (string category, string setting, bool enabled);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string category, string setting, bool enabled) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="category" Type="System.String" /><Parameter Name="setting" Type="System.String" /><Parameter Name="enabled" Type="System.Boolean" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Diagnostics.Contracts.ContractOptionAttribute" /> class by using the provided category, setting, and enable/disable value.</para></summary><param name="category"><attribution license="cc4" from="Microsoft" modified="false" />The category for the option to be set.</param><param name="setting"><attribution license="cc4" from="Microsoft" modified="false" />The option setting.</param><param name="enabled"><attribution license="cc4" from="Microsoft" modified="false" />true to enable the option; false to disable the option.</param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public ContractOptionAttribute (string category, string setting, string value);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string category, string setting, string value) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="category" Type="System.String" /><Parameter Name="setting" Type="System.String" /><Parameter Name="value" Type="System.String" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>There are only two category/setting options, and they can be set by either of the constructor overloads. You can use this overload with the same settings as the <see cref="M:System.Diagnostics.Contracts.ContractOptionAttribute.#ctor(System.String,System.String,System.Boolean)" /> overload by specifying "true" or "false" in string format; for example:</para><code>[ContractOption("contract", "inheritance", “false”)]
class MyConcurrentList&lt;T&gt; : IList&lt;T&gt; {
   ...
}
</code></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Diagnostics.Contracts.ContractOptionAttribute" /> class by using the provided category, setting, and value.</para></summary><param name="category"><attribution license="cc4" from="Microsoft" modified="false" />The category of the option to be set.</param><param name="setting"><attribution license="cc4" from="Microsoft" modified="false" />The option setting.</param><param name="value"><attribution license="cc4" from="Microsoft" modified="false" />The value for the setting.</param></Docs></Member><Member MemberName="Category"><MemberSignature Language="C#" Value="public string Category { get; }" /><MemberSignature Language="ILAsm" Value=".property instance string Category" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the category of the option.</para></summary></Docs></Member><Member MemberName="Enabled"><MemberSignature Language="C#" Value="public bool Enabled { get; }" /><MemberSignature Language="ILAsm" Value=".property instance bool Enabled" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Determines if an option is enabled.</para></summary></Docs></Member><Member MemberName="Setting"><MemberSignature Language="C#" Value="public string Setting { get; }" /><MemberSignature Language="ILAsm" Value=".property instance string Setting" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the setting for the option.</para></summary></Docs></Member><Member MemberName="Value"><MemberSignature Language="C#" Value="public string Value { get; }" /><MemberSignature Language="ILAsm" Value=".property instance string Value" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the value for the option.</para></summary></Docs></Member></Members></Type>