CollectionTransformation.Transform<TSourceCollection, TSourceElement, TTargetElement> 方法
命名空间: Microsoft.TeamFoundation.MVVM
程序集: Microsoft.TeamFoundation.Controls(在 Microsoft.TeamFoundation.Controls.dll 中)
语法
声明
<ExtensionAttribute> _
Public Shared Function Transform(Of TSourceCollection As {Class, Object, IEnumerable(Of TSourceElement), INotifyCollectionChanged}, TSourceElement, TTargetElement) ( _
sourceCollection As TSourceCollection, _
setup As Func(Of TSourceElement, TTargetElement), _
teardown As Action(Of TTargetElement) _
) As TransformedCollection(Of TSourceCollection, TSourceElement, TTargetElement)
public static TransformedCollection<TSourceCollection, TSourceElement, TTargetElement> Transform<TSourceCollection, TSourceElement, TTargetElement>(
this TSourceCollection sourceCollection,
Func<TSourceElement, TTargetElement> setup,
Action<TTargetElement> teardown
)
where TSourceCollection : class, Object, IEnumerable<TSourceElement>, INotifyCollectionChanged
类型参数
- TSourceCollection
- TSourceElement
- TTargetElement
参数
- sourceCollection
类型:TSourceCollection
- setup
类型:System.Func<TSourceElement, TTargetElement>
- teardown
类型:System.Action<TTargetElement>
返回值
类型:Microsoft.TeamFoundation.MVVM.TransformedCollection<TSourceCollection, TSourceElement, TTargetElement>
使用说明
在 Visual Basic 和 C# 中,可以在 TSourceCollection 类型的任何对象上将此方法作为实例方法来调用。当使用实例方法语法调用此方法时,请省略第一个参数。有关更多信息,请参见扩展方法 (Visual Basic)或扩展方法(C# 编程指南)。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。