MapContainer Generic Class

Contains a map. A MapContainer wraps a map value, to provide a mutable version of Map. The Map type itself is immutable. See Map for more details on the Map type.

Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
[DefaultMemberAttribute("Item")] 
public class MapContainer<D,R> : IDictionary<D,R>, ICollection<KeyValuePair<D,R>>, 
    IEnumerable<KeyValuePair<D,R>>, IEnumerable

GenericParameters

  • D
    Key type param
  • R
    Element type param

Remarks

MapContainers provide most of the Map operations, and are a wrapper for Map. An important difference is that a MapContainer is mutable, while a Map is immutable. Since MapContainer is a mutable type, equality is determined by equality of object reference. MapContainers do not directly support LINQ expressions, as transforming a container would result in a new object reference.

To transform the content of a MapContainer using a LINQ query, use Transform, which works on the map value contained in the MapContainer.

This type is implemented as a wrapper around an instance of the Map that actually creates a new instance of Map and updates a reference as if the original Map instance had been changed.

It replicates the interfaces of Map, but slightly changes the signature.

Most methods returning a collection in Map are of type void because they modify the receiver instead of returning a new instance.

Inheritance Hierarchy

System.Object
  Microsoft.Modeling.MapContainer

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

See Also

Reference

MapContainer Members
Microsoft.Modeling Namespace
Map Generic Class