Пример #1
0
        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()]);
        }
Пример #2
0
        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;
        }
Пример #3
0
 static ListGroupTag()
 {
     _token = new ListGroupTag();
 }