ImmutableArray<T>.CastArray<TOther> 方法

定义

通过将基础数组转换为 TOther 类型的数组,初始化 ImmutableArray<T> 结构的新实例。Initializes a new instance of the ImmutableArray<T> struct by casting the underlying array to an array of type TOther.

public:
generic <typename TOther>
 where TOther : class System::Collections::Immutable::ImmutableArray<TOther> CastArray();
public System.Collections.Immutable.ImmutableArray<TOther> CastArray<TOther> () where TOther : class;
member this.CastArray : unit -> System.Collections.Immutable.ImmutableArray<'Other (requires 'Other : null)> (requires 'Other : null)
Public Function CastArray(Of TOther As Class) () As ImmutableArray(Of TOther)

类型参数

TOther

返回

ImmutableArray<TOther>

异常

当转换非法时引发。Thrown if the cast is illegal.

适用于