/// <summary> /// Save the chess board control settings to the property setting /// </summary> /// <param name="chessCtl"> Chess board control</param> public void FromChessBoardCtl(ChessBoardControl chessCtl) { m_settings.WhitePieceColor = chessCtl.WhitePieceColor.ToString(); m_settings.BlackPieceColor = chessCtl.BlackPieceColor.ToString(); m_settings.LiteCellColor = chessCtl.LiteCellColor.ToString(); m_settings.DarkCellColor = chessCtl.DarkCellColor.ToString(); }
/// <summary> /// Save the chess board control settings to the property setting /// </summary> /// <param name="chessCtl"> Chess board control</param> public void SaveChessBoardCtl(ChessBoardControl chessCtl) { m_settings.WhitePieceColor = chessCtl.WhitePieceColor.ToString(); m_settings.BlackPieceColor = chessCtl.BlackPieceColor.ToString(); m_settings.LiteCellColor = chessCtl.LiteCellColor.ToString(); m_settings.DarkCellColor = chessCtl.DarkCellColor.ToString(); m_settings.FlashPiece = chessCtl.MoveFlashing; }
/// <summary> /// Load the chess board control settings from the property setting /// </summary> /// <param name="chessCtl"> Chess board control</param> public void LoadChessBoardCtl(ChessBoardControl chessCtl) { chessCtl.LiteCellColor = NameToColor(m_settings.LiteCellColor); chessCtl.DarkCellColor = NameToColor(m_settings.DarkCellColor); chessCtl.WhitePieceColor = NameToColor(m_settings.WhitePieceColor); chessCtl.BlackPieceColor = NameToColor(m_settings.BlackPieceColor); chessCtl.MoveFlashing = m_settings.FlashPiece; }
/// <summary> /// Class Ctor /// </summary> /// <param name="chessBoardControl"> Chess Board Control</param> /// <param name="brush"> Solid Color Brush to flash</param> /// <param name="colorStart"> First flashing color</param> /// <param name="colorEnd"> Second flashing color</param> public SyncFlash(ChessBoardControl chessBoardControl, SolidColorBrush brush, Color colorStart, Color colorEnd) { m_chessBoardControl = chessBoardControl; m_brush = brush; m_colorStart = colorStart; m_colorEnd = colorEnd; }
/// <summary> /// Called to gets the type of pawn promotion for the current move /// </summary> /// <param name="sender"> Sender object</param> /// <param name="e"> Event handler</param> private void m_chessCtl_QueryPawnPromotionType(object sender, ChessBoardControl.QueryPawnPromotionTypeEventArgs e) { frmQueryPawnPromotionType frm; frm = new frmQueryPawnPromotionType(e.ValidPawnPromotion); frm.Owner = this; frm.ShowDialog(); e.PawnPromotionType = frm.PromotionType; }
/// <summary> /// Called to gets the selected piece for design mode /// </summary> /// <param name="sender"> Sender object</param> /// <param name="e"> Event handler</param> private void m_chessCtl_QueryPiece(object sender, ChessBoardControl.QueryPieceEventArgs e) { e.Piece = m_lostPieceBlack.SelectedPiece; }
/// <summary> /// Called when the user has selected a valid move /// </summary> /// <param name="sender"> Sender object</param> /// <param name="e"> Event handler</param> void m_chessCtl_MoveSelected(object sender, ChessBoardControl.MoveSelectedEventArgs e) { bool bFlash; bool bEndOfGame; ChessBoard.MoveResultE eMoveResult; bFlash = mnuOptionFlashPiece.IsChecked; eMoveResult = m_chessCtl.DoMove(e.Move, bFlash, -1, 0, 0); bEndOfGame = DisplayMessage(eMoveResult, MessageModeE.Verbose); if (!bEndOfGame) { CheckIfComputerMustPlay(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.dockPanel1 = ((System.Windows.Controls.DockPanel)(target)); return; case 2: this.stackPanel1 = ((System.Windows.Controls.StackPanel)(target)); return; case 3: this.butOk = ((System.Windows.Controls.Button)(target)); #line 7 "..\..\..\frmBoardSetting.xaml" this.butOk.Click += new System.Windows.RoutedEventHandler(this.butOk_Click); #line default #line hidden return; case 4: this.butCancel = ((System.Windows.Controls.Button)(target)); return; case 5: this.dockPanel2 = ((System.Windows.Controls.DockPanel)(target)); return; case 6: this.stackPanel2 = ((System.Windows.Controls.StackPanel)(target)); return; case 7: this.groupBox1 = ((System.Windows.Controls.GroupBox)(target)); return; case 8: this.stackPanel3 = ((System.Windows.Controls.StackPanel)(target)); return; case 9: this.grid1 = ((System.Windows.Controls.Grid)(target)); return; case 10: this.label1 = ((System.Windows.Controls.Label)(target)); return; case 11: this.label2 = ((System.Windows.Controls.Label)(target)); return; case 12: this.label3 = ((System.Windows.Controls.Label)(target)); return; case 13: this.label4 = ((System.Windows.Controls.Label)(target)); return; case 14: this.customColorPickerLite = ((SrcChess2.CustomColorPicker)(target)); return; case 15: this.customColorPickerDark = ((SrcChess2.CustomColorPicker)(target)); return; case 16: this.customColorBackground = ((SrcChess2.CustomColorPicker)(target)); return; case 17: this.comboBoxPieceSet = ((System.Windows.Controls.ComboBox)(target)); #line 33 "..\..\..\frmBoardSetting.xaml" this.comboBoxPieceSet.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBoxPieceSet_SelectionChanged); #line default #line hidden return; case 18: this.button1 = ((System.Windows.Controls.Button)(target)); #line 35 "..\..\..\frmBoardSetting.xaml" this.button1.Click += new System.Windows.RoutedEventHandler(this.butResetToDefault_Click); #line default #line hidden return; case 19: this.m_chessCtl = ((SrcChess2.ChessBoardControl)(target)); return; } this._contentLoaded = true; }