private void BtnReload_Click(object sender, EventArgs e) { ToggleButtons(); vaultFile = new VaultFile(); lvEntries.Items.Clear(); OpenVaultFile(selectedFileName); }
private void UpdateTimestamp(VaultEntry itemEntry) { if (itemEntry.timestamp != 0) { txtTimestamp.Text = $"{itemEntry.timestamp.ToString()} ({VaultFile.ConvertFromUnixTime( itemEntry.timestamp ).ToString( "MMM dd, yyyy" )})"; } else { txtTimestamp.Text = "Permanent"; } }
private void OpenVaultFile(String fileName) { if (File.Exists(fileName)) { vaultFile = new VaultFile(); if (!vaultFile.Open(fileName)) { DarkMessageBox.ShowError("Invalid nVault file opened\nMake sure the vault file is not currently opened on a running server.", "Error"); return; } // Update UI ToggleButtons(true); lvEntries.Items.Clear(); pnlMainContainer.SectionHeader = Path.GetFileName(selectedFileName); lblEntryCount.Text = "Total Entries: " + vaultFile.NumberOfEntries(); // Populate listview vaultFile.PopulateListView(lvEntries); SelectFirstKey(); } }
private void BtnEntryTimeUpdate_Click(object sender, EventArgs e) { vaultFile.SelectedEntry.timestamp = VaultFile.ConvertFromDateTime(DateTime.Now); UpdateTimestamp(vaultFile.SelectedEntry); }