Example #1
0
        public VDFNode GetNode(string key)
        {
            int keyIndex = SearchKey(key);

            if (keyIndex == -1)
            {
                throw new KeyNotFoundException();
            }
            VDFBlock BlockData = (VDFBlock)this.Data;

            return(BlockData.List[keyIndex]);
        }
Example #2
0
        public int SearchKey(string key)
        {
            if (!(this.Data is VDFBlock))
            {
                return(-1);
            }

            string   upperKey  = key.ToUpper();
            VDFBlock BlockData = (VDFBlock)this.Data;

            for (int i = 0; i < BlockData.List.Count; i++)
            {
                if (BlockData.List[i].Key.ToUpper() == upperKey)
                {
                    return(i);
                }
            }
            return(-1);
        }