public void StartWatch()
        {
            try
            {
                _SessionUserStatusList = new UserStatusList(_people);


                _SessionUserStatusList.WatchedObjectsChanged += SessionUserStatusChanged;

                // Start a watch on the current session user async
                string[] userToWatch = new string[1];
                userToWatch[0] = _people.Session.UserId;


                _SessionUserStatusList.StartWatchingAsync(userToWatch, UserStatusListStartWatchingCompleted, null);


                /*Used this for testing - If it got here then everything was good
                 *
                 * _notification.Notify("Starting User Status Watch", "Start Watch", NotificationType.Info, TimeSpan.FromSeconds(10));
                 *
                 */
            }
            catch (Exception)
            {
            }
        }
示例#2
0
 private void UpdateCurrentUserStatus()
 {
     if (UserStatusList == null)
     {
         UserStatusList = new UserStatusList(PeopleManager);
     }
     UserStatus = UserStatusList.GetUserStatus(PeopleManager.Session.UserId);
     //CurrentStatus = UserStatus.StatusMessageDetails;
     if (!isStatusCallbackSet)
     {
         isStatusCallbackSet = true;
         UserStatusList.WatchedObjectsChanged += UpdateUsersStatus;
         string[] usertowatch = new string[1];
         usertowatch[0] = PeopleManager.Session.UserId;
         UserStatusList.StartWatchingAsync(usertowatch, EmptyCallBack, null);
     }
 }