Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.PropertyHandler.Properties Class Reference

An implementation of the Java Properties class. More...

Inheritance diagram for PushTechnology.DiffusionCore.PropertyHandler.Properties:

Public Member Functions

 Properties ()
 Creates an empty property list with no default values. More...
 
 Properties (IDictionary p)
 Creates a property list with the specified initial properties. More...
 
void Load (Stream stream)
 Reads a property list (key and element pairs) from the input stream. More...
 
void Load (TextReader textReader)
 Reads a property list (key and element pairs) from a text reader. More...
 
void Load (IDictionary dictionary, Stream stream)
 Reads a property list (key and element pairs) from the input stream. More...
 
void Load (IDictionary dictionary, TextReader textReader)
 Reads a property list (key and element pairs) from a text reader. More...
 
string GetProperty (string key)
 Searches for the property with the specified key in this property list. More...
 
string GetProperty (string key, string def)
 Searches for the property with the specified key in this property list. More...
 
void List (Stream stream)
 Writes this property list out to the specified stream. More...
 
void SetProperty (string key, string theValue)
 Sets the specified property key / value pair. More...
 
void Store (Stream stream, string header)
 Writes the properties in this instance out to the supplied stream. More...
 
override void Remove (object key)
 Removes the key / value pair identified by the supplied key. More...
 
override void Add (object key, object value)
 Adds/removes the specified key/object pair to this collection. More...
 

Properties

override object this[object key] [get, set]
 Adds/removes the specified key/object pair to this collection. More...
 

Detailed Description

An implementation of the Java Properties class.

For the complete syntax see java.util.Properties JavaDoc. This class supports an extended syntax. There may also be sole keys on a line, in that case values are treated as null.

key1 = value
key2:
key3

will result in the name/value pairs:

  • key1:="value"
  • key2:=string.Empty
  • key3:=<null>

note, that to specify a null value, the key must not be followed by any character except newline.

<author>Simon White</author>

Constructor & Destructor Documentation

PushTechnology.DiffusionCore.PropertyHandler.Properties.Properties ( )

Creates an empty property list with no default values.

PushTechnology.DiffusionCore.PropertyHandler.Properties.Properties ( IDictionary  p)

Creates a property list with the specified initial properties.

Parameters
pThe initial properties.

Member Function Documentation

override void PushTechnology.DiffusionCore.PropertyHandler.Properties.Add ( object  key,
object  value 
)

Adds/removes the specified key/object pair to this collection.

Parameters
keyThe key.
valueThe value.
string PushTechnology.DiffusionCore.PropertyHandler.Properties.GetProperty ( string  key)

Searches for the property with the specified key in this property list.

Parameters
keyThe key.
Returns
The property, or null if the key was not found.
string PushTechnology.DiffusionCore.PropertyHandler.Properties.GetProperty ( string  key,
string  def 
)

Searches for the property with the specified key in this property list.

Parameters
keyThe key.
defThe default value to be returned if the key is not found.
Returns
The property, or the default value.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.List ( Stream  stream)

Writes this property list out to the specified stream.

Parameters
streamThe stream to write to.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.Load ( Stream  stream)

Reads a property list (key and element pairs) from the input stream.

Parameters
streamThe stream to load from.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.Load ( TextReader  textReader)

Reads a property list (key and element pairs) from a text reader.

Parameters
textReaderThe text reader to load from.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.Load ( IDictionary  dictionary,
Stream  stream 
)

Reads a property list (key and element pairs) from the input stream.

Parameters
dictionarythe dictionary to put it in
streamThe stream to load from.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.Load ( IDictionary  dictionary,
TextReader  textReader 
)

Reads a property list (key and element pairs) from a text reader.

Parameters
dictionarythe dictionary to put it in
textReaderThe text reader to load from.
override void PushTechnology.DiffusionCore.PropertyHandler.Properties.Remove ( object  key)

Removes the key / value pair identified by the supplied key.

Parameters
keyThe key identifying the key / value pair to be removed.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.SetProperty ( string  key,
string  theValue 
)

Sets the specified property key / value pair.

Parameters
keyThe key.
theValueThe value.
void PushTechnology.DiffusionCore.PropertyHandler.Properties.Store ( Stream  stream,
string  header 
)

Writes the properties in this instance out to the supplied stream.

Parameters
streamThe stream to write to.
headerArbitrary header information.

Property Documentation

override object PushTechnology.DiffusionCore.PropertyHandler.Properties.this[object key]
getset

Adds/removes the specified key/object pair to this collection.