예제 #1
0
        internal void SetPrimaryUserTrackingId(int newId, EventQueueSection section)
        {
            int oldId = this.PrimaryUserTrackingId;

            this.PrimaryUserTrackingId = newId;

            if (oldId != newId)
            {
                section.Enqueue(
                    () =>
                {
                    if (this.PrimaryUserChanged != null)
                    {
                        var args = new UserTrackingIdChangedEventArgs(oldId, newId);
                        this.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.
                this.SetCandidateUserTrackingId(
                    (this.EngagedUserTrackingId != InvalidUserTrackingId) && (this.EngagedUserTrackingId == newId)
                                                ? InvalidUserTrackingId
                                                : newId,
                    section);
            }
        }
예제 #2
0
 private void SendTrackedUsersChanged(EventQueueSection section)
 {
     section.Enqueue(
         () =>
     {
         if (this.TrackedUsersChanged != null)
         {
             this.TrackedUsersChanged(this, EventArgs.Empty);
         }
     });
 }
예제 #3
0
        private void SetCandidateUserTrackingId(int newId, EventQueueSection section)
        {
            int oldId = this.CandidateUserTrackingId;

            this.CandidateUserTrackingId = newId;

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