Represents a collection of display names mapped to the associated file types (extensions).
Syntax
var filePickerFileTypesOrderedMap = fileSavePicker.fileTypeChoices;
Attributes
- VersionAttribute(NTDDI_WIN8)
Members
The FilePickerFileTypesOrderedMap class has these types of members:
Methods
The FilePickerFileTypesOrderedMap class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| Add(KeyValuePair) [C#, VB] | Adds a new key-value pair to the FilePickerFileTypesOrderedMap. |
| Add(String) [C#, VB] | Adds an item to the FilePickerFileTypesOrderedMap. |
| Clear | Removes all display names and associated file name extensions from the collection. |
| Contains [C#, VB] | Returns a value that indicates whether a specified key-value pair exists in the FilePickerFileTypesOrderedMap. |
| ContainsKey [C#, VB] | Returns a value that indicates whether a specified key exists in the FilePickerFileTypesOrderedMap. |
| 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 display names and associated file types in the collection. |
| GetView [C++, JavaScript] | Returns an immutable view of the collection of display names and associated file types. |
| HasKey [C++, JavaScript] | Determines whether the mapped collection of display names and associated file types contains the specified key. |
| Insert [C++, JavaScript] | Inserts or replaces an item in the mapped collection of display names and associated file types. |
| Lookup [C++, JavaScript] | Returns the item at the specified key in the mapped collection of display names and associated file types. |
| Remove [C++, JavaScript] | Removes an item from the mapped collection of display names and associated file types. |
| Remove(KeyValuePair) [C#, VB] | Removes a specific key-value pair from the FilePickerFileTypesOrderedMap. |
| Remove(String) [C#, VB] | Removes a specific item from the FilePickerFileTypesOrderedMap. |
| TryGetValue [C#, VB] | Returns a value that indicates whether a specified key exists in the FilePickerFileTypesOrderedMap. If an item with that key exists, the item is retrieved as an out parameter. |
Properties
The FilePickerFileTypesOrderedMap class has these properties.
| Property | Access type | Description |
|---|---|---|
|
Count [C#, VB] | Read-only | Gets the number of elements contained in the collection. |
|
IsReadOnly [C#, VB] | Read-only | Gets a value indicating whether the dictionary is read-only. |
|
Item [C#, VB] | Read/write | Gets or sets the element value at the specified key index. |
|
Keys [C#, VB] | Read-only | Gets an ICollection object containing the keys of the FilePickerFileTypesOrderedMap. |
|
Size [C++, JavaScript] | Read-only | Gets the number of items in the mapped collection of display names and associated file types. |
|
Values [C#, VB] | Read-only | Gets an ICollection object containing the values of the FilePickerFileTypesOrderedMap . |
Remarks
Collection member lists
For JavaScript, FilePickerFileTypesOrderedMap supports using an index to access items.
Examples
The File picker sample demonstrates how to add file type choices with a display name.
// Create the picker object and set options var savePicker = new Windows.Storage.Pickers.FileSavePicker(); savePicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary; // Dropdown of file types the user can save the file as savePicker.fileTypeChoices.insert("Plain Text", [".txt"]); // Default file name if the user does not type one in or select a file to replace savePicker.suggestedFileName = "New Document";
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
- File picker sample
- Quickstart: Accessing files with file pickers
- fileSavePicker.fileTypeChoices property
Build date: 2/25/2013