private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (this.metroListView1.SelectedItems.Count == 0) { return; } var item = this.metroListView1.SelectedItems[0]; SignaturesDB.Delete((VirusInfo)item.Tag); SignaturesDB.UpdateList(this.metroListView1); btn_ApplyChanges.Visible = true; }
private void metroButton1_Click(object sender, EventArgs e) { { SignaturesDB.Save(); SignaturesDB.DBFile.Close(); } { var notify = new PopupNotifier(); notify.TitleText = "DB Editor"; notify.ContentText = "Изменения сохранены"; notify.Popup(); } this.Close(); }
private void metroTile2_Click(object sender, EventArgs e) { var res = openFileDialog1.ShowDialog(); if (res == DialogResult.OK) { try { SignaturesDB.Path = openFileDialog1.FileName; SignaturesDB.DBFile = File.Open(openFileDialog1.FileName, FileMode.Open, FileAccess.ReadWrite); SignaturesDB.Load(); new Editor().ShowDialog(); } catch (Exception ex) { MetroMessageBox.Show(this, "Ошибка открытия файла\n" + ex.Message); } } }
private void добавитьToolStripMenuItem_Click(object sender, EventArgs e) { var form = new AddNewSignatureForm(); form.ShowDialog(); if (form.Add) { var type = VirusType.Unknown; Enum.TryParse <VirusType>(form.TypeComboBox.Text, out type); SignaturesDB.Add( type, form.metroTextBox_NAME.Text, form.signature ); SignaturesDB.UpdateList(this.metroListView1); btn_ApplyChanges.Visible = true; } }
private void Editor_FormClosing(object sender, FormClosingEventArgs e) { SignaturesDB.Close(); }
private void Editor_Shown(object sender, EventArgs e) { SignaturesDB.UpdateList(this.metroListView1); }