GetCheckBoxOptions() private method

Gets the collection of possible values from the checkboxes contained in XmlNodeList. The expected xhtml is for example: <label class="floating" ><input id="issue[watcher_user_ids][]" name="issue[watcher_user_ids][]" type="checkbox" value="3" /> test user</label>
private GetCheckBoxOptions ( string checkboxId ) : string>.Dictionary
checkboxId string Id of the checkboxes
return string>.Dictionary
コード例 #1
0
ファイル: Redmine.cs プロジェクト: MisterY/redmine-client
        /// <summary>
        /// Gets the list of all the users available as watchers for the project
        /// </summary>
        /// <param name="projectId">ID of the project</param>
        /// <returns>List of all the users available as watchers for the project</returns>
        public List <User> GetWatchers(int projectId)
        {
            XhtmlPage   page     = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List <User> watchers = new List <User>();

            foreach (KeyValuePair <int, string> kv in page.GetCheckBoxOptions("issue[watcher_user_ids][]"))
            {
                watchers.Add(new User()
                {
                    Id = kv.Key, Name = kv.Value
                });
            }

            return(watchers);
        }
コード例 #2
0
ファイル: Redmine.cs プロジェクト: bdrhoa/redmine-client
        /// <summary>
        /// Gets the list of all the users available as watchers for the project
        /// </summary>
        /// <param name="projectId">ID of the project</param>
        /// <returns>List of all the users available as watchers for the project</returns>
        public List<User> GetWatchers(int projectId)
        {
            XhtmlPage page = new XhtmlPage(this.httpHelper.GetWebRequest(this.ConstructUri(String.Format(NewIssueRelativeUri, projectId))));
            List<User> watchers = new List<User>();
            foreach (KeyValuePair<int, string> kv in page.GetCheckBoxOptions("issue[watcher_user_ids][]"))
            {
                watchers.Add(new User() { Id = kv.Key, Name = kv.Value });
            }

            return watchers;
        }