예제 #1
0
 public AddRoom(CreateRoomDelegate delegat, string token)
 {
     InitializeComponent();
     context      = new CreateRoomVM(token);
     DataContext  = context;
     this.delegat = delegat;
 }
예제 #2
0
        private void CreateRoomButton_Click(object sender, RoutedEventArgs e)
        {
            CreateRoomDelegate delegat = CreateRoom;
            AddRoom            ar      = new AddRoom(delegat, token);

            ar.Show();
        }
예제 #3
0
 public void GoToRoom(CreateRoomDelegate factory)
 {
     PreviousRoom = CurrentRoom;
     if (PreviousRoom != null)
         CleanupPreviousRoom();
     CurrentRoom = factory(this);
     ReturnRoom = null;
 }
예제 #4
0
파일: MainForm.cs 프로젝트: tansent/GoBang
        delegate void CreateRoomDelegate(int tableIndex); //The GobangRoom(tables) components in panel will be altered(disabled). So a delegate shall be created

        private void CreateRoom(int tableIndex)
        {
            if (this.InvokeRequired == true)
            {
                CreateRoomDelegate d = new CreateRoomDelegate(CreateRoom);
                this.Invoke(d, tableIndex);
            }
            else
            {
                playingTable = new PlayingTable(tableIndex, side, sw);
                playingTable.Show();                    //Show the PlayingTable Form          !!!Now the window has transfer to the PlayingTable

                for (int i = 0; i < tables.Length; i++) //Invalidate all the table(GobangRoom) component
                {
                    tables[i].Enabled = false;
                }

                this.WindowState = FormWindowState.Minimized;
            }
        }
예제 #5
0
 public void GoToRoomThenReturn(CreateRoomDelegate factory, RoomBase returnRoom)
 {
     PreviousRoom = CurrentRoom;
     CurrentRoom = factory(this);
     ReturnRoom = returnRoom;
 }