Ejemplo n.º 1
0
        internal IReader GetFactory(string format)
        {
            switch (format)
            {
            case "xml":
                return(XmlReader ?? (XmlReader = new PeopleXmlReader()));

            case "json":
                return(JSONReader ?? (JSONReader = new PeopleJSONReader()));
            }

            throw new FileFormatException();
        }
Ejemplo n.º 2
0
 public ReaderFactory(PeopleJSONReader peopleJSON, PeopleXmlReader peopleXml)
 {
     this.peopleJSON = peopleJSON;
     this.peopleXml  = peopleXml;
 }