private static CreateProcessParms ParseCommandLine(string[] args) { var parms = new CreateProcessParms(); if (args.Length != 3) { throw new Exception("Error in command line"); } switch (args[0]) { case "compress": parms.Operation = OperationType.Compress; break; case "decompress": parms.Operation = OperationType.Decompress; break; default: throw new Exception("Incorrect operation type"); } parms.SourceFile = args[1]; parms.DestinationFile = args[2]; return(parms); }
private static void Run(CreateProcessParms parms) { const int OneMb = 1048576; var processor = new ProcessorFactory(parms, OneMb) .Create(); processor.StartProcess(); }
public ProcessorFactory(CreateProcessParms parms, int blockSize) { _parms = parms; _blockSize = blockSize; }