private async Task ProcessExport(Data.UtaFormat format, string fileName) { ShowProcessingScreen(); switch (format) { case Data.UtaFormat.Vsq4: await exportingData.ExportVsq4(fileName); break; case Data.UtaFormat.Ust: await exportingData.ExportUst(fileName); break; case Data.UtaFormat.Ccs: await exportingData.ExportCcs(fileName); break; case Data.UtaFormat.Vpr: await exportingData.ExportVpr(fileName); break; default: break; } HideProcessingScreen(); }
private async Task <bool> TransformLyrics(Data.UtaFormat toFormat) { var changeLyrics = new ChangeLyrics(); switch (mainData.Lyric.TypeAnalysed) { case Lyric.LyricType.None: System.Windows.MessageBox.Show("The type of the lyrics is not detected, please select the correct type by yourself.", "Lyrics Transformation"); changeLyrics.RadioButtonFrom1.IsChecked = true; break; case Lyric.LyricType.RomajiTandoku: changeLyrics.RadioButtonFrom1.IsChecked = true; break; case Lyric.LyricType.RomajiRenzoku: changeLyrics.RadioButtonFrom2.IsChecked = true; break; case Lyric.LyricType.KanaTandoku: changeLyrics.RadioButtonFrom3.IsChecked = true; break; case Lyric.LyricType.KanaRenzoku: changeLyrics.RadioButtonFrom4.IsChecked = true; break; default: break; } changeLyrics.RadioButtonTo3.IsChecked = true; switch (toFormat) { case Data.UtaFormat.Vsq4: changeLyrics.RadioButtonTo2.Visibility = Visibility.Hidden; changeLyrics.RadioButtonTo4.Visibility = Visibility.Hidden; changeLyrics.RadioButtonTo3.Margin = changeLyrics.RadioButtonTo2.Margin; break; case Data.UtaFormat.Ccs: changeLyrics.RadioButtonTo1.Visibility = Visibility.Hidden; changeLyrics.RadioButtonTo2.Visibility = Visibility.Hidden; changeLyrics.RadioButtonTo4.Visibility = Visibility.Hidden; changeLyrics.RadioButtonTo3.Margin = changeLyrics.RadioButtonTo1.Margin; break; default: break; } bool?dialogResult = changeLyrics.ShowDialog(); if (dialogResult == true) { ShowProcessingScreen(); await Task.Run(() => { exportingData.Lyric.Transform(changeLyrics.fromType, changeLyrics.ToType); }); HideProcessingScreen(); return(true); } else { return(false); } }