Пример #1
0
        internal void SetPrimaryUserTrackingId(int newId, EventQueueSection section)
        {
            int oldId = PrimaryUserTrackingId;

            PrimaryUserTrackingId = newId;

            if (oldId != newId)
            {
                section.Enqueue(
                    () =>
                {
                    if (PrimaryUserChanged != null)
                    {
                        var args = new UserTrackingIdChangedEventArgs(oldId, newId);
                        PrimaryUserChanged(this, args);
                    }
                });

                // If the new primary user is the same as the engaged user, then there is no candidate user.
                // Otherwise, we have a new candidate user as long as the new primary user is a valid user.
                SetCandidateUserTrackingId(
                    (EngagedUserTrackingId != InvalidUserTrackingId) && (EngagedUserTrackingId == newId)
                        ? InvalidUserTrackingId
                        : newId,
                    section);
            }
        }
Пример #2
0
 private void SendTrackedUsersChanged(EventQueueSection section)
 {
     section.Enqueue(
         () =>
     {
         if (TrackedUsersChanged != null)
         {
             TrackedUsersChanged(this, EventArgs.Empty);
         }
     });
 }
Пример #3
0
        private void SetCandidateUserTrackingId(int newId, EventQueueSection section)
        {
            int oldId = CandidateUserTrackingId;

            CandidateUserTrackingId = newId;

            if (oldId != newId)
            {
                section.Enqueue(
                    () =>
                {
                    if (CandidateUserChanged != null)
                    {
                        var args = new UserTrackingIdChangedEventArgs(oldId, newId);
                        CandidateUserChanged(this, args);
                    }
                });
            }
        }