/// <summary> /// Flash the specified cell /// </summary> /// <param name="ptCell"> Cell to flash</param> public void FlashCell(IntPoint ptCell) { int iCellPos; Border border; Brush brush; Color colorStart; Color colorEnd; SyncFlash syncFlash; iCellPos = ptCell.X + ptCell.Y * 8; if (((ptCell.X + ptCell.Y) & 1) != 0) { colorStart = DarkCellColor; // m_colorInfo.m_colDarkCase; colorEnd = LiteCellColor; // m_colorInfo.m_colLiteCase; } else { colorStart = LiteCellColor; // m_colorInfo.m_colLiteCase; colorEnd = DarkCellColor; // m_colorInfo.m_colDarkCase; } border = m_arrBorder[iCellPos]; brush = border.Background.Clone(); border.Background = brush; syncFlash = new SyncFlash(this, brush as SolidColorBrush, colorStart, colorEnd); syncFlash.Flash(); }
/// <summary> /// Flash the specified cell /// </summary> /// <param name="ptCell"> Cell to flash</param> public void FlashCell(IntPoint ptCell) { int iCellPos; Border border; Brush brush; Color colorStart; Color colorEnd; SyncFlash syncFlash; bool bMoveListWasEnabled = true; m_iFlashing++; // When flashing, a message loop is processed which can cause reentrance problem if (m_moveListUI != null) { bMoveListWasEnabled = m_moveListUI.IsEnabled; //m_moveListUI.IsEnabled = false; } try { iCellPos = ptCell.X + ptCell.Y * 8; if (((ptCell.X + ptCell.Y) & 1) != 0) { colorStart = DarkCellColor; // m_colorInfo.m_colDarkCase; colorEnd = LiteCellColor; // m_colorInfo.m_colLiteCase; } else { colorStart = LiteCellColor; // m_colorInfo.m_colLiteCase; colorEnd = DarkCellColor; // m_colorInfo.m_colDarkCase; } border = m_arrBorder[iCellPos]; brush = border.Background.Clone(); border.Background = brush; syncFlash = new SyncFlash(this, brush as SolidColorBrush, colorStart, colorEnd); syncFlash.Flash(); } finally { m_iFlashing--; if (m_moveListUI != null) { //m_moveListUI.IsEnabled = bMoveListWasEnabled; } } }