public IProcess CreateProcessor(ProcUst mode)
        {
            IProcess processor;

            switch (mode)
            {
            case ProcUst.compress:
            {
                processor = new Compressor();
                break;
            }

            case ProcUst.decompress:
            {
                processor = new Decompressor();
                break;
            }

            default:
            {
                throw new Exception("Неверный режим работы программы!");
            }
            }
            return(processor);
        }
Example #2
0
        public Parameters(string[] args)
        {
            string mas;

            mas = Convert.ToString(Console.ReadLine());
            if (mas == "compress")
            {
                Mode = ProcUst.compress;
            }
            else
            {
                Mode = ProcUst.decompress;
            }
            PathToSourceFile = Convert.ToString(Console.ReadLine());
            PathToResultFile = Convert.ToString(Console.ReadLine());
        }