SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | Private Attributes | List of all members
Seci.BlockDictionary Class Reference

Specialised version of the Dictionary class which can be converted to XML. Also has some additional standard List-like functionality. The dictionary keys will be lower case, this will make it easier to make OpenGENIE calls case insensitive. More...

Inheritance diagram for Seci.BlockDictionary:
Inheritance graph
Collaboration diagram for Seci.BlockDictionary:
Collaboration graph

Public Member Functions

Boolean Add (String blockName, BlockInfo block)
 Wrapper for standard Dictionary "Add", but with additional checks: i) the key is not "" or null, ii) alias name is unique and iii) key is unique. All keys are lowercase. More...
 
void Clear ()
 Wrapper for standard Dictionary "Clear" More...
 
object Clone ()
 Clone - Default method of ICloneable Used to clone (deep copy) the block dictionary. This allows for cancelling when editing the blocks. More...
 
Boolean Contains (String blockName)
 Wrapper for standard Dictionary "Contains" All keys are lowercase. More...
 
String[] GetKeys ()
 Gets a list of all the keys in the dictionary. More...
 
System.Xml.Schema.XmlSchema GetSchema ()
 GetSchema - Default method of IXmlSerializable Not used. More...
 
void Insert (int index, String blockName, BlockInfo block)
 
Boolean IsAliasUnique (String alias)
 Checks that the alias for the Block is unique. Note: Ignores case. More...
 
void ReadXml (System.Xml.XmlReader reader)
 ReadXml - Default method of IXmlSerializable Used to read the block information from the configuration files and add it to the dictionary. The standard deserialisation method was not suitable for this. More...
 
void Remove (String blockName)
 Wrapper for standard Dictionary "Remove" which removes by key. More...
 
void RemoveAt (int index)
 Remove a block by index number, like a standard List. Looks up the key then calls remove by key. More...
 
void RemoveByVI (String fileName)
 Remove block(s) by VI - may be more than one block. Used when a VI is removed from a configuration. More...
 
Boolean Replace (String oldName, String newName, BlockInfo newBlock)
 Method for replacing a block in the dictionary. Keeps the existing key. First removes the old block, then inserts the new block More...
 
void Swap (int index1, int index2)
 Swap the order of two blocks More...
 
void WriteXml (System.Xml.XmlWriter writer)
 WriteXml - Default method of IXmlSerializable Used to write the block information to the configuration file. The standard serialisation method was not suitable for this, as it cannot serialise dictionaries automatically. More...
 

Properties

int Count [get]
 
BlockInfo this[int index] [get, set]
 Property for accessing the Blocks by index, like a standard List. Looks up the key corresponding to the index then accessed Dictionary via the key. On get() it returns null if the block does not exist. More...
 
BlockInfo this[string name] [get, set]
 Property for accessing the Blocks by name. On get() it returns null if the block does not exist. More...
 

Private Attributes

OrderedDictionary _dict = new OrderedDictionary()
 

Detailed Description

Specialised version of the Dictionary class which can be converted to XML. Also has some additional standard List-like functionality. The dictionary keys will be lower case, this will make it easier to make OpenGENIE calls case insensitive.

Definition at line 18 of file BlockDictionary.cs.

Member Function Documentation

Boolean Seci.BlockDictionary.Add ( String  blockName,
BlockInfo  block 
)
inline

Wrapper for standard Dictionary "Add", but with additional checks: i) the key is not "" or null, ii) alias name is unique and iii) key is unique. All keys are lowercase.

Parameters
blockNameThe name of the block, used as the key
blockThe BlockInfo
Returns
Result

Definition at line 88 of file BlockDictionary.cs.

References Seci.Definitions.BlockInfo.Alias, and Seci.BlockDictionary.IsAliasUnique().

Here is the call graph for this function:

void Seci.BlockDictionary.Clear ( )
inline

Wrapper for standard Dictionary "Clear"

Definition at line 234 of file BlockDictionary.cs.

object Seci.BlockDictionary.Clone ( )
inline

Clone - Default method of ICloneable Used to clone (deep copy) the block dictionary. This allows for cancelling when editing the blocks.

Returns
Object which needs casting to BlockDictionary

Definition at line 685 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict.

Referenced by Seci.Managers.BlockMgr.GetBlocksClone().

Boolean Seci.BlockDictionary.Contains ( String  blockName)
inline

Wrapper for standard Dictionary "Contains" All keys are lowercase.

Parameters
blockNameThe name of the block, used as the key
Returns
Result

Definition at line 197 of file BlockDictionary.cs.

Referenced by Seci.Managers.AlertsMgr.GetAlertsCopyForSaving(), Seci.BlockDictionary.Replace(), and Seci.Remoting.Bridge.SetBlockValue().

