예제 #1
0
파일: MainForm.cs 프로젝트: win32system/XO
        public MainForm()
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;

            client    = new Client();
            auth      = new Authorization(client);
            lobby     = new Lobby(client);
            handShake = new HandShake(client);
            game      = new Game(client);



            auth.LogIn += LogInHandler;

            lobby.RefreshClients += RefreshClientsHandler;
            lobby.Notification   += ShowNotificationHandler;

            handShake.Answer += AnswerFormHandler;
            handShake.Cancle += CancleHandler;
            handShake.Wait   += WaitHandler;

            game.Close += WaitFormClose;
            game.roomdialog.FormClosed += CloseFormHandler;
            game.Enabled += EnabledHandler;

            this.btn_refresh.Click += lobby.SendRefreshClients;
            this.btn_log_out.Click += auth.SendLogout;
            this.FormClosed        += auth.SendLogout;
        }
예제 #2
0
 public AnswerForm(HandShake handShake, object arg)
 {
     InitializeComponent();
     this.handShake = handShake;
     object[] args = JsonConvert.DeserializeObject <object[]>(arg.ToString());
     label1.Text = args[0] + " приглашает вас поиграть в " + args[1];
     this.args   = args;
 }
예제 #3
0
파일: Listener.cs 프로젝트: win32system/XO
        public Listener(Client client, Authorization auth, Lobby lobby, HandShake handShake, Game game)
        {
            this.client    = client;
            this.auth      = auth;
            this.lobby     = lobby;
            this.handShake = handShake;
            this.game      = game;

            Thread listenthread = new Thread(new ThreadStart(Listen));

            listenthread.Start();
        }