Пример #1
0
        static void Main(string[] args)
        {
            try
            {
                PluralsaverSettings.InitializeSettings();

                var courseDownloader = new CourseDownloader();
                courseDownloader.Initialize();
            }
            catch (Exception ex)
            {
                Console.WriteLine("\n\nA critical error occurred in the application: {0}\n" +
                                  "Inner exception: {1}", ex.Message, ex.InnerException);
            }
        }
        public static void InitializeSettings()
        {
            Console.WriteLine("Initializing settings...");
            _settings = XElement.Load("PluralsaverSettings.config");

            _configuration     = _settings.XPathSelectElement("//Configuration");
            _pluralsightAccout = _configuration.XPathSelectElement("PluralsightAccount");
            _download          = _configuration.XPathSelectElement("Download");
            _downloadDelay     = _configuration.XPathSelectElement("DownloadDelay");
            _coursesToDownload = _settings.XPathSelectElement("CoursesToDownload");

            Console.WriteLine("* Pluralsight Account Login    : {0}", Login);
            Console.WriteLine("* Pluralsight Account Password : {0}", new String('*', Password.Length));
            Console.WriteLine("* Download Path                : {0}", Path);
            Console.WriteLine("* Play Clip Timeout            : {0}", PlayClipTimeout);
            Console.WriteLine("* After Clip Timeout           : {0}", AfterClipTimeout);
            Console.WriteLine("* Browser to Use               : {0}", Browser);

            CourseDownloader.ShowCourseList();
        }