public static void FucRepoFill() { var repo = RepositoryLocator.GetFucRep(); var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "FUC.xml"); XmlTextReader reader = new XmlTextReader(path); string[] fuc = new string[10]; // name, acr, mand, sem, ects, objectives, results, evaluation, programa; Fuc f; int i = 0; while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.EndElement: // O nó é um elemento. if (reader.Name.CompareTo("fuc") == 0) { f = new Fuc(fuc[0], fuc[1], fuc[2].CompareTo("true") == 0, fuc[3], fuc[4].CompareTo("null") == 0 ? null : fuc[4], Double.Parse(fuc[5])) { Objectives = fuc[6], Results = fuc[7], Evaluation = fuc[8], Program = fuc[9] }; repo.Add(f); i = 0; } break; case XmlNodeType.Text: //Apresente o texto em cada elemento. fuc[i++] = reader.Value; break; } } }
public IEnumerable<Fuc> GetPartialFucs(int n) { Fuc[] fucList = GetAll().ToArray(); LinkedList<Fuc> loadFucs = new LinkedList<Fuc>(); int max = _n + n; Fuc f; for(;_n<max && _n<fucList.Length ;_n++) { f = new Fuc(fucList[_n].Name, fucList[_n].Acr); loadFucs.AddLast(f); } return loadFucs; }
public void Add(Fuc td) { _repo.Add(td.Acr, td); }