private void CheckMarker() { if (checking) { return; } try { checking = true; error = false; lock (game.Markers) { game.CheckValid(Marker); label8.Visible = false; label8.Text = String.Empty; } } catch (Exception ex) { //error = true; label8.Visible = true; label8.Text = ex.Message; } finally { checking = false; } UpdateUI(); }
private void dataGridView1_SelectedIndexChanged(object sender, EventArgs e) { if (dataGridView1.SelectedItems.Count == 1 && GetDataGrid().SelectedItems[0].Tag is Game.Marker) { var mk = (Game.Marker)GetDataGrid().SelectedItems[0].Tag; linkLabel2.Visible = mk.TimeVideo == -1; try { game.CheckValid(mk); label1.Visible = false; } catch (HockeyIce.CheckValidMarkerException ex) { switch (ex.CheckValidLevel) { case HockeyIce.CheckValidMarkerException.CheckValidLevelEnum.WARNING: label1.ForeColor = Color.Black; label1.BackColor = Color.Yellow; break; case HockeyIce.CheckValidMarkerException.CheckValidLevelEnum.CRITICAL: label1.ForeColor = Color.White; label1.BackColor = Color.Red; break; } label1.Text = ex.Message; label1.Visible = true; } } else { linkLabel2.Visible = false; } }