예제 #1
0
        /// <summary>
        /// Loads all users from the given project
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        private User[] LoadUsers(Project project)
        {
            string url = GetBaseUrl("getuser") + "&projectid=" + project.ID;

            XmlDocument doc = SendRequest(url);

            XmlNodeList userNodes = doc.SelectNodes("//user");

            List<User> result = new List<User>();
            foreach (XmlNode node in userNodes)
            {
                User user = new User();
                user.Name = node.SelectSingleNode("name/text()").Value;
                user.ID = Int32.Parse(node.SelectSingleNode("id/text()").Value);
                user.Role = node.SelectSingleNode("role/text()").Value;
                result.Add(user);
            }

            return result.ToArray();
        }
예제 #2
0
        /// <summary>
        /// Removes the user from the current project
        /// </summary>
        /// <param name="user"></param>
        internal void RemoveUser(User user)
        {
            string url = GetBaseUrl( "removeuser");
            url += string.Format("&projectid={0}&user={1}", project.ID, user.Name);

            XmlDocument doc = SendRequest(url);
        }