private void Act_StopThreadAndShutdown(DataGridViewRow row) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndShutdown); if (dataGridView.InvokeRequired) { dataGridView.Invoke(de, row); } else { lock (row) { string host = row.Cells["Host"].Value.ToString(); osManager.BeginShutdown(row, host); lock (threadList) { if (threadList.ContainsKey(row)) { threadList[row].Abort(null); Thread.Sleep(5000); } } pinger.BeginStart(host, row); } } }
private void Act_RemoveItem(DataGridViewRow row) { if (dataGridView.InvokeRequired) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_RemoveItem); dataGridView.Invoke(de, row); } else { pinger.BeginStop(row); lock (row) { lock (threadList) { if (threadList.ContainsKey(row)) { threadList[row].Abort(null); threadList.Remove(row); } } dataGridView.Rows.Remove(row); } } }
private void Act_StopThreadAndReboot(DataGridViewRow row) { if (dataGridView.InvokeRequired) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot); dataGridView.Invoke(de, row); } else { lock (row) { string host = row.Cells["Host"].Value.ToString(); osManager.BeginReboot(row, host); lock (threadList) { if (threadList.ContainsKey(row)) { DgvUtils.SetRowValue(ref row, WUCollums.Status, "WU Aborting, wait ..."); threadList[row].Abort(null); Thread.Sleep(5000); } } if (chkBoxEnablePingAfterBoot.Checked == true) { pinger.BeginStart(host, row); } } } }
private void Act_ShutdownSelectedItens() { foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows)) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndShutdown); de.BeginInvoke(row, null, null); } }
private void Act_ResetAuthorizationOnWsusSelectedItens() { foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows)) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_ResetAuthorizationOnWsus); de.BeginInvoke(row, null, null); } }
private void Act_RebootSelectedItens() { foreach (DataGridViewRow row in dataGridView.SelectedRows) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot); de.BeginInvoke(row, null, null); } }
private void validateImapCredentialsToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_CheckImapCredentials); foreach (DataGridViewRow row in dtGridMbx.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void startImapSyncToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartSync); foreach (DataGridViewRow row in dtGridMbx.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void Act_InstallUpdateInSelectedItens() { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_InstallUpdates); foreach (DataGridViewRow row in InvertSelectedRowOrder(dataGridView.SelectedRows)) { de.BeginInvoke(row, null, null); } }
private void getEWSMailboxSizeToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartMbxSize); foreach (DataGridViewRow row in dtGridMbx.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void Act_CountUpdatesSelectedItens() { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_CountUpdates); foreach (DataGridViewRow row in dataGridView.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void Act_StartCheckRebootSelectedItens() { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StartCheckReboot); foreach (DataGridViewRow row in dataGridView.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void removeItensToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(RemoveItem); foreach (DataGridViewRow row in dtGridMbx.SelectedRows) { //RemoveItem(row); de.BeginInvoke(row, null, null); } }
private void RemoveItem(DataGridViewRow row) { if (dtGridMbx.InvokeRequired) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(RemoveItem); dtGridMbx.Invoke(de, row); } else { lock (row) { lock (threadList) { if (threadList.ContainsKey(row)) { threadList[row].Abort(null); threadList.Remove(row); } } dtGridMbx.Rows.Remove(row); } } }
private void Act_InstallUpdateInSelectedItens() { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_InstallUpdates); foreach (DataGridViewRow row in dataGridView.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void Act_RemoveSelectedItens() { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_RemoveItem); foreach (DataGridViewRow row in dataGridView.SelectedRows) { de.BeginInvoke(row, null, null); } }
private void Act_StopThreadAndReboot(DataGridViewRow row) { if (dataGridView.InvokeRequired) { DataGridViewRowDelegate de = new DataGridViewRowDelegate(Act_StopThreadAndReboot); dataGridView.Invoke(de, row); } else { lock (row) { string host = row.Cells["Host"].Value.ToString(); pinger.BeginStart(host, row); lock (threadList) { if (threadList.ContainsKey(row)) { DgvUtils.SetRowValue(ref row, WUCollums.Status, "WU Aborting, wait ..."); threadList[row].Abort(null); Thread.Sleep(5000); } } osManager.BeginReboot(row, host); } } }