Exemple #1
0
        private void MonitorPanelButton_Click(object sender, EventArgs e)
        {
            foreach (var temp in lformElementsMonitorings)
            {
                temp.DeletePanel(flowLayoutPanelMonitor);
            }
            List <string> tempList = AntivirusLibrary.DataBaseMethods.DataBaseGetAllNotes("Monitoring");

            foreach (var file in tempList)
            {
                var panelTemp = new FormElementsMonitoring(flowLayoutPanelMonitor);
                var tempData  = new AntivirusLibrary.DataReportMonitoring(file);
                panelTemp.textBoxMonitor.Text   = tempData.path;
                panelTemp.DataMonitorLabel.Text = tempData.date;
                panelTemp.TimeMonitorLabel.Text = tempData.time;
                if (tempData.operation.Equals("QUARANTINE"))
                {
                    panelTemp.ChangesMonitorLabel.Checked = false;
                }
                else if (tempData.operation.Equals("DELETE"))
                {
                    panelTemp.ChangesMonitorLabel.Checked = true;
                }

                lformElementsMonitorings.Add(panelTemp);
            }

            OffAll();
            MonitorPanel.Visible         = true;
            MonitorPanel.Location        = new System.Drawing.Point(179, 13);
            MonitorPanelButton.BackColor = Color.LightBlue;
        }
Exemple #2
0
        private void DirButtonMonitoring_Click(object sender, EventArgs e)
        {
            using (var fbd = new FolderBrowserDialog())
            {
                DialogResult result = fbd.ShowDialog();

                if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath))
                {
                    string[] files = Directory.GetFiles(fbd.SelectedPath);


                    string date = DateTime.Now.ToString("MM/dd/yyyy");
                    string time = DateTime.Now.ToString("H:mm");
                    DataBaseMethods.AddNote("Monitoring", "'PATH','DATE','TIME'", $"'{fbd.SelectedPath}','{date}','{time}'");


                    var panelTemp = new FormElementsMonitoring(flowLayoutPanelMonitor);
                    panelTemp.textBoxMonitor.Text   = fbd.SelectedPath;
                    panelTemp.DataMonitorLabel.Text = date;
                    panelTemp.TimeMonitorLabel.Text = time;
                    panelTemp.DeafultMonitoringAction();

                    lformElementsMonitorings.Add(panelTemp);
                }
            }
        }