Headless.Page.IsOn C# (CSharp) Method

IsOn() public method

Determines whether the the page is on the specified location.
/// The parameter is null. /// /// The parameter is a relative location. ///
public IsOn ( Uri location ) : bool
location System.Uri /// The current location. ///
return bool
        public virtual bool IsOn(Uri location)
        {
            var validator = _browser.LocationValidator;

            if (validator.ValidationType != LocationValidationType.UriOnly)
            {
                if (validator.Matches(location, LocationExpressions))
                {
                    return true;
                }
            }

            if (validator.ValidationType != LocationValidationType.RegexOnly)
            {
                if (validator.Matches(location, TargetLocation))
                {
                    return true;
                }
            }

            return false;
        }