internal void OnPresenceChanged(PresenceEventEventArgs args) { try { PresenceChanged?.Invoke(this, args); } catch { } }
private async Task UpdateBarbecue(PresenceChanged notification, PresenceChangedType changeType, bool decreaseRaised = false) { var bbq = await _context.GetAll() .FirstOrDefaultAsync(o => o.Id == notification.BarbecueId); if (bbq == null) { _notifications.AddNotification(AppConsts.BarbecueNotFound); return; } bbq.TotalAmount += changeType == PresenceChangedType.Confirmed ? notification.Value : -notification.Value; bbq.TotalParticipants += changeType == PresenceChangedType.Confirmed ? 1 : -1; if (decreaseRaised) { bbq.TotalRaised -= notification.Value; } await _context.Commit(); }
private void OnPresenceChanged(Contact contact) { PresenceChanged?.Invoke(this, new ContactChangedEventArgs(contact, ContactChangeType.Update)); }