String [] Seci.BlockDictionary.GetKeys ( )
inline

Gets a list of all the keys in the dictionary.

Returns
String array containing all the block names (lower case)

Definition at line 359 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict.

Referenced by Seci.BlockDictionary.Replace().

System.Xml.Schema.XmlSchema Seci.BlockDictionary.GetSchema ( )
inline

GetSchema - Default method of IXmlSerializable Not used.

Returns

Definition at line 614 of file BlockDictionary.cs.

void Seci.BlockDictionary.Insert ( int  index,
String  blockName,
BlockInfo  block 
)
inline

Definition at line 116 of file BlockDictionary.cs.

References Seci.Definitions.BlockInfo.Alias, and Seci.BlockDictionary.IsAliasUnique().

Here is the call graph for this function:

Boolean Seci.BlockDictionary.IsAliasUnique ( String  alias)
inline

Checks that the alias for the Block is unique. Note: Ignores case.

Parameters
aliasThe name of the alias
Returns
True if unique

Definition at line 213 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict, and Seci.Definitions.BlockInfo.Alias.

Referenced by Seci.BlockDictionary.Add(), Seci.BlockDictionary.Insert(), and Seci.BlockDictionary.Replace().

void Seci.BlockDictionary.ReadXml ( System.Xml.XmlReader  reader)
inline

ReadXml - Default method of IXmlSerializable Used to read the block information from the configuration files and add it to the dictionary. The standard deserialisation method was not suitable for this.

Parameters
readerThe XML reader

Definition at line 625 of file BlockDictionary.cs.

void Seci.BlockDictionary.Remove ( String  blockName)
inline

Wrapper for standard Dictionary "Remove" which removes by key.

Parameters
blockNameThe name of the block to remove

Definition at line 283 of file BlockDictionary.cs.

Referenced by Seci.BlockDictionary.Replace().

void Seci.BlockDictionary.RemoveAt ( int  index)
inline

Remove a block by index number, like a standard List. Looks up the key then calls remove by key.

Parameters
indexThe index of the block to remove

Definition at line 293 of file BlockDictionary.cs.

void Seci.BlockDictionary.RemoveByVI ( String  fileName)
inline

Remove block(s) by VI - may be more than one block. Used when a VI is removed from a configuration.

Parameters
fileNameThe full filepath of the VI

Definition at line 330 of file BlockDictionary.cs.

Boolean Seci.BlockDictionary.Replace ( String  oldName,
String  newName,
BlockInfo  newBlock 
)
inline

Method for replacing a block in the dictionary. Keeps the existing key. First removes the old block, then inserts the new block

Parameters
oldNameThe name of the block to be replaced
newNameThe name of the new block (used as key)
newBlockThe new BlockInfo
Returns
Result

Definition at line 146 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict, Seci.Definitions.BlockInfo.Alias, Seci.Definitions.BlockInfo.BlockName, Seci.BlockDictionary.Contains(), Seci.BlockDictionary.GetKeys(), Seci.BlockDictionary.IsAliasUnique(), and Seci.BlockDictionary.Remove().

Here is the call graph for this function:

void Seci.BlockDictionary.Swap ( int  index1,
int  index2 
)
inline

Swap the order of two blocks

Parameters
index1The index of the first block
index2The index of the second block

Definition at line 305 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict.

void Seci.BlockDictionary.WriteXml ( System.Xml.XmlWriter  writer)
inline

WriteXml - Default method of IXmlSerializable Used to write the block information to the configuration file. The standard serialisation method was not suitable for this, as it cannot serialise dictionaries automatically.

Parameters
writerThe XML writer

Definition at line 659 of file BlockDictionary.cs.

References Seci.BlockDictionary._dict.

Member Data Documentation

OrderedDictionary Seci.BlockDictionary._dict = new OrderedDictionary()
private

Property Documentation

int Seci.BlockDictionary.Count
get
BlockInfo Seci.BlockDictionary.this[int index]
getset

Property for accessing the Blocks by index, like a standard List. Looks up the key corresponding to the index then accessed Dictionary via the key. On get() it returns null if the block does not exist.

Parameters
indexThe index of the required block
Returns
The corresponding BlockInfo

Definition at line 58 of file BlockDictionary.cs.

BlockInfo Seci.BlockDictionary.this[string name]
getset

Property for accessing the Blocks by name. On get() it returns null if the block does not exist.

Parameters
nameThe name of the required block (case insensitive)
Returns
The requested BlockInfo

Definition at line 29 of file BlockDictionary.cs.


The documentation for this class was generated from the following file: