static Program() { var container = ContainerConfig.Configure(); using (var scope = container.BeginLifetimeScope()) { GZipProcessor = scope.Resolve <IGZipProcessor>(); GZipProgress = scope.Resolve <IGZipProgress>(); } }
static void Main(string[] args) { if (args.Length != 3) { printUsage(); return; } CompressionMode mode = CompressionMode.Compress; if (string.Compare(args[0], decompress, true) == 0) { mode = CompressionMode.Decompress; } else if (string.Compare(args[0], compress, true) != 0) { printUsage(); return; } IGZipProcessor proc = null; if (mode == CompressionMode.Compress) { proc = new Compressor(); } else { proc = new Decompressor(); } try { proc.Process(args[1], args[2], mode); } catch (Exception ex) { Console.WriteLine("Error: {0}", ex.Message); } }
private void GetArchivatorTools(string operation) { fileReader = FileReaderFactory.GetFileReader(operation); streamQueuer = StreamQueuerFactory.GetStreamQueuer(operation); gZipProcessor = GZipProcessorFactory.GetGZipProcessor(operation); }