﻿<?xml version="1.0" encoding="utf-8"?><Type Name="ClassInterfaceAttribute" FullName="System.Runtime.InteropServices.ClassInterfaceAttribute"><TypeSignature Maintainer="auto" Language="C#" Value="public sealed class ClassInterfaceAttribute : Attribute" /><TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ClassInterfaceAttribute extends System.Attribute" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Base><BaseTypeName>System.Attribute</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.All, Inherited=false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>You can apply this attribute to assemblies or classes.</para><para>This attribute controls whether the Type Library Exporter (Tlbexp.exe) automatically generates a class interface for the attributed class. A class interface carries the same name as the class itself, but the name is prefixed with an underscore. When exposed, the class interface contains all the public, non- static members of the managed class, including members inherited from its base class. Managed classes cannot access a class interface and have no need to as they can access the class members directly. Tlbexp.exe generates a unique interface identifier (IID) for the class interface.</para><para>Class interfaces can be dual or dispatch-only interfaces. Optionally, you can suppress the generation of the class interface and provide a custom interface instead. You expose or suppress a class interface by specifying a <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration member. When you apply <see cref="T:System.Runtime.InteropServices.ClassInterfaceAttribute" /> to an assembly, the attribute pertains to all classes in the assembly unless the individual classes override the setting with their own attribute.</para><para>Although class interfaces eliminate the task of explicitly defining interfaces for each class, their use in production applications is strongly discouraged. Dual class interfaces allow clients to bind to a specific interface layout that is subject to change as the class evolves. For example, consider a managed class that exposes a class interface to COM clients. The first version of the class contains methods North and South. An unmanaged client can bind to the class interface, which provides North as the first method in the class interface and method South as the second method. Now consider the next version of the class, which has a new method, East, inserted between methods North and South. Unmanaged clients that try to bind to the new class through the old class interface end up calling method East when they intend to call method South, because the positioning of methods within the interface has changed. Moreover, any change to the layout of a base class also affects the layout of the class interface for all derived classes. Managed clients, which bind directly to classes, do not exhibit the same versioning problems. For specific guidelines on using a class interface, see <format type="text/html"><a href="733C0DD2-12E5-46E6-8DE1-39D5B25DF024">[&lt;topic://cpconintroducingclassinterface&gt;]</a></format>.</para><para>The <format type="text/html"><a href="EC0A8D63-11B3-4ACD-B398-DA1E37E97382">[&lt;topic://cpgrftypelibraryImportertlbimpexe&gt;]</a></format> always applies to imported classes the <see cref="F:System.Runtime.InteropServices.ClassInterfaceType.None" /> enumeration member to indicate that existing COM classes never expose managed interfaces.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public ClassInterfaceAttribute (short classInterfaceType);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int16 classInterfaceType) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="classInterfaceType" Type="System.Int16" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>This constructor takes an underlying 16-bit signed integer that represents each <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration member. The <format type="text/html"><a href="EC0A8D63-11B3-4ACD-B398-DA1E37E97382">[&lt;topic://cpgrftypelibraryImportertlbimpexe&gt;]</a></format> uses this constructor.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceAttribute" /> class with the specified <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration value.</para></summary><param name="classInterfaceType"><attribution license="cc4" from="Microsoft" modified="false" />Describes the type of interface that is generated for a class. </param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public ClassInterfaceAttribute (System.Runtime.InteropServices.ClassInterfaceType classInterfaceType);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Runtime.InteropServices.ClassInterfaceType classInterfaceType) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="classInterfaceType" Type="System.Runtime.InteropServices.ClassInterfaceType" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>For readable code that is less prone to error, always use this constructor.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceAttribute" /> class with the specified <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> enumeration member.</para></summary><param name="classInterfaceType"><attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> values that describes the type of interface that is generated for a class. </param></Docs></Member><Member MemberName="Value"><MemberSignature Language="C#" Value="public System.Runtime.InteropServices.ClassInterfaceType Value { get; }" /><MemberSignature Language="ILAsm" Value=".property instance valuetype System.Runtime.InteropServices.ClassInterfaceType Value" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Runtime.InteropServices.ClassInterfaceType</ReturnType></ReturnValue><Docs><value>To be added: an object of type 'ClassInterfaceType'</value><remarks>To be added</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the <see cref="T:System.Runtime.InteropServices.ClassInterfaceType" /> value that describes which type of interface should be generated for the class.</para></summary></Docs></Member></Members></Type>