コード例 #1
0
        public void Perform()
        {
            var sendingContent = new ServerSetRoomAdminCommand.MessageContent {
                RoomName = _roomName, NewAdmin = _newAdmin
            };

            ClientModel.Client.SendMessage(ServerSetRoomAdminCommand.CommandId, sendingContent);
        }
コード例 #2
0
ファイル: StandardClientAPI.cs プロジェクト: quangfox/TCPChat
        /// <summary>
        /// Изменяет администратора комнаты.
        /// </summary>
        /// <param name="roomName">Название комнаты.</param>
        /// <param name="newAdmin">Пользователь назначаемый администратором.</param>
        public void SetRoomAdmin(string roomName, User newAdmin)
        {
            if (string.IsNullOrEmpty(roomName))
            {
                throw new ArgumentException("roomName");
            }

            if (newAdmin == null)
            {
                throw new ArgumentNullException("newAdmin");
            }

            var sendingContent = new ServerSetRoomAdminCommand.MessageContent {
                RoomName = roomName, NewAdmin = newAdmin
            };

            ClientModel.Client.SendMessage(ServerSetRoomAdminCommand.Id, sendingContent);
        }
コード例 #3
0
        public void SetRoomAdmin(string roomName, User newAdmin)
        {
            if (string.IsNullOrEmpty(roomName))
            throw new ArgumentException("roomName");

              if (newAdmin == null)
            throw new ArgumentNullException("newAdmin");

              var sendingContent = new ServerSetRoomAdminCommand.MessageContent { RoomName = roomName, NewAdmin = newAdmin };
              ClientModel.Client.SendMessage(ServerSetRoomAdminCommand.CommandId, sendingContent);
        }