Exemplo n.º 1
0
        private void buildBox(ComboBox BDeveloper, ComboBox BReleaseDate, ComboBox BMainGenre, ComboBox BGameMode, ComboBox BEngine, ComboBox BMetascore)
        {
            IParse           p           = new LinqToXML();
            List <Searching> res         = p.AnalyzeFile(new Searching(), path);
            List <string>    developer   = new List <string>();
            List <string>    releaseDate = new List <string>();
            List <string>    mainGenre   = new List <string>();
            List <string>    gameMode    = new List <string>();
            List <string>    engine      = new List <string>();
            List <string>    metascore   = new List <string>();

            foreach (Searching e in res)
            {
                if (!developer.Contains(e.developer))
                {
                    developer.Add(e.developer);
                }
                if (!releaseDate.Contains(e.releaseDate))
                {
                    releaseDate.Add(e.releaseDate);
                }
                if (!mainGenre.Contains(e.mainGenre))
                {
                    mainGenre.Add(e.mainGenre);
                }
                if (!gameMode.Contains(e.gameMode))
                {
                    gameMode.Add(e.gameMode);
                }
                if (!engine.Contains(e.engine))
                {
                    engine.Add(e.engine);
                }
                if (!metascore.Contains(e.metascore))
                {
                    metascore.Add(e.metascore);
                }
            }
            developer   = developer.OrderBy(x => x).ToList();
            releaseDate = releaseDate.OrderBy(x => x).ToList();
            mainGenre   = mainGenre.OrderBy(x => x).ToList();
            gameMode    = gameMode.OrderBy(x => x).ToList();
            engine      = engine.OrderBy(x => x).ToList();
            metascore   = metascore.OrderBy(x => x).ToList();

            BDeveloper.Items.AddRange(developer.ToArray());
            BReleaseDate.Items.AddRange(releaseDate.ToArray());
            BMainGenre.Items.AddRange(mainGenre.ToArray());
            BGameMode.Items.AddRange(gameMode.ToArray());
            BEngine.Items.AddRange(engine.ToArray());
            BMetascore.Items.AddRange(metascore.ToArray());
        }
Exemplo n.º 2
0
        private void ParsingForXML()
        {
            Searching        MTemplate = MemSearch();
            List <Searching> res;

            if (BSAX.Checked)
            {
                IParse parse = new SAX();
                res = parse.AnalyzeFile(MTemplate, path);
                Output(res);
            }
            else if (BDOM.Checked)
            {
                IParse parse = new DOM();
                res = parse.AnalyzeFile(MTemplate, path);
                Output(res);
            }
            else if (BLINQ.Checked)
            {
                IParse parse = new LinqToXML();
                res = parse.AnalyzeFile(MTemplate, path);
                Output(res);
            }
        }