コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                _settings = ExtractorSettings.GetSettingsFromDrive() ??
                            new ExtractorSettings();

                if (string.IsNullOrWhiteSpace(_settings.BaseFolder))
                {
                    _settings.BaseFolder = GetUniqueBaseFolder();
                }

                txtBaseFolder.Text = _settings.BaseFolder;

                txtYoutubeDLLocation.Text = _settings.YoutubeDL ?? "";
                txtVLCLocation.Text       = _settings.VLC ?? "";

                //NOTE: the text change event listeners may have fired above, but not if going from "" to ""
                RefreshFolderNames();
                txtYoutubeDLLocation_TextChanged(this, null);
                txtVideoURL_TextChanged(this, null);
                txtVLCLocation_TextChanged(this, null);
                cboVideoToExtractFrom_SelectionChanged(this, null);
                txtExtractEveryXFrames_TextChanged(this, null);
                txtTimeWindows_TextChanged(this, null);
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex.ToString());
            }
        }
コード例 #2
0
        public static void SaveSettingsToDrive(ExtractorSettings settings)
        {
            string filename = GetSettingsFilename();

            Directory.CreateDirectory(Path.GetDirectoryName(filename));

            XamlServices.Save(filename, settings);
        }
コード例 #3
0
        private void EnsureFoldersExist_SaveSettings()
        {
            ShowErrorMessage();

            _sessionFolders.EnsureFoldersExist();

            if (_sessionFolders.DoFoldersExist)
            {
                _settings.BaseFolder = _sessionFolders.BaseFolder;
                ExtractorSettings.SaveSettingsToDrive(_settings);
            }
            else
            {
                ShowErrorMessage(_sessionFolders.FolderExistenceErrorMessage);
            }
        }