ExportProvider.GetExportedValues Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets one or more exported objects.
Overloads
GetExportedValues<T>(String) |
Gets all the exported objects with the specified contract name. |
GetExportedValues<T>() |
Gets all the exported objects with the contract name derived from the specified type parameter. |
GetExportedValues<T>(String)
Gets all the exported objects with the specified contract name.
public:
generic <typename T>
System::Collections::Generic::IEnumerable<T> ^ GetExportedValues(System::String ^ contractName);
public System.Collections.Generic.IEnumerable<T> GetExportedValues<T> (string? contractName);
public System.Collections.Generic.IEnumerable<T> GetExportedValues<T> (string contractName);
member this.GetExportedValues : string -> seq<'T>
Public Function GetExportedValues(Of T) (contractName As String) As IEnumerable(Of T)
Type Parameters
- T
The type of the exported object to return.
Parameters
- contractName
- String
The contract name of the exported objects to return; or null
or an empty string ("") to use the default contract name.
Returns
The exported objects with the specified contract name, if found; otherwise, an empty Collection<T> object.
Exceptions
The CompositionContainer object has been disposed of.
One or more of the underlying exported values cannot be cast to T
.
An error occurred during composition. Errors will contain a collection of errors that occurred.
Remarks
The default contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
GetExportedValues<T>()
Gets all the exported objects with the contract name derived from the specified type parameter.
public:
generic <typename T>
System::Collections::Generic::IEnumerable<T> ^ GetExportedValues();
public System.Collections.Generic.IEnumerable<T> GetExportedValues<T> ();
member this.GetExportedValues : unit -> seq<'T>
Public Function GetExportedValues(Of T) () As IEnumerable(Of T)
Type Parameters
- T
The type of the exported object to return. The contract name is also derived from this type parameter.
Returns
The exported objects with the contract name derived from the specified type parameter, if found; otherwise, an empty Collection<T> object.
Exceptions
The CompositionContainer object has been disposed of.
One or more of the underlying exported objects cannot be cast to T
.
An error occurred during composition. Errors will contain a collection of errors that occurred.
Remarks
The contract name is the result of calling the GetContractName method on T
.
The contract name is compared by using the Ordinal property to perform a case-sensitive, non-linguistic comparison.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기