예제 #1
0
        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;
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
 private void Editor_FormClosing(object sender, FormClosingEventArgs e)
 {
     SignaturesDB.Close();
 }
예제 #6
0
 private void Editor_Shown(object sender, EventArgs e)
 {
     SignaturesDB.UpdateList(this.metroListView1);
 }