Headless.HtmlList.MatchesItem C# (CSharp) Method

MatchesItem() private static method

Determines whether the item matches the specified value.
private static MatchesItem ( HtmlFormElement item, string value ) : bool
item HtmlFormElement /// The item. ///
value string /// The value. ///
return bool
        private static bool MatchesItem(HtmlFormElement item, string value)
        {
            if (item == null)
            {
                return false;
            }

            if (item.Value == null)
            {
                if (string.IsNullOrEmpty(value))
                {
                    return true;
                }
            }
            else if (item.Value.Equals(value, StringComparison.Ordinal))
            {
                return true;
            }

            if (item.Text == null)
            {
                if (string.IsNullOrEmpty(value))
                {
                    return true;
                }
            }
            else if (item.Text.Equals(value, StringComparison.Ordinal))
            {
                return true;
            }

            return false;
        }