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

在地图内容更改时发生。

适用于

另请参阅