示例#1
0
        private void PartSelectorGear_SelectionChanged(object sender, EventArgs e)
        {
            PartInfoGear.Clear();
            try
            {
                // Read ALL subsections of a given XML section
                XmlFile Category = XmlFile.XmlFileFromCache(db.DataPath + PartSelectorGear.SelectedNode.Parent.GetKey() + ".txt");

                // XML Section: PartCategories.SelectedNode.Text
                List <string> xmlSection = Category.XmlReadSection(PartSelectorGear.SelectedNode.GetText());

                PartInfoGear.Lines = xmlSection.ToArray();
            }
            catch { }
        }
示例#2
0
        private void PartsGear_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PartsGear.SelectedIndex == -1)
            {
                return;
            }

            string part = PartsGear.SelectedItem.ToString();

            if (GlobalSettings.PartSelectorTracking == true)
            {
                PartSelectorGear.BeginUpdate();
                TreeNodeAdv categoryNode = PartSelectorGear.FindFirstNodeByTag(part.Before('.'), false);
                if (categoryNode != null)
                {
                    TreeNodeAdv partNode = categoryNode.FindFirstByTag(part.After('.'), false);
                    PartSelectorGear.CollapseAll();
                    PartSelectorGear.SelectedNode = partNode;
                    if (partNode != null)
                    {
                        Util.CenterNode(PartSelectorGear.SelectedNode, gearVisibleLine);
                    }
                }
                PartSelectorGear.EndUpdate();
            }
            else
            {
                PartInfoGear.Clear();

                List <string> xmlSection = db.GetPartSection(part);

                if (xmlSection != null)
                {
                    PartInfoGear.Lines = xmlSection.ToArray();
                }
            }
            saveGear(false);
        }