public void setPeremens(int st, Peremennaya p1, Peremennaya p2, Peremennaya p3, int i, int j, int k) { stepengen = st; per1 = p1; if (p1.getIfKategor()) { number1 = i; } if (st >= 2) { per2 = p2; if (p2.getIfKategor()) { number2 = j; } if (st == 3) { per3 = p3; if (p3.getIfKategor()) { number3 = k; } } } }
private List <Peremennaya> getPeremens() { List <Peremennaya> massiv_переменных = new List <Peremennaya>(); Peremennaya per = new Peremennaya(); string path = "vars.xml"; XmlDocument doc = new XmlDocument(); doc.Load(path); int i = 0; foreach (XmlNode nod in doc.DocumentElement) { i++; if (nod.Name == "number") { massiv_переменных.Add(addNewPer("X" + i.ToString())); } else { List <string> valueName = new List <string>(); foreach (XmlNode child in nod.ChildNodes) { if (child.Name == "value") { valueName.Add(child.InnerText); } } massiv_переменных.Add(addNewKategor("X" + i.ToString(), valueName)); } } return(massiv_переменных); }
private Peremennaya addNewPer(string name) { Peremennaya p = new Peremennaya(); p.setName(name); p.setIfKategor(false); return(p); }
private Peremennaya addNewKategor(string name, List <string> list) { Peremennaya p = new Peremennaya(); p.setName(name); p.setIfKategor(true); List <KategorPeremen> qlist = new List <KategorPeremen>(); foreach (var str in list) { KategorPeremen kat = new KategorPeremen(); kat.setName(str); qlist.Add(kat); } p.setListKat(qlist); return(p); }