Represents a random-access collection of file name extensions.
Syntax
var fileExtensionVector = fileOpenPicker.fileTypeFilter; var fileExtensionVector = folderPicker.fileTypeFilter;
Attributes
- VersionAttribute(NTDDI_WIN8)
Members
The FileExtensionVector class has these types of members:
Methods
The FileExtensionVector class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| Append [C++, JavaScript] | Appends a file name extension to the end of the collection. |
| Clear | Removes all file name extensions from the collection. |
| Contains [C#, VB] | Determines whether an element is in the collection. |
| CopyTo [C#, VB] | Copies the elements of the collection to an array, starting at a particular array index. |
| First [C++, JavaScript] | Retrieves an iterator that iterates through the file name extensions in the collection. |
| GetAt [C++, JavaScript] | Retrieves the file name extension at the specified index in the collection. |
| GetEnumerator [C#, VB] | Returns an enumerator that iterates through a collection. |
| GetMany [C++, JavaScript] | Retrieves the file name extensions that start at the specified index in the collection. |
| GetView [C++, JavaScript] | Retrieves an immutable view of the collection of file name extensions. |
| IndexOf [C++, JavaScript] | Retrieves the index of a specified file name extension in the collection. |
| IndexOf [C#, VB] | Determines the index of a specific item in the collection. |
| Insert [C#, VB] | Inserts an item into the collection at the specified index. |
| InsertAt [C++, JavaScript] | Inserts a file name extension into a collection at a specified index. |
| Remove [C#, VB] | Removes the first occurrence of a specific object from the collection. |
| RemoveAt [C++, JavaScript] | Removes the file name extension at the specified index in the collection. |
| RemoveAt [C#, VB] | Removes the element at the specified index of the collection. |
| RemoveAtEnd [C++, JavaScript] | Removes the last file name extension from the collection. |
| ReplaceAll [C++, JavaScript] | Replaces all file name extensions in the collection with the specified file name extensions. |
| SetAt [C++, JavaScript] | Sets the file name extension at the specified index of the collection. |
Properties
The FileExtensionVector class has these properties.
| Property | Access type | Description |
|---|---|---|
|
Count [C#, VB] | Read-only | Gets the number of elements actually contained in the collection. |
|
IsReadOnly [C#, VB] | Read-only | Gets a value indicating whether the collection is read-only. |
|
Item [C#, VB] | Read/write | Gets or sets the element at the specified index. |
|
Size [C++, JavaScript] | Read-only | Gets the number of file name extensions in the collection. |
Remarks
Collection member lists
For JavaScript, FileExtensionVector has the members shown in the member lists. In addition, FileExtensionVector supports a length property, members of Array.prototype, and using an index to access items.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
The File picker sample demonstrates how to specify the file types that the user can see and pick from in the file picker.
// Create the picker object and set options var openPicker = new Windows.Storage.Pickers.FileOpenPicker(); openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.thumbnail; openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary; // Users expect to have a filtered view of their folders depending on the scenario. // For example, when choosing a documents folder, restrict the filetypes to documents for your application. openPicker.fileTypeFilter.replaceAll([".png", ".jpg", ".jpeg"]);
The File picker sample demonstrates how to show files of any type in the file picker for the user to pick from.
var openPicker = new Windows.Storage.Pickers.FileOpenPicker(); openPicker.viewMode = Windows.Storage.Pickers.PickerViewMode.list; openPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary; openPicker.fileTypeFilter.replaceAll(["*"]);
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- File picker sample
- Quickstart: Accessing files with file pickers
- fileOpenPicker.fileTypeFilter property
- folderPicker.fileTypeFilter property
Build date: 2/25/2013