Ejemplo n.º 1
0
        private void SelectSpecificParser(string[] substrings)
        {
            substrings[0] = substrings[0].Replace(" ", "");

            if (substrings[0] == "Text")
            {
                parser = new TextParser();
            }

            else if (substrings[0] == "Movie")
            {
                parser = new MovieParser();
            }

            else if (substrings[0] == "Image")
            {
                parser = new ImageParser();
            }

            else
            {
                throw new Exception("There is no suitable parser");
            }
        }
Ejemplo n.º 2
0
 public void AddProvider(ISpecificParser provider)
 {
     parserProviders.Add(provider);
 }
Ejemplo n.º 3
0
 public HostParser(PcdbFile database, ISpecificParser provider)
     : this(database)
 {
     AddProvider(provider);
 }