Example #1
0
        public static bool GetFiles(string[] args)
        {
            //Get Arguments
            if (args != null)
            {
                foreach (string s in args)
                {
                    if (String.IsNullOrEmpty(LeftSide))
                    {
                        LeftSide = s;
                    }
                    else if (String.IsNullOrEmpty(RightSide))
                    {
                        RightSide = s;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            //If I did not pass files in arguments then ask user for files
            if (String.IsNullOrEmpty(LeftSide) || String.IsNullOrEmpty(RightSide))
            {
                Console.WriteLine("Drag and Drop Path to File 1 (then press enter):\n");
                LeftSide = Console.ReadLine();

                Console.WriteLine("\nDrag and Drop Path to File 2 (then press enter):\n");
                RightSide = Console.ReadLine();
            }


            //Check if I have 2 valid files to compare
            if (!FileValidator.ValidFile(LeftSide))
            {
                CLIComparer.InvalidFile(LeftSide);
                return(false);
            }
            if (!FileValidator.ValidFile(RightSide))
            {
                CLIComparer.InvalidFile(RightSide);
                return(false);
            }

            return(true);
        }