共用方式為


StringMap 類別

定義

關聯集合,也稱為對應或字典。

public ref class StringMap sealed : IIterable<IKeyValuePair<Platform::String ^, Platform::String ^> ^>, IMap<Platform::String ^, Platform::String ^>, IObservableMap<Platform::String ^, Platform::String ^>
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.FoundationContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class StringMap final : IIterable<IKeyValuePair<winrt::hstring, winrt::hstring const&>>, IMap<winrt::hstring, winrt::hstring const&>, IObservableMap<winrt::hstring, winrt::hstring const&>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.FoundationContract")]
class StringMap final : IIterable<IKeyValuePair<winrt::hstring, winrt::hstring const&>>, IMap<winrt::hstring, winrt::hstring const&>, IObservableMap<winrt::hstring, winrt::hstring const&>
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.FoundationContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class StringMap : IDictionary<string,string>, IEnumerable<KeyValuePair<string,string>>, IObservableMap<string,string>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.FoundationContract")]
public sealed class StringMap : IDictionary<string,string>, IEnumerable<KeyValuePair<string,string>>, IObservableMap<string,string>
function StringMap()
Public NotInheritable Class StringMap
Implements IDictionary(Of String, String), IEnumerable(Of KeyValuePair(Of String, String)), IObservableMap(Of String, String)
繼承
Object Platform::Object IInspectable StringMap
屬性
實作
IMap<K,V> IDictionary<K,V> IMap<String,String> IDictionary<String,String> IMap<Platform::String,Platform::String> IMap<winrt::hstring,winrt::hstring> IIterable<IKeyValuePair<K,V>> IEnumerable<KeyValuePair<K,V>> IIterable<IKeyValuePair<String,String>> IEnumerable<KeyValuePair<String,String>> IIterable<IKeyValuePair<Platform::String,Platform::String>> IIterable<IKeyValuePair<winrt::hstring,winrt::hstring>> IObservableMap<String,String> IObservableMap<Platform::String,Platform::String> IObservableMap<winrt::hstring,winrt::hstring>

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.FoundationContract (已於 v1.0 引進)

備註

這個類別可讓 JavaScript 輕鬆地逐一查看集合,其中字串是索引鍵和值的唯一預期值。

建構函式

StringMap()

建立並初始化 StringMap 的新實例。

屬性

Size

取得地圖中的專案數。

方法

Clear()

從地圖中移除所有專案。

First()

傳回反覆運算器,其中包含集合中的專案。

GetView()

傳回地圖的不可變檢視。

HasKey(String)

判斷對應是否包含指定的索引鍵。

Insert(String, String)

插入或取代地圖中的專案。

Lookup(String)

傳回對應中指定索引鍵處的專案。

Remove(String)

從地圖中移除專案。

事件

MapChanged

發生于地圖內容變更時。

適用於

另請參閱