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...
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() |
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.
|
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.
blockName | The name of the block, used as the key |
block | The BlockInfo |
Definition at line 88 of file BlockDictionary.cs.
References Seci.Definitions.BlockInfo.Alias, and Seci.BlockDictionary.IsAliasUnique().
|
inline |
Wrapper for standard Dictionary "Clear"
Definition at line 234 of file BlockDictionary.cs.
|
inline |
Clone - Default method of ICloneable Used to clone (deep copy) the block dictionary. This allows for cancelling when editing the blocks.
Definition at line 685 of file BlockDictionary.cs.
References Seci.BlockDictionary._dict.
Referenced by Seci.Managers.BlockMgr.GetBlocksClone().
|
inline |
Wrapper for standard Dictionary "Contains" All keys are lowercase.
blockName | The name of the block, used as the key |
Definition at line 197 of file BlockDictionary.cs.
Referenced by Seci.Managers.AlertsMgr.GetAlertsCopyForSaving(), Seci.BlockDictionary.Replace(), and Seci.Remoting.Bridge.SetBlockValue().
|
inline |
Gets a list of all the keys in the dictionary.
Definition at line 359 of file BlockDictionary.cs.
References Seci.BlockDictionary._dict.
Referenced by Seci.BlockDictionary.Replace().
|
inline |
GetSchema - Default method of IXmlSerializable Not used.
Definition at line 614 of file BlockDictionary.cs.
|
inline |
Definition at line 116 of file BlockDictionary.cs.
References Seci.Definitions.BlockInfo.Alias, and Seci.BlockDictionary.IsAliasUnique().
|
inline |
Checks that the alias for the Block is unique. Note: Ignores case.
alias | The name of the alias |
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().
|
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.
reader | The XML reader |
Definition at line 625 of file BlockDictionary.cs.
|
inline |
Wrapper for standard Dictionary "Remove" which removes by key.
blockName | The name of the block to remove |
Definition at line 283 of file BlockDictionary.cs.
Referenced by Seci.BlockDictionary.Replace().
|
inline |
Remove a block by index number, like a standard List. Looks up the key then calls remove by key.
index | The index of the block to remove |
Definition at line 293 of file BlockDictionary.cs.
|
inline |
Remove block(s) by VI - may be more than one block. Used when a VI is removed from a configuration.
fileName | The full filepath of the VI |
Definition at line 330 of file BlockDictionary.cs.
|
inline |
Method for replacing a block in the dictionary. Keeps the existing key. First removes the old block, then inserts the new block
oldName | The name of the block to be replaced |
newName | The name of the new block (used as key) |
newBlock | The new BlockInfo |
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().
|
inline |
Swap the order of two blocks
index1 | The index of the first block |
index2 | The index of the second block |
Definition at line 305 of file BlockDictionary.cs.
References Seci.BlockDictionary._dict.
|
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.
writer | The XML writer |
Definition at line 659 of file BlockDictionary.cs.
References Seci.BlockDictionary._dict.
|
private |
Definition at line 20 of file BlockDictionary.cs.
Referenced by Seci.BlockDictionary.Clone(), Seci.BlockDictionary.GetKeys(), Seci.BlockDictionary.IsAliasUnique(), Seci.BlockDictionary.Replace(), Seci.BlockDictionary.Swap(), and Seci.BlockDictionary.WriteXml().
|
get |
Definition at line 189 of file BlockDictionary.cs.
Referenced by Seci.Managers.ComponentMgr.RemoveComponent(), and Seci.Remoting.Bridge.SetBlockValue().
|
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.
index | The index of the required block |
Definition at line 58 of file BlockDictionary.cs.
|
getset |
Property for accessing the Blocks by name. On get() it returns null if the block does not exist.
name | The name of the required block (case insensitive) |
Definition at line 29 of file BlockDictionary.cs.