Beispiel #1
0
        private void ImportConfiguration()
        {
            var file = _ideAccess.ShowImportConfigurationDialog();

            if (!string.IsNullOrEmpty(file))
            {
                try
                {
                    var model = SettingsExportViewModel.Deserialize(File.ReadAllBytes(file));
                    Groups = new ObservableCollection <ProjectGroup>(model.ProjectGroups ?? new ProjectGroup[0]);
                    Groups.CollectionChanged += (sender, args) => OnPropertyChanged(nameof(IsEmpty));
                    GroupColumns              = model.GroupColumns;
                    ProjectColumns            = model.ProjectColumns;

                    PersistSettings();

                    _ideAccess.ShowImportResultDialog(file);
                }
                catch (Exception e)
                {
                    Debug.WriteLine("Importing settings failed", e);
                    _ideAccess.ShowImportResultDialog(file, e);
                }
            }
        }