public ExportImportDialog(bool isExportMode, bool showIgnore, IEnumerable <IApplication> apps, IEnumerable <IGesture> gestures)
        {
            _isExportMode = isExportMode;

            InitializeComponent();

            ApplicationSelector.Initialize(apps, gestures, showIgnore, !_isExportMode);

            Title            = LocalizationProvider.Instance.GetTextValue(_isExportMode ? "Common.Export" : "Common.Import");
            OkButton.Content = LocalizationProvider.Instance.GetTextValue(_isExportMode ? "ExportImportDialog.ExportButton" : "ExportImportDialog.ImportButton");
        }
        private void LoadSettingFile(byte[] file)
        {
            if (Directory.Exists(_tempDirectory))
            {
                Directory.Delete(_tempDirectory, true);
            }
            Directory.CreateDirectory(_tempDirectory);

            string filePath = Path.Combine(_tempDirectory, "Setting.zip");

            File.WriteAllBytes(filePath, file);
            ZipFile.ExtractToDirectory(filePath, _tempDirectory);

            var newApps  = new List <IApplication>();
            var gestures = new List <IGesture>();

            foreach (string settingFile in Directory.GetFiles(_tempDirectory, "*.*", SearchOption.AllDirectories))
            {
                switch (Path.GetExtension(settingFile))
                {
                case ".gsa":
                    var currentApps = FileManager.LoadObject <List <IApplication> >(settingFile, false, true);
                    if (currentApps != null)
                    {
                        newApps.AddRange(currentApps);
                    }
                    break;

                case ".gest":
                    var currentGestures = FileManager.LoadObject <List <Gesture> >(settingFile, false);
                    if (currentGestures != null)
                    {
                        gestures.AddRange(currentGestures);
                    }
                    break;
                }
            }

            Dispatcher.InvokeAsync(() =>
            {
                ApplicationSelector.Initialize(newApps, gestures);
                ProgressRing.Visibility        = Visibility.Collapsed;
                ApplicationSelector.Visibility = Visibility.Visible;
            }
                                   , DispatcherPriority.Input);

            File.Delete(filePath);
            Directory.Delete(_tempDirectory, true);
        }