예제 #1
0
        private void HandleChangeSavePath(object sender, RoutedEventArgs e) // 저장 경로 변경을 위한 이벤트 핸들러
        {
            var set = Properties.Settings.Default;

            using var dialog        = new CommonOpenFileDialog { IsFolderPicker = true };
            dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/ITS";

            if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
            {
                // 설정 변경 후 필요 폴더 생성
                set.IsSavePathCustomed = true;
                set.SavePath           = dialog.FileName;
                ttsFileSavePath.Text   = set.SavePath;

                DirectoryInfo dmp3 = new DirectoryInfo(dialog.FileName + "/mp3");
                DirectoryInfo dtxt = new DirectoryInfo(dialog.FileName + "/txt");

                dmp3.Create();
                dtxt.Create();
            }

            // 설정 저장
            set.Save();
            SettingForm.Focus();
        }