Exemplo n.º 1
0
        public static void JoinChatRoom(ChatRoom room, string password)
        {
            if (room.Properties.ContainsKey("Window") == false)
            {
                if (room.HasPassword)
                {
                    if (password != null && room.TestPassword(password))
                    {
                        room.Network.JoinChat(room, password);
                    }
                    else
                    {
                        ChatRoomPasswordDialog dialog =
                            new ChatRoomPasswordDialog(Gui.MainWindow.Window, room);
                        if (dialog.Run() == (int)ResponseType.Ok)
                        {
                            room.Network.JoinChat(room, dialog.Password);
                        }
                    }
                }
                else
                {
                    room.Network.JoinChat(room);
                }
            }
            else
            {
                (room.Properties ["Window"] as ChatRoomSubpage).GrabFocus();
            }

            Gui.MainWindow.SelectedPage = ChatsPage.Instance;
        }
Exemplo n.º 2
0
        public static void JoinChatRoom(ChatRoom room, string password)
        {
            if (room.Properties.ContainsKey("Window") == false) {
                if (room.HasPassword) {
                    if (password != null && room.TestPassword(password)) {
                        room.Network.JoinChat(room, password);
                    } else {
                        ChatRoomPasswordDialog dialog =
                            new ChatRoomPasswordDialog (Gui.MainWindow.Window, room);
                        if (dialog.Run() == (int)ResponseType.Ok) {
                            room.Network.JoinChat(room, dialog.Password);
                        }
                    }
                } else {
                    room.Network.JoinChat(room);
                }
            } else {
                (room.Properties ["Window"] as ChatRoomSubpage).GrabFocus();
            }

            Gui.MainWindow.SelectedPage = ChatsPage.Instance;
        }