Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public void Add(Fuc td)
 {
     _repo.Add(td.Acr, td);
 }