Exemple #1
0
        static Program()
        {
            var container = ContainerConfig.Configure();

            using (var scope = container.BeginLifetimeScope())
            {
                GZipProcessor = scope.Resolve <IGZipProcessor>();
                GZipProgress  = scope.Resolve <IGZipProgress>();
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
 private void GetArchivatorTools(string operation)
 {
     fileReader    = FileReaderFactory.GetFileReader(operation);
     streamQueuer  = StreamQueuerFactory.GetStreamQueuer(operation);
     gZipProcessor = GZipProcessorFactory.GetGZipProcessor(operation);
 }