コード例 #1
0
        public void UpdateActivity(string user)
        {
            Chatter activity = currentUsers.FirstOrDefault(u => u.Name == user);

            if (activity != null)
            {
                activity.LastActivity = DateTime.Now;
            }
        }
コード例 #2
0
 public void Add(string user)
 {
     if (currentUsers.All(u => u.Name != user))
     {
         Chatter activity = new Chatter {
             Name = user
         };
         currentUsers.Add(activity);
     }
 }
コード例 #3
0
        public void Remove(string user)
        {
            Chatter activity = currentUsers.FirstOrDefault(u => u.Name == user);

            currentUsers.Remove(activity);
        }