コード例 #1
0
        public async Task SendMessageAsync(UserListResponse msg)
        {
            // Send array of users
            await _networkCommunication.SendIntAsync(msg.Users.Count);

            foreach (var user in msg.Users)
            {
                await _networkCommunication.SendStringAsync(user.Username);
            }
        }
コード例 #2
0
        public async Task SendMessageAsync(PhotoListResponse msg)
        {
            // All photos are from the same user
            await _networkCommunication.SendStringAsync(msg.Username);

            // Send array of photos
            await _networkCommunication.SendIntAsync(msg.Photos.Count);

            foreach (var photo in msg.Photos)
            {
                await _networkCommunication.SendStringAsync(photo.Name);

                await _fileCommunication.SendFileAsync(photo.File);
            }
        }
コード例 #3
0
        public async Task SendMessageAsync(CommentListResponse msg)
        {
            // All comments are from the same photo
            await _networkCommunication.SendStringAsync(msg.Username);

            await _networkCommunication.SendStringAsync(msg.PhotoName);

            // Send array of comments
            await _networkCommunication.SendIntAsync(msg.Comments.Count);

            foreach (var comment in msg.Comments)
            {
                await _networkCommunication.SendStringAsync(comment.Text);
            }
        }