public static IDeckAnalyzer GetDeckAnalyzer(DeckWriterOutputType outputType, string foldername, string filename, string seedDeck) { IDeckAnalyzer retVal; switch (outputType) { case DeckWriterOutputType.TextFile: retVal = new MtgDeckFileAnalyzer { InputFolder = foldername, OutputFile = filename, SeedDeck = seedDeck }; return retVal; case DeckWriterOutputType.Database: retVal = new MtgDeckSqlCeAnalyzer { ConnectionString = string.Format("DataSource=\"{0}{1}.sdf\";", foldername, filename), SeedDeck = seedDeck }; return retVal; } throw new ArgumentException("Output type is not valid", "outputType"); }
public static IDeckWriter GetDeckWriter(DeckWriterOutputType outputType, DeckWriterGameType gameType, string location) { if (string.IsNullOrWhiteSpace(location)) { throw new ArgumentException("Location cannot be blank.", "location"); } return outputObjects[(int)outputType][(int)gameType](location); }
private string GetOutputLocation(DeckWriterOutputType outputType) { FixOutputFolder(); switch (outputType) { case DeckWriterOutputType.TextFile: return outputFolderText.Text; case DeckWriterOutputType.Database: return string.Format("{0}{1}.sdf", outputFolderText.Text, outputFileText.Text); default: throw new ArgumentException("Output type must be set.", "outputType"); } }