private void LoadVault(string filename) { _nVault = new NVaultLib(filename); _model.VaultCollection.Clear(); foreach (EntryModel model in _nVault.Entries.Select(entry => new EntryModel { EntryKey = entry.Key, EntryValue = entry.Value, EntryDate = entry.Timestamp, EntryDateRaw = entry.TimestampRaw })) { _model?.VaultCollection.Add(model); model.PropertyChanged += Model_PropertyChanged; } _model.VaultVersion = _nVault.Version; MainGrid.GridColumnSizer.ResetAutoCalculationforAllColumns(); MainGrid.GridColumnSizer.Refresh(); var list = _model.VaultCollection.Where(x => x.EntryKey.Equals("STEAM_1:0:752546275")).ToList(); _dataLoaded = true; _currentFile = filename; UpdateTitle(); }
private void SaveVault(string filename) { NVaultLib vaultLib = new NVaultLib(); foreach (EntryModel entryModel in _model.VaultCollection) { if (!string.IsNullOrWhiteSpace(entryModel.EntryKey)) { vaultLib.Entries.Add(new VaultEntry { Key = entryModel.EntryKey, Value = entryModel.EntryValue, TimestampRaw = entryModel.EntryDateRaw }); } } vaultLib.Version = _model.VaultVersion; vaultLib.Save(filename); }