/// <summary> /// Adds one or more content regions. /// </summary> /// <param name="region">A region to match using the Content method.</param> /// <param name="regions">One or more regions to match using the Content method.</param> /// <returns>An updated clone of this settings object.</returns> public ICheckSettings Content(Rectangle region, params Rectangle[] regions) { CheckSettings clone = Clone(); clone.Content_(new SimpleRegionByRectangle(region)); foreach (Rectangle r in regions) { clone.Content_(new SimpleRegionByRectangle(r)); } return(clone); }
/// <summary> /// Adds one or more content regions. /// </summary> /// <param name="region">A region to match using the Content method.</param> /// <param name="regions">One or more regions to match using the Content method.</param> /// <returns>An updated clone of this settings object.</returns> public ICheckSettings Content(Rectangle region, params Rectangle[] regions) { CheckSettings clone = Clone(); clone.Content_(new SimpleRegionByRectangle(region)); clone.fluentCode_.Append($".{nameof(Content)}(new Rectangle({region.X},{region.Y},{region.Width},{region.Height})"); foreach (Rectangle r in regions) { clone.Content_(new SimpleRegionByRectangle(r)); clone.fluentCode_.Append($", new Rectangle({r.X},{r.Y},{r.Width},{r.Height})"); } clone.fluentCode_.Append(")"); return(clone); }
/// <summary> /// Adds one or more content regions. /// </summary> /// <param name="regions">An enumerbale of regions to match using the Content method.</param> /// <returns>An updated clone of this settings object.</returns> public ICheckSettings Content(IEnumerable <Rectangle> regions) { CheckSettings clone = Clone(); foreach (Rectangle r in regions) { clone.Content_(new SimpleRegionByRectangle(r)); } return(clone); }