Exemplo n.º 1
0
        private void LoadXML(string path, PlugInP data, bool needf, bool needg, bool needd)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(path);
            data.Name        = doc.SelectSingleNode("/GeneralSetting/name").Attributes[0].Value;
            data.FChangeable = needf;
            data.GChangeable = needg;
            data.DChangeable = needd;
            data.NeedF       = false;
            data.NeedG       = false;
            data.NeedD       = false;
            XmlNodeList nodes = doc.SelectNodes("/GeneralSetting/add");

            foreach (XmlNode node in nodes)
            {
                if (node.Attributes[1].Value.ToLower() == "need")
                {
                    switch (node.Attributes[0].Value)
                    {
                    case "NeedF": data.NeedF = needf; break;

                    case "NeedG": data.NeedG = needg; break;

                    case "NeedD": data.NeedD = needd; break;

                    default: break;
                    }
                }
            }
        }
Exemplo n.º 2
0
 public Edit(string path, PlugInP data)
 {
     InitializeComponent();
     filepath              = path;
     Data                  = data;
     BaseData.DataContext  = data;
     BaseData2.DataContext = data;
     Load(path);
 }