The PostEntry class describes an entry for sending POST data.
Beispiel #1
0
        /// <inheritdoc />
        protected internal override IEnumerable <PostEntry> BuildPostData()
        {
            var selectedItems = SelectedItems;

            if (selectedItems.Count == 0)
            {
                yield break;
            }

            if (IsDropDown)
            {
                // Return only the last item
                var lastEntry = selectedItems.Last();

                var postEntry = new PostEntry(Name, lastEntry.PostValue);

                yield return(postEntry);
            }
            else
            {
                foreach (var selectedItem in selectedItems)
                {
                    var postEntry = new PostEntry(Name, selectedItem.PostValue);

                    yield return(postEntry);
                }
            }
        }
Beispiel #2
0
        /// <inheritdoc />
        protected internal override IEnumerable<PostEntry> BuildPostData()
        {
            var selectedItems = SelectedItems;

            if (selectedItems.Count == 0)
            {
                yield break;
            }

            if (IsDropDown)
            {
                // Return only the last item
                var lastEntry = selectedItems.Last();

                var postEntry = new PostEntry(Name, lastEntry.PostValue);

                yield return postEntry;
            }
            else
            {
                foreach (var selectedItem in selectedItems)
                {
                    var postEntry = new PostEntry(Name, selectedItem.PostValue);

                    yield return postEntry;
                }
            }
        }