예제 #1
0
파일: Program.cs 프로젝트: vzorgv/GZipTest
        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);
        }
예제 #2
0
파일: Program.cs 프로젝트: vzorgv/GZipTest
        private static void Run(CreateProcessParms parms)
        {
            const int OneMb = 1048576;

            var processor = new ProcessorFactory(parms, OneMb)
                            .Create();

            processor.StartProcess();
        }
예제 #3
0
 public ProcessorFactory(CreateProcessParms parms, int blockSize)
 {
     _parms = parms;
     _blockSize = blockSize;
 }