예제 #1
0
 internal void OnPresenceChanged(PresenceEventEventArgs args)
 {
     try
     {
         PresenceChanged?.Invoke(this, args);
     }
     catch { }
 }
예제 #2
0
        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();
        }
예제 #3
0
 private void OnPresenceChanged(Contact contact)
 {
     PresenceChanged?.Invoke(this, new ContactChangedEventArgs(contact, ContactChangeType.Update));
 }