public ListGroupNode GetListGroup(string listName) { string[] names = GetFullName(listName).Split(NAME_SEPARATORS); Hashtable current = _varTable; if (names[0] != _specName) { throw new FormatException("List group name does not start with unique appliance name."); } for (int i = 1; i < names.Length - 1; i++) { if (current[names[i]] == null) { current[names[i]] = new Hashtable(); } current = (Hashtable)current[names[i]]; } if (current[names[names.Length - 1]] == null) { current[names[names.Length - 1]] = new Hashtable(); } current = (Hashtable)current[names[names.Length - 1]]; return((ListGroupNode)current[ListGroupTag.GetToken()]); }
public void RegisterListGroup(string fullName, ListGroupNode lg) { string[] names = fullName.Split(NAME_SEPARATORS); Hashtable current = _varTable; if (names[0] != _specName) { throw new FormatException("List group name does not start with unique appliance name."); } if (names[names.Length - 1] != lg.Name) { throw new FormatException("List group name does not end with same name as ListGroupNode object"); } for (int i = 1; i < names.Length - 1; i++) { if (current[names[i]] == null) { current[names[i]] = new Hashtable(); } current = (Hashtable)current[names[i]]; } if (current[lg.Name] == null) { current[lg.Name] = new Hashtable(); } current = (Hashtable)current[lg.Name]; current[ListGroupTag.GetToken()] = lg; }