Example #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            Logger.EnteringMethod();
            btnStart.Enabled = false;
            btnClose.Enabled = false;
            bool result = false;

            this.Cursor = Cursors.WaitCursor;
            foreach (DataGridViewRow row in dgvComputers.Rows)
            {
                ADComputer computer = (ADComputer)row.Cells["Computer"].Value;
                result = computer.CleanSoftwareDistributionFolder(_username, _password);
                Logger.Write(computer.Name + " : " + result);
                if (result)
                {
                    row.Cells["Result"].Value = resMan.GetString("Succeeded");
                }
                else
                {
                    row.Cells["Result"].Value = resMan.GetString("Failed");
                }
            }
            this.Cursor      = Cursors.Default;
            btnStart.Enabled = true;
            btnClose.Enabled = true;
        }