public ApplicationListViewModel(bool isHKLM = false) { this.IsHKLM = isHKLM; this.Applications = new ObservableRangeCollection <ApplicationViewModel>(RegistryServices.GetApplications(this.RegistryKey)); this.AddFolderCommand = new DelegateCommand(this.AddFolder); this.AddFilesCommand = new DelegateCommand(this.AddFiles); this.SelectAllCommand = new DelegateCommand(this.SelectAll); this.UnselectAllCommand = new DelegateCommand(this.UnselectAll); this.RegeditCommand = new DelegateCommand(this.Regedit); this.ImportCommand = new DelegateCommand(this.Import, this.CanImport); this.ExportCommand = new DelegateCommand(this.Export); this.SubscribeEvents(); }
private void Import() { var openFileDialog = new OpenFileDialog() { Filter = "Registry files|*.reg", }; if (openFileDialog.ShowDialog(Application.Current.MainWindow).Value) { RegistryServices.ImportReg(openFileDialog.FileName); this.UnsubscribeEvents(); IsWaitingDisplayed.Instance.Publish(true); this.Applications.ClearItems(); this.Applications.AddRange(RegistryServices.GetApplications(this.RegistryKey)); IsWaitingDisplayed.Instance.Publish(false); this.SubscribeEvents(); } }