Esempio n. 1
0
        public void ChooseOutputFileName()
        {
            Console.Clear();
            Console.WriteLine("Please enter a filename for the Export.");

            var fileName = Console.ReadLine();

            var    ext = Path.GetExtension(fileName);
            string expectedExtension = ExportType.GetExtension();

            if (ext == string.Empty)
            {
                fileName += expectedExtension;
            }

            var path = Path.GetDirectoryName(this.ImportFilePath);

            bool exportToFilePath = Confirm($"Save new file to {path}?");

            if (exportToFilePath)
            {
                ExportFilePath = Path.Combine(path, fileName);
            }
            else
            {
                Console.WriteLine("Enter a new path:");
                var newPath = Console.ReadLine();

                ExportFilePath = Path.Combine(newPath, fileName);
            }
        }