C# Class NUnit.Framework.Internal.PropertyBag

A PropertyBag represents a collection of name value pairs that allows duplicate entries with the same key. Methods are provided for adding a new pair as well as for setting a key to a single value. All keys are strings but _values may be of any type. Null _values are not permitted, since a null entry represents the absence of the key.
Inheritance: IPropertyBag
Afficher le fichier Open project: nunit/nunit Class Usage Examples

Méthodes publiques

Méthode Description
Add ( string key, object value ) : void

Adds a key/value pair to the property set

AddToXml ( TNode parentNode, bool recursive ) : TNode

Returns an XmlNode representing the PropertyBag after adding it as a child of the supplied parent node.

ContainsKey ( string key ) : bool

Gets a flag indicating whether the specified key has any entries in the property set.

Get ( string key ) : object

Gets a single value for a key, using the first one if multiple _values are present and returning null if the value is not found.

Set ( string key, object value ) : void

Sets the value for a key, removing any other _values that are already in the property set.

ToXml ( bool recursive ) : TNode

Returns an XmlNode representing the current PropertyBag.

this ( string key ) : IList

Gets or sets the list of _values for a particular key

Method Details

Add() public méthode

Adds a key/value pair to the property set
public Add ( string key, object value ) : void
key string The key
value object The value
Résultat void

AddToXml() public méthode

Returns an XmlNode representing the PropertyBag after adding it as a child of the supplied parent node.
public AddToXml ( TNode parentNode, bool recursive ) : TNode
parentNode TNode The parent node.
recursive bool Not used
Résultat TNode

ContainsKey() public méthode

Gets a flag indicating whether the specified key has any entries in the property set.
public ContainsKey ( string key ) : bool
key string The key to be checked
Résultat bool

Get() public méthode

Gets a single value for a key, using the first one if multiple _values are present and returning null if the value is not found.
public Get ( string key ) : object
key string
Résultat object

Set() public méthode

Sets the value for a key, removing any other _values that are already in the property set.
public Set ( string key, object value ) : void
key string
value object
Résultat void

ToXml() public méthode

Returns an XmlNode representing the current PropertyBag.
public ToXml ( bool recursive ) : TNode
recursive bool Not used
Résultat TNode

this() public méthode

Gets or sets the list of _values for a particular key
public this ( string key ) : IList
key string
Résultat IList