static void Main(string[] args) { var result = Parser.Default.ParseArguments <Configuration>(args).WithParsed(options => { convertion = Convertion.build(options.frameSlides, options.handout, options.verticalFirst, options.onlyPPT); convertion.convert(options.inputFiles, options.outputFile); }); }
public static Convertion build(bool frameSlides, Configuration.Handout handout, bool verticalFirst, bool onlyPPT) { Convertion convertion = new Convertion(); convertion.frameSlides = frameSlides ? MSCore.MsoTriState.msoTrue : MSCore.MsoTriState.msoFalse; convertion.handoutOrder = verticalFirst ? MSPowerPoint.PpPrintHandoutOrder.ppPrintHandoutVerticalFirst : MSPowerPoint.PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst; switch (handout) { case Configuration.Handout.SINGLE: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputOneSlideHandouts; break; case Configuration.Handout.TWO: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputTwoSlideHandouts; break; case Configuration.Handout.THREE: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputThreeSlideHandouts; break; case Configuration.Handout.FOUR: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputFourSlideHandouts; break; case Configuration.Handout.SIX: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputSixSlideHandouts; break; case Configuration.Handout.NINE: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputNineSlideHandouts; break; default: convertion.outputType = MSPowerPoint.PpPrintOutputType.ppPrintOutputSixSlideHandouts; break; } convertion.onlyPPT = onlyPPT; return(convertion); }