Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IExtension<T>.Detach Method

Enables an object to find out when it is no longer aggregated. Called when an extension is removed from the IExtensibleObject<T>.Extensions property.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
void Detach(
	T owner
)

Parameters

owner
Type: T

The extensible object that aggregates this extension.

Use the Detach 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 System.InvalidOperationException 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 System.ServiceModel.ICommunicationObject events or implement the appropriate interfaces (for System.ServiceModel.OperationContext) to observe the lifecycle of the owner.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft. All rights reserved.