private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     downloader.DownloadCompleted       += Downloader_DownloadCompleted;
     downloader.DownloadProgressChanged += Downloader_DownloadProgressChanged;
     if (!ProgramConfigReader.VerifyConfigExists() || !ProgramConfigReader.VerifyRunProgramExists())
     {
         MessageBox.Show("Config file cannot be loaded!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     else
     {
         Cfgdata = ProgramConfigReader.GetCurrentConfigData();
         if (Cfgdata.DownloadLocation == "Default")
         {
             IsDefaultSaveLoc = true;
         }
         else
         {
             IsDefaultSaveLoc = false;
         }
         SaveLoc = Cfgdata.DownloadLocation;
         if (Cfgdata.IsUsingThumbnail)
         {
             IsUsingMP3Thumbnail = true;
         }
         else
         {
             IsUsingMP3Thumbnail = false;
         }
     }
 }
Exemple #2
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (!ProgramConfigReader.VerifyConfigExists() || !ProgramConfigReader.VerifyRunProgramExists())
     {
         MessageBox.Show("Config file cannot be loaded!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         ConfigData data = ProgramConfigReader.GetCurrentConfigData();
         SavePath           = data.DownloadLocation;
         CurrentVersion     = data.CurrentVersion;
         MP3Thumbnail       = data.IsUsingThumbnail;
         AutoUpdate         = data.IsAutoCheckUpdate;
         UsingCmdAfterDwnld = data.IsUsingProgAfterDownload;
         CmdText            = data.ProgAfterDownloadText;
     }
     VersionText.Content      = "Current Version: " + CurrentVersion;
     UpdateCheckBox.IsChecked = AutoUpdate;
     if (SavePath == "Default")
     {
         DownloadLocationString.Content = "My Documents";
     }
     else
     {
         DownloadLocationString.Content = SavePath;
     }
     MP3Checkbox.IsChecked     = MP3Thumbnail;
     ProgramCheckbox.IsChecked = UsingCmdAfterDwnld;
     ProgramContent.Text       = CmdText;
 }
Exemple #3
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            StatusText.Content        = "";
            DownloadStatus.Content    = "";
            VidTitle.Content          = "";
            VidQualityBox.IsEnabled   = false;
            AudioQualityBox.IsEnabled = false;
            firstMetadata             = true;
            FileSizeLabel.Content     = "";
            if (!ProgramConfigReader.VerifyConfigExists() || !ProgramConfigReader.VerifyRunProgramExists())
            {
                MessageBox.Show("Config file cannot be loaded!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                ConfigData data = ProgramConfigReader.GetCurrentConfigData();
                currentVersion     = data.CurrentVersion;
                SaveLoc            = data.DownloadLocation;
                AutoUpdate         = data.IsAutoCheckUpdate;
                UsePostDownloadCmd = data.IsUsingProgAfterDownload;
                usingMP3Thumbnail  = data.IsUsingThumbnail;
                CmdText            = data.ProgAfterDownloadText;
                if (SaveLoc == "Default")
                {
                    isDefaultSaveLoc = true;
                }
                else
                {
                    isDefaultSaveLoc = false;
                }
            }

            /* if (AutoUpdate)
             * {
             *   VersionInfo info = ProgramConfigReader.GetLatestVersion();
             *   if((info.NewVersion!="NOT AVAILABLE") && (info.NewVersion != currentVersion))
             *   {
             *      MessageBoxResult result = MessageBox.Show("New version available, " + info.NewVersion + " from " + info.VersionDate + Environment.NewLine + "Would you like to update?", "Update Available",MessageBoxButton.YesNo,MessageBoxImage.Information);
             *       if (result == MessageBoxResult.Yes)
             *       {
             *           this.NavigationService.Navigate(new Uri("OptionsPage.xaml", UriKind.Relative));
             *       }
             *   }
             * }*/
        }