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++]

Metadata

Windows.winmd

請參閱

檔案選擇器範例
快速入門:使用檔案選擇器存取檔案
fileSavePicker.fileTypeChoices property

 

 

顯示:
© 2015 Microsoft