次の方法で共有


CompositionContainer.ReleaseExport Method (Export)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Releases the specified Export object from the CompositionContainer.

Namespace:  System.ComponentModel.Composition.Hosting
Assembly:  System.ComponentModel.Composition (in System.ComponentModel.Composition.dll)

Syntax

'Declaration
Public Sub ReleaseExport ( _
    export As Export _
)
public void ReleaseExport(
    Export export
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

export is nulla null reference (Nothing in Visual Basic).

Remarks

The behavior of this method may vary depending on the implementation of the ExportProvider that produced the Export instance. As a rule, non-shared exports should be detached from the container.

For example, the CatalogExportProvider will only release an Export if it comes from a ComposablePart that was constructed under a NonShared context. Release in this context means walking the dependency chain of the Export objects, detaching references from the container and calling Dispose on the ComposablePart objects as needed. If the Export was constructed under a Shared context the CatalogExportProvider will do nothing, as the specified Export may being used by other requestors. Those will only be detached when the container is itself disposed.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.