Partilhar via


StringMap Classe

Definição

Uma coleção associativa, também conhecida como mapa ou dicionário.

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)
Herança
Object Platform::Object IInspectable StringMap
Atributos
Implementações
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>

Requisitos do Windows

Família de dispositivos
Windows 10 (introduzida na 10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduzida na v1.0)

Comentários

Essa classe permite que o JavaScript itere facilmente em uma coleção para a qual as cadeias de caracteres são o único valor esperado para chaves e valores.

Construtores

StringMap()

Cria e inicializa uma nova instância do StringMap.

Propriedades

Size

Obtém o número de itens no mapa.

Métodos

Clear()

Remove todos os itens do mapa.

First()

Retorna um iterador que contém os itens na coleção.

GetView()

Retorna uma exibição imutável do mapa.

HasKey(String)

Determina se o mapa contém a chave especificada.

Insert(String, String)

Insere ou substitui um item no mapa.

Lookup(String)

Retorna o item na chave especificada no mapa.

Remove(String)

Remove um item do mapa.

Eventos

MapChanged

Ocorre quando o conteúdo do mapa é alterado.

Aplica-se a

Confira também