Esempio n. 1
0
        public void ChooseDocument(string fileName)
        {
            string format = fileName.Substring(fileName.Length - 4);

            switch (format.ToLower())
            {
            case ".txt": handler = new TXTHandler(fileName);
                break;

            case ".doc": handler = new DOCHandler(fileName);
                break;

            case ".xml": handler = new XMLHandler(fileName);
                break;

            default: Console.WriteLine("Неопознаный формат");
                break;
            }
        }
Esempio n. 2
0
        public void ChooseDocument(string filename)
        {
            string str = filename.Substring(filename.Length - 4);

            switch (str.ToLower())
            {
            case ".doc":
                abs = new DOCHandler(filename);
                break;

            case ".txt":
                abs = new TXTHandler(filename);
                break;

            case ".xml":
                abs = new XMLHandler(filename);
                break;

            default:
                Console.WriteLine("net takogo");
                break;
            }
        }