ImmutableArray<T>.CastArray<TOther> 方法

定義

將基礎陣列轉換成 TOther 型別的陣列,以將 ImmutableArray<T> 結構的新執行個體初始化。

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>

不可變的陣列執行個體,其元素會轉換為新的類型。

例外狀況

轉換不合法。

適用於