コード例 #1
0
        public StatusManager(Session session)
        {
            _userId = session.UserId;
            _peopleManager = PeopleManager.GetInstance(session);
            _userStatusList = new UserStatusList(_peopleManager);
            _userStatusList.StartWatching(new[] { _userId });

            _statusMessageList = new StatusMessageList(_peopleManager);
            _statusMessageList.StartWatching();
        }
コード例 #2
0
        protected void SetUserStatus(string statusId)
        {
            var peopleManager = PeopleManager.GetInstance(_session);
            var statusList    = new StatusMessageList(peopleManager);

            statusList.StartWatching();
            var userStatusUpdate = new UserStatusUpdate(peopleManager, _session.UserId)
            {
                StatusMessageDetails = statusList[statusId]
            };

            userStatusUpdate.UpdateRequest();
            statusList.StopWatching();
        }
コード例 #3
0
        public CicStatusService(Session session, ITraceContext traceContext)
        {
            _userId = session.UserId;
            _traceContext = traceContext;
            _peopleManager = PeopleManager.GetInstance(session);
            _userStatusList = new UserStatusList(_peopleManager);
            _userStatusList.StartWatching(new[] { _userId });
            _userStatusList.WatchedObjectsChanged += OnUserStatusChanged;

            _statusMessageList = new StatusMessageList(_peopleManager);
            _statusMessageList.StartWatching();

            _filteredStatusList = new FilteredStatusMessageList(_peopleManager);
            _filteredStatusList.StartWatching(new[] { _userId });
        }
コード例 #4
0
        public List <string> PopulateStatusList()
        {
            UserStatusList = new UserStatusList(PeopleManager);
            UpdateCurrentUserStatus();
            StatusMessageList msgList = new StatusMessageList(PeopleManager);

            msgList.StartWatching();
            StatusImageList = new System.Windows.Forms.ImageList();
            List <string> items = new List <string>();//new object[msgList.GetList().Count];
            string        lvi;

            foreach (StatusMessageDetails d in msgList.GetList())
            {
                StatusImageList.Images.Add(d.Icon);
                lvi = d.MessageText;
                items.Add(lvi);
            }
            return(items);
        }
コード例 #5
0
        public void ChangeUserStatus(string NewStatus)
        {
            UserStatusUpdate  statusUpdate = new UserStatusUpdate(PeopleManager);
            StatusMessageList msgList      = new StatusMessageList(PeopleManager);

            msgList.StartWatching();
            foreach (StatusMessageDetails d in msgList.GetList())
            {
                if (NewStatus == d.MessageText)
                {
                    statusUpdate.StatusMessageDetails = d;
                }
            }
            if (statusUpdate.StatusMessageDetails != null)
            {
                //statusUpdate.UpdateRequest();
                statusUpdate.UpdateRequestAsync(ConnectCompleted, null);
            }
            else
            {
                return;
            }
            UpdateCurrentUserStatus();
        }