Пример #1
0
        private static void Load(string filePath)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(filePath);

            XmlElement root = doc["names"];

            foreach (XmlElement element in root.GetElementsByTagName("namelist"))
            {
                string type = element.GetAttribute("type");

                if (type == null || type == String.Empty)
                {
                    continue;
                }

                try
                {
                    RandomTOTDXMLReader list = new RandomTOTDXMLReader(type, element);

                    m_Table[type] = list;
                }
                catch
                {
                }
            }
        }
Пример #2
0
        public static string RandomName(string type)
        {
            RandomTOTDXMLReader list = GetRandomTOTDXMLReader(type);

            if (list != null)
            {
                return(list.GetRandomName());
            }

            return("");
        }
Пример #3
0
        private static void Load(string filePath)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(filePath);

            XmlElement root = doc["names"];

            foreach (XmlElement element in root.GetElementsByTagName("namelist"))
            {
                string type = element.GetAttribute("type");

                if (type == null || type == String.Empty)
                    continue;

                try
                {
                    RandomTOTDXMLReader list = new RandomTOTDXMLReader(type, element);

                    m_Table[type] = list;
                }
                catch
                {
                }
            }
        }