/// <summary> /// Removes the list of files from the current voicepack list /// </summary> /// <remarks> /// In stead of actually removing, I just recreate the combined voicepack from the updated list. /// My initial tests seem to indicate this is a fast enough operation and seems stable. /// To actually create a real remove, much work is needed. /// </remarks> public void RemoveVoicepacks(List <FileInfo> files) { foreach (var file in files) { VoicepacksFilesToCombine.Remove(file); } RecombineVoicepackFilesToCombine(); SaveVoicepackFilesToCombineToSettings(); CombinedVoicepack.ExportToFile(CombinedVoicepackBackupFilename); }
/// <summary> /// Rebuilds CombinedVoicepack from the VoicepacksFilesToCombine list /// </summary> private void RecombineVoicepackFilesToCombine() { InitializeCombinedVoicepack(); var invalidFilesToRemove = new List <FileInfo>(); foreach (var voicePackFile in VoicepacksFilesToCombine) { if (!CombinedVoicepack.Merge(voicePackFile.FullName)) { invalidFilesToRemove.Add(voicePackFile); } } foreach (var invalidFile in invalidFilesToRemove) { VoicepacksFilesToCombine.Remove(invalidFile); } }