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 SaveImageLocal(BitmapImage image, string localFilePath)
        {
            if (!DirectoryController.CreateDirectoryWhenNotExists(ImageDir) && !Directory.Exists(ImageDir))
            {
                return;
            }

            image.DownloadCompleted += (sender, args) =>
            {
                var encoder = new PngBitmapEncoder();
                encoder.Frames.Add(BitmapFrame.Create((BitmapImage)sender));
                using (var fileStream = new FileStream(localFilePath, FileMode.Create))
                {
                    encoder.Save(fileStream);
                }
            };
        }
        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);
                }
            }
        }