private void btn_Exit_Click(object sender, EventArgs e) { TotalMessage msg = new TotalMessage(Settings.AppName, "Are you sure you want to exit?", MessageBoxButtons.YesNo); if (msg.ShowDialog() == DialogResult.Yes) { notifyIcon.Visible = false; notifyIcon.Icon = null; notifyIcon.Dispose(); msg.Dispose(); Application.Exit(); } msg.Dispose(); }
private bool IsAnyKeyValid() { if (!Settings.isPremium() && !Settings.isPublic()) { TotalMessage msg = new TotalMessage("Scan Error", "No available key found!", MessageBoxButtons.OK); msg.ShowDialog(); msg.Dispose(); return(false); } return(true); }
public void AddToScan(string file, int scan_cmd) { if (AnyTaskActive()) { if (msg_already_running == null) { TotalMessage msg = new TotalMessage("Files Scan", "There is already an active scan running", MessageBoxButtons.OK); msg_already_running = msg; msg.ShowDialog(); msg.Dispose(); msg_already_running = null; return; } } if (!IsAnyKeyValid()) { return; } if (!queue_enabled) { if (scan_cmd == 1 && parent.Visible && parent.opened_runsafe) { parent.HideForm(); parent.opened_runsafe = false; } queue_enabled = true; Task.Run(() => CloseQueue((scan_cmd == 1) ? true : false)); upload_files.Clear(); } if (queue_enabled) { upload_files.Add(file); } }