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 では、 長さ プロパティ、 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)

コレクションの指定したインデックス位置にファイル名拡張子を設定します。

適用対象

こちらもご覧ください