File size: 982 Bytes
8c763fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#nullable enable

using System;
using System.Collections.ObjectModel;

namespace Microsoft.PowerShell.Commands
{
    /// <summary>
    /// FormObjectCollection used in HtmlWebResponseObject.
    /// </summary>
    public class FormObjectCollection : Collection<FormObject>
    {
        /// <summary>
        /// Gets the FormObject from the key.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public FormObject? this[string key]
        {
            get
            {
                FormObject? form = null;
                foreach (FormObject f in this)
                {
                    if (string.Equals(key, f.Id, StringComparison.OrdinalIgnoreCase))
                    {
                        form = f;
                        break;
                    }
                }

                return form;
            }
        }
    }
}