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); } }
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); } }
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); } }