Share via


FileExtensionVector 類別

定義

表示副檔名的隨機存取集合。

public ref class FileExtensionVector sealed : IIterable<Platform::String ^>, IVector<Platform::String ^>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class FileExtensionVector final : IIterable<winrt::hstring>, IVector<winrt::hstring>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class FileExtensionVector final : IIterable<winrt::hstring>, IVector<winrt::hstring>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class FileExtensionVector : IEnumerable<string>, IList<string>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class FileExtensionVector : IEnumerable<string>, IList<string>
Public NotInheritable Class FileExtensionVector
Implements IEnumerable(Of String), IList(Of String)
繼承
Object Platform::Object IInspectable FileExtensionVector
屬性
實作
IEnumerable<String> IIterable<Platform::String> IIterable<winrt::hstring> IIterable<T> IEnumerable<T> IList<String> IVector<Platform::String> IVector<winrt::hstring>

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

檔案 選擇器範例 示範如何指定使用者可以在檔案選擇器中查看和挑選的檔案類型。

FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add("*");

備註

集合成員清單

針對 JavaScript,FileExtensionVector 具有成員清單中顯示的成員。 此外,FileExtensionVector 也支援 length 屬性、 Array.prototype的成員,以及使用索引來存取專案。

列舉 C# 或 Microsoft Visual Basic 中的集合

FileExtensionVector 是可列舉的,因此您可以使用 C# 中的 foreach 之類的語言特定語法來列舉集合中的專案。 編譯器會為您執行類型轉換,而且您不需要明確地轉換 。 IEnumerable<String> 如果您需要明確轉換,例如,如果您想要呼叫GetEnumerator,請使用String條件約束轉換成IEnumerable < T >

屬性

Size

取得集合中的副檔名數目。

方法

Append(String)

將副檔名附加至集合結尾。

Clear()

從集合中移除所有副檔名。

First()

擷取反覆運算器,逐一查看集合中的副檔名。

GetAt(UInt32)

擷取集合中指定索引處的副檔名。

GetMany(UInt32, String[])

擷取從集合中指定索引處開始的副檔名。

GetView()

擷取副檔名集合的不可變檢視。

IndexOf(String, UInt32)

擷取集合中指定副檔名的索引。

InsertAt(UInt32, String)

將副檔名插入集合中指定的索引處。

RemoveAt(UInt32)

移除集合中指定索引處的副檔名。

RemoveAtEnd()

從集合中移除姓氏副檔名。

ReplaceAll(String[])

以指定的副檔名取代集合中的所有副檔名。

SetAt(UInt32, String)

在集合的指定索引處設定副檔名。

適用於

另請參閱