private void OnMemberDisconnectedMessage(string teamName, ScrumTeamMemberMessage message)
 {
     using (var teamLock = this.PlanningPoker.GetScrumTeam(teamName))
     {
         teamLock.Lock();
         var team = teamLock.Team;
         try
         {
             this.processingScrumTeamName = team.Name;
             team.Disconnect(message.MemberName);
         }
         finally
         {
             this.processingScrumTeamName = null;
         }
     }
 }
 private void OnMemberJoinedMessage(string teamName, ScrumTeamMemberMessage message)
 {
     using (var teamLock = this.PlanningPoker.GetScrumTeam(teamName))
     {
         teamLock.Lock();
         var team = teamLock.Team;
         try
         {
             this.processingScrumTeamName = team.Name;
             team.Join(message.MemberName, string.Equals(message.MemberType, typeof(Observer).Name, StringComparison.OrdinalIgnoreCase));
         }
         finally
         {
             this.processingScrumTeamName = null;
         }
     }
 }
        private void ScrumTeamOnMessageReceived(object sender, MessageReceivedEventArgs e)
        {
            var team = (ScrumTeam)sender;
            ScrumTeamMessage scrumTeamMessage = null;

            switch (e.Message.MessageType)
            {
            case MessageType.MemberJoined:
            case MessageType.MemberDisconnected:
            case MessageType.MemberActivity:
                var memberMessage = (MemberMessage)e.Message;
                scrumTeamMessage = new ScrumTeamMemberMessage(team.Name, memberMessage.MessageType)
                {
                    MemberName            = memberMessage.Member.Name,
                    MemberType            = memberMessage.Member.GetType().Name,
                    SessionId             = memberMessage.Member.SessionId,
                    AcknowledgedMessageId = memberMessage.Member.AcknowledgedMessageId
                };
                break;

            case MessageType.MemberEstimated:
                var memberEstimatedMessage = (MemberMessage)e.Message;
                var member = memberEstimatedMessage.Member as Member;
                if (member != null && member.Estimation != null)
                {
                    scrumTeamMessage = new ScrumTeamMemberEstimationMessage(team.Name, memberEstimatedMessage.MessageType)
                    {
                        MemberName = member.Name,
                        Estimation = member.Estimation.Value
                    };
                }

                break;

            default:
                scrumTeamMessage = new ScrumTeamMessage(team.Name, e.Message.MessageType);
                break;
            }

            if (scrumTeamMessage != null)
            {
                _observableMessages.OnNext(scrumTeamMessage);
            }
        }
 private void OnMemberActivityMessage(string teamName, ScrumTeamMemberMessage message)
 {
     using (var teamLock = this.PlanningPoker.GetScrumTeam(teamName))
     {
         teamLock.Lock();
         var team = teamLock.Team;
         try
         {
             this.processingScrumTeamName = team.Name;
             var observer = team.FindMemberOrObserver(message.MemberName);
             if (observer != null)
             {
                 observer.UpdateActivity();
             }
         }
         finally
         {
             this.processingScrumTeamName = null;
         }
     }
 }
 private void OnMemberActivityMessage(string teamName, ScrumTeamMemberMessage message)
 {
     using (var teamLock = PlanningPoker.GetScrumTeam(teamName))
     {
         teamLock.Lock();
         var team = teamLock.Team;
         try
         {
             _processingScrumTeamName = team.Name;
             var observer = team.FindMemberOrObserver(message.MemberName);
             if (observer != null)
             {
                 observer.SessionId = message.SessionId;
                 observer.AcknowledgeMessages(message.SessionId, message.AcknowledgedMessageId);
                 observer.UpdateActivity();
             }
         }
         finally
         {
             _processingScrumTeamName = null;
         }
     }
 }