Exemplo n.º 1
0
 public static void LoadPortableSettings()
 {
     #region Batch
     if (Ini.KeyExists("SelectedType", "Batch"))
     {
         Batch.Default.SelectedType = Ini.ReadInt("SelectedType", "Batch");
     }
     if (Ini.KeyExists("SelectedVideoQuality", "Batch"))
     {
         Batch.Default.SelectedVideoQuality = Ini.ReadInt("SelectedVideoQuality", "Batch");
     }
     if (Ini.KeyExists("SelectedVideoFormat", "Batch"))
     {
         Batch.Default.SelectedVideoFormat = Ini.ReadInt("SelectedVideoFormat", "Batch");
     }
     if (Ini.KeyExists("SelectedAudioQuality", "Batch"))
     {
         Batch.Default.SelectedAudioQuality = Ini.ReadInt("SelectedAudioQuality", "Batch");
     }
     if (Ini.KeyExists("SelectedAudioFormat", "Batch"))
     {
         Batch.Default.SelectedAudioFormat = Ini.ReadInt("SelectedAudioFormat", "Batch");
     }
     if (Ini.KeyExists("DownloadVideoSound", "Batch"))
     {
         Batch.Default.DownloadVideoSound = Ini.ReadBool("DownloadVideoSound", "Batch");
     }
     if (Ini.KeyExists("DownloadAudioVBR", "Batch"))
     {
         Batch.Default.DownloadAudioVBR = Ini.ReadBool("DownloadAudioVBR", "Batch");
     }
     if (Ini.KeyExists("SelectedAudioQualityVBR", "Batch"))
     {
         Batch.Default.SelectedAudioQualityVBR = Ini.ReadInt("SelectedAudioQualityVBR", "Batch");
     }
     if (Ini.KeyExists("CustomArguments", "Batch"))
     {
         Batch.Default.CustomArguments = Ini.ReadString("CustomArguments", "Batch");
     }
     #endregion
     #region Converts
     if (Ini.KeyExists("detectFiletype", "Converts"))
     {
         Converts.Default.detectFiletype = Ini.ReadBool("detectFiletype", "Converts");
     }
     if (Ini.KeyExists("clearOutput", "Converts"))
     {
         Converts.Default.clearOutput = Ini.ReadBool("clearOutput", "Converts");
     }
     if (Ini.KeyExists("clearInput", "Converts"))
     {
         Converts.Default.clearInput = Ini.ReadBool("clearInput", "Converts");
     }
     if (Ini.KeyExists("videoBitrate", "Converts"))
     {
         Converts.Default.videoBitrate = Ini.ReadInt("videoBitrate", "Converts");
     }
     if (Ini.KeyExists("videoPreset", "Converts"))
     {
         Converts.Default.videoPreset = Ini.ReadInt("videoPreset", "Converts");
     }
     if (Ini.KeyExists("videoProfile", "Converts"))
     {
         Converts.Default.videoProfile = Ini.ReadInt("videoProfile", "Converts");
     }
     if (Ini.KeyExists("videoCRF", "Converts"))
     {
         Converts.Default.videoCRF = Ini.ReadInt("videoCRF", "Converts");
     }
     if (Ini.KeyExists("videoFastStart", "Converts"))
     {
         Converts.Default.videoFastStart = Ini.ReadBool("videoFastStart", "Converts");
     }
     if (Ini.KeyExists("hideFFmpegCompile", "Converts"))
     {
         Converts.Default.hideFFmpegCompile = Ini.ReadBool("hideFFmpegCompile", "Converts");
     }
     if (Ini.KeyExists("audioBitrate", "Converts"))
     {
         Converts.Default.audioBitrate = Ini.ReadInt("audioBitrate", "Converts");
     }
     if (Ini.KeyExists("videoUseBitrate", "Converts"))
     {
         Converts.Default.videoUseBitrate = Ini.ReadBool("videoUseBitrate", "Converts");
     }
     if (Ini.KeyExists("videoUsePreset", "Converts"))
     {
         Converts.Default.videoUsePreset = Ini.ReadBool("videoUsePreset", "Converts");
     }
     if (Ini.KeyExists("videoUseProfile", "Converts"))
     {
         Converts.Default.videoUseProfile = Ini.ReadBool("videoUseProfile", "Converts");
     }
     if (Ini.KeyExists("videoUseCRF", "Converts"))
     {
         Converts.Default.videoUseCRF = Ini.ReadBool("videoUseCRF", "Converts");
     }
     if (Ini.KeyExists("audioUseBitrate", "Converts"))
     {
         Converts.Default.audioUseBitrate = Ini.ReadBool("audioUseBitrate", "Converts");
     }
     #endregion
     #region Downloads
     if (Ini.KeyExists("downloadPath", "Downloads"))
     {
         Downloads.Default.downloadPath = Ini.ReadString("downloadPath", "Downloads");
     }
     if (Ini.KeyExists("separateDownloads", "Downloads"))
     {
         Downloads.Default.separateDownloads = Ini.ReadBool("separateDownloads", "Downloads");
     }
     if (Ini.KeyExists("SaveFormatQuality", "Downloads"))
     {
         Downloads.Default.SaveFormatQuality = Ini.ReadBool("SaveFormatQuality", "Downloads");
     }
     if (Ini.KeyExists("deleteYtdlOnClose", "Downloads"))
     {
         Downloads.Default.deleteYtdlOnClose = Ini.ReadBool("deleteYtdlOnClose", "Downloads");
     }
     if (Ini.KeyExists("useYtdlUpdater", "Downloads"))
     {
         Downloads.Default.useYtdlUpdater = Ini.ReadBool("useYtdlUpdater", "Downloads");
     }
     if (Ini.KeyExists("fileNameSchema", "Downloads"))
     {
         Downloads.Default.fileNameSchema = Ini.ReadString("fileNameSchema", "Downloads");
     }
     if (Ini.KeyExists("fixReddit", "Downloads"))
     {
         Downloads.Default.fixReddit = Ini.ReadBool("fixReddit", "Downloads");
     }
     if (Ini.KeyExists("separateIntoWebsiteURL", "Downloads"))
     {
         Downloads.Default.separateIntoWebsiteURL = Ini.ReadBool("separateIntoWebsiteURL", "Downloads");
     }
     if (Ini.KeyExists("SaveSubtitles", "Downloads"))
     {
         Downloads.Default.SaveSubtitles = Ini.ReadBool("SaveSubtitles", "Downloads");
     }
     if (Ini.KeyExists("subtitlesLanguages", "Downloads"))
     {
         Downloads.Default.subtitlesLanguages = Ini.ReadString("subtitlesLanguages", "Downloads");
     }
     if (Ini.KeyExists("CloseDownloaderAfterFinish", "Downloads"))
     {
         Downloads.Default.CloseDownloaderAfterFinish = Ini.ReadBool("CloseDownloaderAfterFinish", "Downloads");
     }
     if (Ini.KeyExists("UseProxy", "Downloads"))
     {
         Downloads.Default.UseProxy = Ini.ReadBool("UseProxy", "Downloads");
     }
     if (Ini.KeyExists("ProxyType", "Downloads"))
     {
         Downloads.Default.ProxyType = Ini.ReadInt("ProxyType", "Downloads");
     }
     if (Ini.KeyExists("ProxyIP", "Downloads"))
     {
         Downloads.Default.ProxyIP = Ini.ReadString("ProxyIP", "Downloads");
     }
     if (Ini.KeyExists("ProxyPort", "Downloads"))
     {
         Downloads.Default.ProxyPort = Ini.ReadString("ProxyPort", "Downloads");
     }
     if (Ini.KeyExists("SaveThumbnail", "Downloads"))
     {
         Downloads.Default.SaveThumbnail = Ini.ReadBool("SaveThumbnail", "Downloads");
     }
     if (Ini.KeyExists("SaveDescription", "Downloads"))
     {
         Downloads.Default.SaveDescription = Ini.ReadBool("SaveDescription", "Downloads");
     }
     if (Ini.KeyExists("SaveVideoInfo", "Downloads"))
     {
         Downloads.Default.SaveVideoInfo = Ini.ReadBool("SaveVideoInfo", "Downloads");
     }
     if (Ini.KeyExists("SaveAnnotations", "Downloads"))
     {
         Downloads.Default.SaveAnnotations = Ini.ReadBool("SaveAnnotations", "Downloads");
     }
     if (Ini.KeyExists("SubtitleFormat", "Downloads"))
     {
         Downloads.Default.SubtitleFormat = Ini.ReadString("SubtitleFormat", "Downloads");
     }
     if (Ini.KeyExists("DownloadLimit", "Downloads"))
     {
         Downloads.Default.DownloadLimit = Ini.ReadInt("DownloadLimit", "Downloads");
     }
     if (Ini.KeyExists("RetryAttempts", "Downloads"))
     {
         Downloads.Default.RetryAttempts = Ini.ReadInt("RetryAttempts", "Downloads");
     }
     if (Ini.KeyExists("DownloadLimitType", "Downloads"))
     {
         Downloads.Default.DownloadLimitType = Ini.ReadInt("DownloadLimitType", "Downloads");
     }
     if (Ini.KeyExists("ForceIPv4", "Downloads"))
     {
         Downloads.Default.ForceIPv4 = Ini.ReadBool("ForceIPv4", "Downloads");
     }
     if (Ini.KeyExists("ForceIPv6", "Downloads"))
     {
         Downloads.Default.ForceIPv6 = Ini.ReadBool("ForceIPv6", "Downloads");
     }
     if (Ini.KeyExists("LimitDownloads", "Downloads"))
     {
         Downloads.Default.LimitDownloads = Ini.ReadBool("LimitDownloads", "Downloads");
     }
     if (Ini.KeyExists("EmbedSubtitles", "Downloads"))
     {
         Downloads.Default.EmbedSubtitles = Ini.ReadBool("EmbedSubtitles", "Downloads");
     }
     if (Ini.KeyExists("EmbedThumbnails", "Downloads"))
     {
         Downloads.Default.EmbedThumbnails = Ini.ReadBool("EmbedThumbnails", "Downloads");
     }
     if (Ini.KeyExists("VideoDownloadSound", "Downloads"))
     {
         Downloads.Default.VideoDownloadSound = Ini.ReadBool("VideoDownloadSound", "Downloads");
     }
     if (Ini.KeyExists("AudioDownloadAsVBR", "Downloads"))
     {
         Downloads.Default.AudioDownloadAsVBR = Ini.ReadBool("AudioDownloadAsVBR", "Downloads");
     }
     if (Ini.KeyExists("KeepOriginalFiles", "Downloads"))
     {
         Downloads.Default.KeepOriginalFiles = Ini.ReadBool("KeepOriginalFiles", "Downloads");
     }
     if (Ini.KeyExists("WriteMetadata", "Downloads"))
     {
         Downloads.Default.WriteMetadata = Ini.ReadBool("WriteMetadata", "Downloads");
     }
     #endregion
     #region Errors
     if (Ini.KeyExists("detailedErrors", "Errors"))
     {
         Errors.Default.detailedErrors = Ini.ReadBool("detailedErrors", "Errors");
     }
     if (Ini.KeyExists("logErrors", "Errors"))
     {
         Errors.Default.logErrors = Ini.ReadBool("logErrors", "Errors");
     }
     if (Ini.KeyExists("suppressErrors", "Errors"))
     {
         Errors.Default.suppressErrors = Ini.ReadBool("suppressErrors", "Errors");
     }
     #endregion
     #region General
     if (Ini.KeyExists("UseStaticYtdl", "General"))
     {
         General.Default.UseStaticYtdl = Ini.ReadBool("UseStaticYtdl", "General");
     }
     if (Ini.KeyExists("ytdlPath", "General"))
     {
         General.Default.ytdlPath = Ini.ReadString("ytdlPath", "General");
     }
     if (Ini.KeyExists("UseStaticFFmpeg", "General"))
     {
         General.Default.UseStaticFFmpeg = Ini.ReadBool("UseStaticFFmpeg", "General");
     }
     if (Ini.KeyExists("ffmpegPath", "General"))
     {
         General.Default.ffmpegPath = Ini.ReadString("ffmpegPath", "General");
     }
     if (Ini.KeyExists("CheckForUpdatesOnLaunch", "General"))
     {
         General.Default.CheckForUpdatesOnLaunch = Ini.ReadBool("CheckForUpdatesOnLaunch", "General");
     }
     if (Ini.KeyExists("HoverOverURLTextBoxToPaste", "General"))
     {
         General.Default.HoverOverURLTextBoxToPaste = Ini.ReadBool("HoverOverURLTextBoxToPaste", "General");
     }
     if (Ini.KeyExists("ClearURLOnDownload", "General"))
     {
         General.Default.ClearURLOnDownload = Ini.ReadBool("ClearURLOnDownload", "General");
     }
     if (Ini.KeyExists("SaveCustomArgs", "General"))
     {
         General.Default.SaveCustomArgs = Ini.ReadInt("SaveCustomArgs", "General");
     }
     if (Ini.KeyExists("ClearClipboardOnDownload", "General"))
     {
         General.Default.ClearClipboardOnDownload = Ini.ReadBool("ClearClipboardOnDownload", "General");
     }
     #endregion
     #region Saved
     if (Ini.KeyExists("formLocationX", "Saved"))
     {
         Saved.Default.formLocationX = Ini.ReadInt("formLocationX", "Saved");
     }
     if (Ini.KeyExists("formLocationY", "Saved"))
     {
         Saved.Default.formLocationY = Ini.ReadInt("formLocationY", "Saved");
     }
     if (Ini.KeyExists("downloadType", "Saved"))
     {
         Saved.Default.downloadType = Ini.ReadInt("downloadType", "Saved");
     }
     if (Ini.KeyExists("downloadArgs", "Saved"))
     {
         Saved.Default.downloadArgs = Ini.ReadString("downloadArgs", "Saved");
     }
     if (Ini.KeyExists("formTrue0", "Saved"))
     {
         Saved.Default.formTrue0 = Ini.ReadBool("formTrue0", "Saved");
     }
     if (Ini.KeyExists("convertSaveVideoIndex", "Saved"))
     {
         Saved.Default.convertSaveVideoIndex = Ini.ReadInt("convertSaveVideoIndex", "Saved");
     }
     if (Ini.KeyExists("convertSaveAudioIndex", "Saved"))
     {
         Saved.Default.convertSaveAudioIndex = Ini.ReadInt("convertSaveAudioIndex", "Saved");
     }
     if (Ini.KeyExists("convertType", "Saved"))
     {
         Saved.Default.convertType = Ini.ReadInt("convertType", "Saved");
     }
     if (Ini.KeyExists("convertCustom", "Saved"))
     {
         Saved.Default.convertCustom = Ini.ReadString("convertCustom", "Saved");
     }
     if (Ini.KeyExists("videoQuality", "Saved"))
     {
         Saved.Default.videoQuality = Ini.ReadInt("videoQuality", "Saved");
     }
     if (Ini.KeyExists("audioQuality", "Saved"))
     {
         Saved.Default.audioQuality = Ini.ReadInt("audioQuality", "Saved");
     }
     if (Ini.KeyExists("VideoFormat", "Saved"))
     {
         Saved.Default.VideoFormat = Ini.ReadInt("VideoFormat", "Saved");
     }
     if (Ini.KeyExists("AudioFormat", "Saved"))
     {
         Saved.Default.AudioFormat = Ini.ReadInt("AudioFormat", "Saved");
     }
     if (Ini.KeyExists("AudioVBRQuality", "Saved"))
     {
         Saved.Default.AudioVBRQuality = Ini.ReadInt("AudioVBRQuality", "Saved");
     }
     if (Ini.KeyExists("BatchFormX", "Saved"))
     {
         Saved.Default.BatchFormX = Ini.ReadInt("BatchFormX", "Saved");
     }
     if (Ini.KeyExists("BatchFormY", "Saved"))
     {
         Saved.Default.BatchFormY = Ini.ReadInt("BatchFormY", "Saved");
     }
     if (Ini.KeyExists("MainFormSize", "Saved"))
     {
         Saved.Default.MainFormSize = Ini.ReadSize("MainFormSize", "Saved");
     }
     if (Ini.KeyExists("SettingsFormSize", "Saved"))
     {
         Saved.Default.SettingsFormSize = Ini.ReadSize("SettingsFormSize", "Saved");
     }
     #endregion
     #region Settings
     if (Ini.KeyExists("extensionsName", "Settings"))
     {
         Settings.Default.extensionsName = Ini.ReadString("extensionsName", "Saved");
     }
     if (Ini.KeyExists("extensionsShort", "Settings"))
     {
         Settings.Default.extensionsShort = Ini.ReadString("extensionsShort", "Saved");
     }
     if (Ini.KeyExists("LanguageFile", "Settings"))
     {
         Settings.Default.LanguageFile = Ini.ReadString("LanguageFile", "Saved");
     }
     #endregion
 }