Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                if (HelpFlagHelper.IsHelp(args[0]))
                {
                    HelpUI();
                }
                else if (FileExtensionsHelper.IsWord(args[0]))
                {
                    DocumentConverter.Word(args[0]);
                }
                else if (FileExtensionsHelper.IsExcel(args[0]))
                {
                    Console.WriteLine("Excel");
                }
                else if (FileExtensionsHelper.IsPowerPoint(args[0]))
                {
                    DocumentConverter.PowerPoint(args[0]);
                }
                else if (FileExtensionsHelper.IsPDF(args[0]))
                {
                    Console.WriteLine("PDF");
                }
            }
            else
            {
                HelpUI();
            }

            Console.ReadLine();
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string fileName)
            {
                string extension = Path.GetExtension(fileName);
                return(FileExtensionsHelper.GetReadable(extension));
            }

            return("Unknown");
        }