/// <summary>
 /// Deserialize messages of member from serialized data.
 /// </summary>
 /// <param name="memberData">Serialized member data.</param>
 internal void DeserializeMessages(Serialization.MemberData memberData)
 {
     if (memberData.Messages != null)
     {
         foreach (var messageData in memberData.Messages)
         {
             _messages.Enqueue(CreateMessage(messageData));
         }
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Observer"/> class.
        /// </summary>
        /// <param name="team">The Scrum team the observer is joining.</param>
        /// <param name="memberData">The member serialization data.</param>
        internal Observer(ScrumTeam team, Serialization.MemberData memberData)
        {
            if (string.IsNullOrEmpty(memberData.Name))
            {
                throw new ArgumentException("Member name cannot be empty.", nameof(memberData));
            }

            Team           = team;
            Name           = memberData.Name;
            LastActivity   = DateTime.SpecifyKind(memberData.LastActivity, DateTimeKind.Utc);
            _lastMessageId = memberData.LastMessageId;
        }
        /// <summary>
        /// Gets serialization data of the object.
        /// </summary>
        /// <returns>The serialization data.</returns>
        protected internal virtual Serialization.MemberData GetData()
        {
            var result = new Serialization.MemberData
            {
                Name          = Name,
                MemberType    = Serialization.MemberType.Observer,
                LastActivity  = LastActivity,
                LastMessageId = _lastMessageId,
            };

            result.Messages = Messages.Select(m => m.GetData()).ToList();
            return(result);
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScrumMaster"/> class.
 /// </summary>
 /// <param name="team">The Scrum team the observer is joining.</param>
 /// <param name="memberData">The member serialization data.</param>
 internal ScrumMaster(ScrumTeam team, Serialization.MemberData memberData)
     : base(team, memberData)
 {
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Member"/> class.
 /// </summary>
 /// <param name="team">The Scrum team the observer is joining.</param>
 /// <param name="memberData">The member serialization data.</param>
 internal Member(ScrumTeam team, Serialization.MemberData memberData)
     : base(team, memberData)
 {
     _estimation = memberData.Estimation;
 }