예제 #1
0
        /// <summary>
        /// Returns information about currently logged in user
        /// </summary>
        /// <returns><see cref="UserInfo"/></returns>
        public UserInfo GetUserInfo()
        {
            //action=common-info

            StatusInfo iStatus;
            XmlDocument xDoc = _ProcessRequest("common-info", null, out iStatus);
            if (iStatus.Code != StatusCodes.ok || xDoc == null || !xDoc.HasChildNodes) return null;

            try
            {
                if (xDoc.SelectSingleNode("//user") == null) return null;

                UserInfo uInf = new UserInfo();
                uInf.name = xDoc.SelectSingleNode("//user/name/text()").Value;
                uInf.login = xDoc.SelectSingleNode("//user/login/text()").Value;
                uInf.user_id = xDoc.SelectSingleNode("//user/@user-id").Value;

                return uInf;
            }
            catch (Exception ex)
            {
                TraceTool.TraceException(ex);
            }

            return null;
        }
예제 #2
0
 public UserSession(MeetingItem[] MeetingItems, UserInfo UserInfo)
 {
     this.FullName = UserInfo.name;
     this.MyMeetings = MeetingItems;
     this.Id = int.Parse(UserInfo.user_id);
 }