FilePickerFileTypesOrderedMap Class

表示映射到关联文件类型(扩展名)的显示名称的集合。

语法


var filePickerFileTypesOrderedMap = fileSavePicker.fileTypeChoices;

特性

[Version(0x06020000)]

成员

FilePickerFileTypesOrderedMap类 具有这些类型的成员:

方法

The FilePickerFileTypesOrderedMap 类 具有这些方法。 对于 C#、Visual Basic 和 C++,它还继承方法于Object 类.

方法说明
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.

 

属性

FilePickerFileTypesOrderedMap类 具有这些属性。

属性访问类型说明

Count [C#, VB]

只读Gets the number of elements contained in the collection.

IsReadOnly [C#, VB]

只读Gets a value indicating whether the dictionary is read-only.

Item [C#, VB]

读/写Gets or sets the element value at the specified key index.

Keys [C#, VB]

只读Gets an ICollection object containing the keys of the FilePickerFileTypesOrderedMap.

Size [C++, JavaScript]

只读Gets the number of items in the mapped collection of display names and associated file types.

Values [C#, VB]

只读Gets an ICollection object containing the values of the FilePickerFileTypesOrderedMap .

 

备注

集合成员列表

对于 JavaScript,FilePickerFileTypesOrderedMap 支持使用索引访问项目。

示例

文件选择器示例演示如何使用显示名称添加文件类型选择。


// 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";


要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

命名空间

Windows.Storage.Pickers
Windows::Storage::Pickers [C++]

元数据

Windows.winmd

另请参见

文件选择器示例
快速入门:通过文件选择器访问文件
fileSavePicker.fileTypeChoices property

 

 

显示:
© 2015 Microsoft