Пример #1
0
 private void OnReceived(object _, TdApi.Object structure)
 {
     if (int.TryParse(structure.Extra, out int id) && _tasks.TryRemove(id, out var action))
     {
         action(structure);
     }
 }
Пример #2
0
 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);
         }
     }
 }
Пример #3
0
 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);
         }
     }
 }