Esempio n. 1
0
 public Test(PieceSet pieceSet)
     : this()
 {
     m_pieceSet  = pieceSet;
     m_ePiece    = ChessBoard.PieceE.Pawn;
     ShowControl();
 }
Esempio n. 2
0
        /// <summary>
        /// Called when the PieceSet is changed
        /// </summary>
        /// <param name="sender">   Sender Object</param>
        /// <param name="e">        Event argument</param>
        private void comboBoxPieceSet_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            int    iSelectedIndex;
            string strVal;

            iSelectedIndex = comboBoxPieceSet.SelectedIndex;
            if (iSelectedIndex != -1)
            {
                strVal              = comboBoxPieceSet.Items[iSelectedIndex] as string;
                PieceSet            = m_listPieceSet[strVal];
                m_chessCtl.PieceSet = PieceSet;
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Called when the reset to default button is pressed
 /// </summary>
 /// <param name="sender">   Sender object</param>
 /// <param name="e">        Event handler</param>
 private void butResetToDefault_Click(object sender, RoutedEventArgs e)
 {
     LiteCellColor                       = Colors.Moccasin;
     DarkCellColor                       = Colors.SaddleBrown;
     BackgroundColor                     = Colors.SkyBlue;
     PieceSet                            = m_listPieceSet["leipzig"];
     Background                          = new SolidColorBrush(BackgroundColor);
     m_chessCtl.LiteCellColor            = LiteCellColor;
     m_chessCtl.DarkCellColor            = DarkCellColor;
     m_chessCtl.PieceSet                 = PieceSet;
     customColorPickerLite.SelectedColor = LiteCellColor;
     customColorPickerDark.SelectedColor = DarkCellColor;
     customColorBackground.SelectedColor = BackgroundColor;
     comboBoxPieceSet.SelectedItem       = PieceSet.Name;
 }
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="colorLiteCell">    Lite Cells Color</param>
 /// <param name="colorDarkCell">    Dark Cells Color</param>
 /// <param name="colorWhitePiece">  White Pieces Color</param>
 /// <param name="colorBlackPiece">  Black Pieces Color</param>
 /// <param name="backGroundColor">  Main window background color</param>
 /// <param name="listPieceSet">     List of Piece Sets</param>
 /// <param name="pieceSet">         Current Piece Set</param>
 public frmBoardSetting(Color colorLiteCell, Color colorDarkCell, Color colorWhitePiece, Color colorBlackPiece, Color backGroundColor, SortedList<string, PieceSet> listPieceSet, PieceSet pieceSet)
 {
     InitializeComponent();
     LiteCellColor               = colorLiteCell;
     DarkCellColor               = colorDarkCell;
     WhitePieceColor             = colorWhitePiece;
     BlackPieceColor             = colorBlackPiece;
     BackgroundColor             = backGroundColor;
     m_listPieceSet              = listPieceSet;
     PieceSet                    = pieceSet;
     m_chessCtl.LiteCellColor    = colorLiteCell;
     m_chessCtl.DarkCellColor    = colorDarkCell;
     m_chessCtl.WhitePieceColor  = colorWhitePiece;
     m_chessCtl.BlackPieceColor  = colorBlackPiece;
     m_chessCtl.PieceSet         = pieceSet;
     Background                  = new SolidColorBrush(BackgroundColor);
     Loaded                     += new RoutedEventHandler(frmBoardSetting_Loaded);
     FillPieceSet();
 }
Esempio n. 5
0
 /// <summary>
 /// Class constructor
 /// </summary>
 /// <param name="colorLiteCell">    Lite Cells Color</param>
 /// <param name="colorDarkCell">    Dark Cells Color</param>
 /// <param name="colorWhitePiece">  White Pieces Color</param>
 /// <param name="colorBlackPiece">  Black Pieces Color</param>
 /// <param name="backGroundColor">  Main window background color</param>
 /// <param name="listPieceSet">     List of Piece Sets</param>
 /// <param name="pieceSet">         Current Piece Set</param>
 public frmBoardSetting(Color colorLiteCell, Color colorDarkCell, Color colorWhitePiece, Color colorBlackPiece, Color backGroundColor, SortedList <string, PieceSet> listPieceSet, PieceSet pieceSet)
 {
     InitializeComponent();
     LiteCellColor              = colorLiteCell;
     DarkCellColor              = colorDarkCell;
     WhitePieceColor            = colorWhitePiece;
     BlackPieceColor            = colorBlackPiece;
     BackgroundColor            = backGroundColor;
     m_listPieceSet             = listPieceSet;
     PieceSet                   = pieceSet;
     m_chessCtl.LiteCellColor   = colorLiteCell;
     m_chessCtl.DarkCellColor   = colorDarkCell;
     m_chessCtl.WhitePieceColor = colorWhitePiece;
     m_chessCtl.BlackPieceColor = colorBlackPiece;
     m_chessCtl.PieceSet        = pieceSet;
     Background                 = new SolidColorBrush(BackgroundColor);
     Loaded += new RoutedEventHandler(frmBoardSetting_Loaded);
     FillPieceSet();
 }
Esempio n. 6
0
 public Test(PieceSet pieceSet) : this()
 {
     m_pieceSet = pieceSet;
     m_ePiece   = ChessBoard.PieceE.Pawn;
     ShowControl();
 }