private void OnReceived(object _, TdApi.Object structure) { if (int.TryParse(structure.Extra, out int id) && _tasks.TryRemove(id, out var action)) { action(structure); } }
private void OnReceived(object _, TdApi.Object obj) { if (int.TryParse(obj.Extra, out int id) && _tasks.TryRemove(id, out var action)) { action(obj); } else if (obj is TdApi.Update update) { if (_updateReceiverCount == 0) { _updateBuffer.Enqueue(update); } else { _updateReceived(this, update); } } }
private void OnReceived(object _, TdApi.Object obj) { if (int.TryParse(obj.Extra, NumberStyles.Integer, CultureInfo.InvariantCulture, out int id) && _tasks.TryRemove(id, out var action)) { action(obj); } else if (obj is TdApi.Update update) { if (_updateReceiverCount == 0) { _updateBuffer.Enqueue(update); } else { _updateReceived(this, update); } } }