public static void InitializeSoundFilesFromDirectory() { if (AlertSounds != null) { return; } var soundFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.SoundDirectoryName); if (!Directory.Exists(soundFilePath)) { return; } var files = DirectoryController.GetFiles(soundFilePath, "*.wav"); if (files == null) { return; } if (AlertSounds == null) { AlertSounds = new List <FileInformation>(); } foreach (var file in files) { var fileInformation = new FileInformation(Path.GetFileNameWithoutExtension(file), file); AlertSounds.Add(fileInformation); } }
public static void InitializeLanguageFiles() { var languageFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.LanguageDirectoryName); if (Directory.Exists(languageFilePath)) { var files = DirectoryController.GetFiles(languageFilePath, "*.xml"); if (files == null) { return; } foreach (var file in files) { var fileNameWithoutExtension = new FileInfo(Path.GetFileNameWithoutExtension(file), file); FileInfos.Add(fileNameWithoutExtension); } } }