Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
            }
        }