public static void DoPartsCategory(string Category, TreeViewAdv Tree)
        {
            XmlFile   PartList = XmlFile.XmlFileFromCache(db.DataPath + Category + ".txt");
            TreeModel model    = Tree.Model as TreeModel;

            Tree.BeginUpdate();
            Tree.Model = model;

            ColoredTextNode parent = new ColoredTextNode(Category);

            parent.Tag = Category;
            model.Nodes.Add(parent);

            foreach (string section in PartList.stListSectionNames())
            {
                ColoredTextNode child = new ColoredTextNode();
                child.Text = section;
                child.Tag  = section;
                parent.Nodes.Add(child);
            }
            Tree.EndUpdate();
        }
예제 #2
0
        // 2 references
        public static List <string> GetPartSection(string part)
        {
            string Database = part.Before('.');

            if (Database == "")
            {
                return(null);
            }

            string PartName = part.After('.');

            string DbFileName = XmlPath + Database + ".xml";

            if (!System.IO.File.Exists(DbFileName))
            {
                return(null);
            }

            XmlFile DataFile = XmlFile.XmlFileFromCache(DbFileName);

            List <string> section = DataFile.XmlReadSection(PartName);

            return(section);
        }
예제 #3
0
        // 27 references - Fetch a given attribute from a part
        public static string GetPartAttribute(string part, string AttributeName)
        {
            string Database = part.Before('.');

            if (Database == "")
            {
                return("");
            }

            string PartName = part.After('.');

            string DbFileName = DataPath + Database + ".txt";

            if (!System.IO.File.Exists(DbFileName))
            {
                return("");
            }

            XmlFile DataFile = XmlFile.XmlFileFromCache(DbFileName);

            string ComponentText = DataFile.XmlReadValue(PartName, AttributeName);

            return(ComponentText);
        }