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
Show file Open project: nunit/nunit Class Usage Examples

Public Methods

Method 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 method

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

AddToXml() public method

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
return TNode

ContainsKey() public method

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
return bool

Get() public method

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
return object

Set() public method

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
return void

ToXml() public method

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

this() public method

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