예제 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            NoughtsAndCrossesGame     noughtsAndCrossesGame     = new NoughtsAndCrossesGame();
            NoughtsAndCrossesForm     noughtsAndCrossesForm     = new NoughtsAndCrossesForm(noughtsAndCrossesGame);
            NoughtsAndCrossesFormData noughtsAndCrossesFormData = new NoughtsAndCrossesFormData();

            noughtsAndCrossesForm.SetNotifyPropertyChanged(noughtsAndCrossesFormData);
            noughtsAndCrossesGame.SetFormData(noughtsAndCrossesFormData);

            Application.Run(noughtsAndCrossesForm);
        }
        public void SetFormData(NoughtsAndCrossesFormData aNoughtsAndCrossesFormData)
        {
            noughtsAndCrossesFormData = aNoughtsAndCrossesFormData;

            noughtsAndCrossesFormData.bCheckMyFirstMove = true;
            noughtsAndCrossesFormData.rowCellsCount     = gameCtrl.NumberToWin;
            noughtsAndCrossesFormData.textIPAddress     = "Ваш IP-адрес: " + TcpServer.GetAddress();

            noughtsAndCrossesFormData.bCheckMyFirstMove = true;
            noughtsAndCrossesFormData.rowCellsCount     = gameCtrl.NumberToWin;
            noughtsAndCrossesFormData.textIPAddress     = "Ваш IP-адрес: " + TcpServer.GetAddress();
            if (OnGameStatusChanged != null)
            {
                OnGameStatusChanged(YOUR_SELECT);
            }

            gameCtrl.Init(3);
        }
 public void SetNotifyPropertyChanged(NoughtsAndCrossesFormData noughtsAndCrossesFormData)
 {
     this.bindingSource.DataSource = noughtsAndCrossesFormData;
 }