private ModListing Get(IModListingParser parser, ParseType type, string str) { ModListing?listing; switch (type) { case ParseType.String: return(parser.FromString(str)); case ParseType.FileName: return(parser.FromFileName(str)); case ParseType.TryFilename: if (parser.TryFromFileName(str, out listing)) { return(listing); } throw new Exception(); case ParseType.TryString: if (parser.TryFromString(str, out listing)) { return(listing); } throw new Exception(); default: throw new Exception(); } }
public PluginListingsParser( IModListingParser listingParser) { _listingParser = listingParser; }