示例#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 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);
                    }
                });
            }
        }
示例#3
0
 /// <summary>
 /// Event handler for EngagementStateManager.CandidateUserChanged.
 /// </summary>
 /// <param name="sender">
 /// Object that sent the event.
 /// </param>
 /// <param name="e">
 /// Event arguments.
 /// </param>
 private void OnEngagementManagerCandidateUserChanged(object sender, UserTrackingIdChangedEventArgs e)
 {
     this.IsUserEngagementCandidate = EngagementStateManager.InvalidUserTrackingId != e.NewValue;
 }
示例#4
0
 /// <summary>
 /// Event handler for EngagementStateManager.EngagedUserChanged.
 /// </summary>
 /// <param name="sender">
 /// Object that sent the event.
 /// </param>
 /// <param name="e">
 /// Event arguments.
 /// </param>
 private void OnEngagementManagerEngagedUserChanged(object sender, UserTrackingIdChangedEventArgs e)
 {
     this.UpdateUserEngaged();
 }