private void CWavManager_Execute() { var block = new CwavBlock(); bool imported = block.TryImport(ViewModel.CWavBytes); if (!imported) { MessageBox.Show("One or more errors have ocurred while parsing the CWAV Data\n" + "Some data may have been recovered, however some issues may be present."); } var wnd = new CwavWindow(block) { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; var dlg = wnd.ShowDialog(); if (dlg.HasValue && dlg.Value) { var data = wnd.ViewModel.Generate(); if (data.Length > 0x2DC00) { MessageBox.Show("CWAV Data Too Big\nRe-assign the smaller CWAVs and try again."); } else { ViewModel.CWavBytes = data; } } }
public CwavWindow(CwavBlock block) { InitializeComponent(); ViewModel = block; _sfxPlayer = new WaveOut(); PlaySfxCommand = new RelayCommand<CwavKind>(PlayAudio_Execute, CanExecute_HasAudio); ImportCommand = new RelayCommandAsync<CwavKind, ImportResults>(Import_Execute, null, null, Import_PostExecute); ExportSfxCommand = new RelayCommandAsync<CwavKind, ExportResults>(Export_Execute, CanExecute_HasAudio, null, Export_PostExecute); RemoveSfxCommand = new RelayCommand<CwavKind>(Remove_Execute, CanExecute_HasAudio); ReplaceSfxCommand = new RelayCommand<object>(Replace_Execute); }
private void CWavManager_Execute() { var block = new CwavBlock(); bool imported = block.TryImport(ViewModel.CWavBytes); if (!imported) MessageBox.Show("One or more errors have ocurred while parsing the CWAV Data\n" + "Some data may have been recovered, however some issues may be present."); var wnd = new CwavWindow(block) { Owner = this, WindowStartupLocation = WindowStartupLocation.CenterOwner }; var dlg = wnd.ShowDialog(); if (dlg.HasValue && dlg.Value) { var data = wnd.ViewModel.Generate(); if (data.Length > 0x2DC00) MessageBox.Show("CWAV Data Too Big\nRe-assign the smaller CWAVs and try again."); else ViewModel.CWavBytes = data; } }