private void action_statusUpdated(object sender, PlanActionStatusChangedEventArgs e) { Host senderHost = e.XenObject as Host; if (senderHost == null) { return; } PlanAction plan = sender as PlanAction; if (plan == null) { return; } List <DataGridViewRowUpgrade> rowsForHost = (from DataGridViewRowUpgrade row in dataGridView1.Rows where row.RowIsForHost(senderHost) select row).ToList(); foreach (DataGridViewRowUpgrade row in rowsForHost) { DataGridViewRowUpgrade closureRow = row; Program.Invoke(this, () => closureRow.UpdateStatus(HostUpgradeState.Upgrading, plan.Status)); } }
private void planAction_StatusChanged(PlanAction plan, Host senderHost) { if (senderHost == null || plan == null) { return; } List <DataGridViewRowUpgrade> rowsForHost = (from DataGridViewRowUpgrade row in dataGridView1.Rows where row.RowIsForHost(senderHost) select row).ToList(); foreach (DataGridViewRowUpgrade row in rowsForHost) { DataGridViewRowUpgrade closureRow = row; Program.Invoke(this, () => closureRow.UpdateStatus(HostUpgradeState.Upgrading, plan.Status)); } }