Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
145 lines (133 sloc) 7.78 KB
<Type Name="IExtension&lt;T&gt;" FullName="System.ServiceModel.IExtension&lt;T&gt;">
<TypeSignature Language="C#" Value="public interface IExtension&lt;T&gt; where T : IExtensibleObject&lt;T&gt;" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract IExtension`1&lt;(class System.ServiceModel.IExtensibleObject`1&lt;!T&gt;) T&gt;" />
<TypeSignature Language="DocId" Value="T:System.ServiceModel.IExtension`1" />
<TypeSignature Language="VB.NET" Value="Public Interface IExtension(Of T)" />
<TypeSignature Language="C++ CLI" Value="generic &lt;typename T&gt;&#xA; where T : IExtensibleObject&lt;T&gt;public interface class IExtension" />
<TypeSignature Language="F#" Value="type IExtension&lt;'T (requires 'T :&gt; IExtensibleObject&lt;'T&gt;)&gt; = interface" />
<AssemblyInfo>
<AssemblyName>System.ServiceModel</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ServiceModel.Primitives</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.5.0.1</AssemblyVersion>
<AssemblyVersion>4.5.0.3</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="T">
<Constraints>
<InterfaceName>System.ServiceModel.IExtensibleObject&lt;T&gt;</InterfaceName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Interfaces />
<Docs>
<typeparam name="T">The object that participates in the custom behavior.</typeparam>
<summary>Enables an object to extend another object through aggregation.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
WCF allows you to extend <xref:System.ServiceModel.IExtensibleObject%601?displayProperty=nameWithType> objects (the <xref:System.ServiceModel.IContextChannel?displayProperty=nameWithType>, <xref:System.ServiceModel.ServiceHost?displayProperty=nameWithType>, <xref:System.ServiceModel.InstanceContext?displayProperty=nameWithType>, and <xref:System.ServiceModel.OperationContext?displayProperty=nameWithType> classes) by adding a new state or behavior by using its extensible object pattern. The extensible object pattern is used in WCF to either extend existing run-time classes with new functionality or to add new state features to an object.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName="Attach">
<MemberSignature Language="C#" Value="public void Attach (T owner);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Attach(!T owner) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ServiceModel.IExtension`1.Attach(`0)" />
<MemberSignature Language="VB.NET" Value="Public Sub Attach (owner As T)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Attach(T owner);" />
<MemberSignature Language="F#" Value="abstract member Attach : 'T -&gt; unit" Usage="iExtension.Attach owner" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ServiceModel</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ServiceModel.Primitives</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.5.0.1</AssemblyVersion>
<AssemblyVersion>4.5.0.3</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="owner" Type="T" />
</Parameters>
<Docs>
<param name="owner">The extensible object that aggregates this extension.</param>
<summary>Enables an extension object to find out when it has been aggregated. Called when the extension is added to the <see cref="P:System.ServiceModel.IExtensibleObject`1.Extensions" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this method to keep track of the <xref:System.ServiceModel.IExtensibleObject%601> object to which the current instance of the extension belongs. This call gives extensions a chance to handle events or inspect properties of their owner.
## Examples
The following example code shows how this method can be used to keep track of the <xref:System.ServiceModel.IExtensibleObject%601> object to which the current instance of the extension belongs.
```csharp
InstanceContext owner;
public void Attach(InstanceContext owner)
{
this.owner = owner;
}
```
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Detach">
<MemberSignature Language="C#" Value="public void Detach (T owner);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Detach(!T owner) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ServiceModel.IExtension`1.Detach(`0)" />
<MemberSignature Language="VB.NET" Value="Public Sub Detach (owner As T)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Detach(T owner);" />
<MemberSignature Language="F#" Value="abstract member Detach : 'T -&gt; unit" Usage="iExtension.Detach owner" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.ServiceModel</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ServiceModel.Primitives</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.5.0.1</AssemblyVersion>
<AssemblyVersion>4.5.0.3</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="owner" Type="T" />
</Parameters>
<Docs>
<param name="owner">The extensible object that aggregates this extension.</param>
<summary>Enables an object to find out when it is no longer aggregated. Called when an extension is removed from the <see cref="P:System.ServiceModel.IExtensibleObject`1.Extensions" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.ServiceModel.IExtension%601.Detach%2A> method to find out when the extension has been removed. An extension can use this to unhook events on the extensible object. An extension can also throw <xref:System.InvalidOperationException?displayProperty=nameWithType> from this method to indicate that, once added, the extension cannot be removed.
Note that this method is not called when the owner object is disposed or closed. If needed, it is up to the extension or the code adding the extension to hook the appropriate <xref:System.ServiceModel.ICommunicationObject?displayProperty=nameWithType> events or implement the appropriate interfaces (for <xref:System.ServiceModel.OperationContext?displayProperty=nameWithType>) to observe the lifecycle of the owner.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.