示例#1
0
        private void mnuExclude_Click(object sender, EventArgs e)
        {
            if (_task == null)
            {
                return;
            }
            var ex = new ExcludeNewForm {
                ExePathName = _task.ExePath
            };

            try
            {
                if (ex.ShowDialog() == DialogResult.OK)
                {
                    var excl = ex.ExePathName.ToLower().Trim();
                    if (excl.Length > 0 && !Program.ExcludedExes.Contains(excl))
                    {
                        Program.ExcludedExes.Add(excl);
                        AppSettings.SetExcludedExes();
                        Program.TheForm.RefreshData();
                        Close();
                    }
                }
            }
            finally
            {
                ex.Dispose();
            }
        }
示例#2
0
        private void mnuAdd_Click(object sender, EventArgs e)
        {
            var ex     = new ExcludeNewForm();
            var res    = ex.ShowDialog();
            var newExe = ex.ExePathName.Trim().ToLower();

            if (res == DialogResult.OK && newExe.Length > 0 && !Program.ExcludedExes.Contains(newExe))
            {
                Program.ExcludedExes.Add(newExe);
                AppSettings.SetExcludedExes();
                PopulateExclusions();
            }
            ex.Dispose();
        }