342 instantiations of Region
System.Drawing.Common.Tests (257)
mono\System.Drawing\GraphicsTests.cs (28)
105using Region r = new(); 152g.Clip = new Region(new Rectangle(50, 40, 210, 220)); 178g.Clip = new Region(new RectangleF(10, 10, 100, 100)); 205g.Clip = new Region(new RectangleF(260, 30, 60, 80)); 222g.Clip = new Region(new RectangleF(260, 30, 60, 80)); 243g.SetClip(new Region(new Rectangle(50, 40, 210, 220)), CombineMode.Replace); 292g.Clip = new Region(new Rectangle(0, 0, 100, 100)); 305g.Clip = new Region(new Rectangle(1, 2, 20, 25)); 336Region r = new(); 361Graphics.Clip = new Region(new Rectangle(0, 0, width, height)); 456g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 466g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 482g.Clip = new Region(clip); 497g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 513g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 528g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 544g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 563g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 599g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 622g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 643g.Clip = new Region(new Rectangle(0, 0, 8, 8)); 955g.Clip = new Region(new Rectangle(10, 10, 10, 10)); 988g.Clip = new Region(new Rectangle(10, 10, 10, 10)); 1022g.Clip = new Region(new Rectangle(10, 10, 10, 10)); 1103g.Clip = new Region(new Rectangle(10, 10, 10, 10)); 1194g.Clip = new Region(rect); 2209g.Clip = new Region(new RectangleF(0, 0, 32, 32)); 2242g.Clip = new Region(new RectangleF(0, 0, 200, 200));
System\Drawing\Graphics_GetContextTests.Core.cs (4)
29using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 62using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 81using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 100using Region initialClip = new(new Rectangle(1, 2, 9, 10));
System\Drawing\Graphics_GetContextTests.cs (5)
33using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 65using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 83using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 101using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 122using Region initialClip = new(new Rectangle(1, 2, 9, 10));
System\Drawing\RegionTests.cs (220)
36Region region = new(); 44using Region region = new(); 58using Region region = new(rectangle); 74using Region region = new(rectangle); 82yield return new object[] { new Region() }; 83yield return new object[] { new Region(new Rectangle(0, 0, 0, 0)) }; 84yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 93using Region otherRegion = new(region.GetRegionData()); 106using Region region = new(graphicsPath); 113using Region region = new(new Rectangle(1, 2, 3, 4)); 114using Region other = new(region.GetRegionData()); 121AssertExtensions.Throws<ArgumentNullException>("rgnData", () => new Region((RegionData)null)); 127using Region region = new(); 130AssertExtensions.Throws<ArgumentException>(null, () => new Region(regionData)); 139using Region region = new(); 142Assert.Throws<ExternalException>(() => new Region(regionData)); 149using Region region = new(graphicsPath); 151Assert.Throws<ExternalException>(() => new Region(regionData)); 157using Region region = new(); 160Assert.Throws<NullReferenceException>(() => new Region(regionData)); 170using Region region = new(graphicsPath); 185using Region region = new(graphicsPath); 225using (Region region = new(path)) 237using Region region = new(path); 245AssertExtensions.Throws<ArgumentNullException>("path", () => new Region((GraphicsPath)null)); 254AssertExtensions.Throws<ArgumentException>(null, () => new Region(path)); 282new Region(new RectangleF(10, 10, 100, 100)), 289new Region(new RectangleF(70, 10, 100, 100)), 296new Region(new RectangleF(40, 100, 100, 100)), 303new Region(new RectangleF(40, 10, 100, 100)), 310new Region(new RectangleF(30, 30, 80, 80)), 322new Region(), 329new Region(), 343using Region other = new(rect); 355using Region region = new(new Rectangle(20, 20, 20, 20)); 356using Region other = new(new Rectangle(20, 80, 20, 10)); 371using Region region = new(); 388using Region region = new(new Rectangle(1, 2, 3, 4)); 390using Region other = new(); 405using Region region = new(); 412AssertExtensions.Throws<ArgumentException>(null, () => new Region().Complement(CreateDisposedRegion())); 418using Region region = new(); 479using Region region1 = new(rect1); 480using Region region2 = new(rect2); 499using Region region = new(); 508using Region region = new(); 518using Region other = new(); 529Region emptyRegion = new(); 534Region createdRegion = new(); 536yield return new object[] { new Region(), new Region(), true }; 537yield return new object[] { new Region(), Empty(), false }; 538yield return new object[] { new Region(), new Region(new Rectangle(1, 2, 3, 4)), false }; 541yield return new object[] { Empty(), new Region(new Rectangle(0, 0, 0, 0)), true }; 542yield return new object[] { Empty(), new Region(new Rectangle(1, 2, 3, 3)), false }; 544yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new Rectangle(1, 2, 3, 4)), true }; 545yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new RectangleF(1, 2, 3, 4)), true }; 546yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new Rectangle(2, 2, 3, 4)), false }; 547yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new Rectangle(1, 3, 3, 4)), false }; 548yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new Rectangle(1, 2, 4, 4)), false }; 549yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)), new Region(new Rectangle(1, 2, 3, 5)), false }; 569yield return new object[] { new Region(graphics1), new Region(graphics1), true }; 570yield return new object[] { new Region(graphics1), new Region(graphics2), true }; 571yield return new object[] { new Region(graphics1), new Region(graphics3), false }; 572yield return new object[] { new Region(graphics1), new Region(graphics4), false }; 573yield return new object[] { new Region(graphics1), new Region(graphics5), false }; 574yield return new object[] { new Region(graphics1), new Region(graphics6), false }; 591using Region region = new(); 598using Region region = new(); 605using Region region = new(); 606using Region other = new(); 618AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Equals(new Region(), s_graphic)); 619AssertExtensions.Throws<ArgumentException>(null, () => new Region().Equals(disposedRegion, s_graphic)); 626new Region(new Rectangle(500, 30, 60, 80)), 633new Region(new Rectangle(500, 30, 60, 80)), 640new Region(), 653new Region(), 661new Region(new Rectangle(10, 10, 100, 100)), 674new Region(new Rectangle(70, 10, 100, 100)), 687new Region(new Rectangle(40, 100, 100, 100)), 700new Region(new Rectangle(40, 10, 100, 100)), 713new Region(new Rectangle(30, 30, 80, 80)), 730new Region(new Rectangle(50, 100, 100, 100)), 738new Region(new Rectangle(70, 60, 100, 70)), 746new Region(new Rectangle(70, 60, 100, 70)), 754new Region(new Rectangle(20, 20, 100, 100)), 761new Region(new Rectangle(130, 30, 60, 80)), 779using Region other = new(rect); 791using Region region = new(new RectangleF(20, 20, 20, 20)); 792using Region union = new(new RectangleF(20, 80, 20, 10)); 802using Region region = new(new Rectangle(1, 2, 3, 4)); 803using Region other = new(); 812using Region region = new(); 819AssertExtensions.Throws<ArgumentException>(null, () => new Region().Exclude(CreateDisposedRegion())); 825using Region region = new(); 882using Region region = new(); 891using Region region = new(); 901using Region other = new(); 911using Region region = new(new Rectangle(1, 2, 3, 4)); 936using Region region = new(new Rectangle(1, 2, 3, 4)); 948using Region region = new(); 960using Region region = new(); 973using Region region = new(); 980using Region region = new(); 987using Region region = new(); 1010using Region region = new(new Rectangle(1, 2, 3, 4)); 1022using Region region = new(); 1036using Region region = new(); 1045using Region clipRegion = new(); 1062new Region(new Rectangle(500, 30, 60, 80)), 1068new Region(new Rectangle(0, 0, 0, 0)), 1075new Region(new Rectangle(500, 30, 60, 80)), 1082new Region(), 1089new Region(), 1096new Region(new RectangleF(260, 30, 60, 80)), 1103new Region(new RectangleF(20, 330, 40, 50)), 1122using Region rectangleRegion = new(rect); 1134using Region region = new(new Rectangle(1, 2, 3, 4)); 1136using Region infiniteRegion = new(); 1145using Region region = new(); 1152AssertExtensions.Throws<ArgumentException>(null, () => new Region().Intersect(CreateDisposedRegion())); 1158using Region region = new(); 1181using Region region = new(); 1209using Region region = new(); 1239using Region region = new(); 1248using Region region = new(); 1258using Region other = new(); 1268using Region region = new(); 1281using Region region = new(); 1288using Region region = new(); 1303Region infiniteExclude = new(); 1308yield return new object[] { new Region(), Rectangle.Empty, false }; 1310yield return new object[] { new Region(new Rectangle(0, 0, 10, 10)), new Rectangle(0, 0, 0, 1), false }; 1311yield return new object[] { new Region(new Rectangle(500, 30, 60, 80)), new Rectangle(500, 30, 60, 80), true }; 1312yield return new object[] { new Region(new Rectangle(500, 30, 60, 80)), new Rectangle(520, 40, 60, 80), true }; 1314yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(1, 1, 2, 1), true }; 1315yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(1, 1, 2, 2), true }; 1316yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(1, 1, 10, 10), true }; 1317yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(1, 1, 1, 1), true }; 1318yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(2, 2, 1, 1), false }; 1319yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(0, 0, 1, 1), false }; 1320yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Rectangle(3, 3, 1, 1), false }; 1355Region infiniteExclude = new(); 1360yield return new object[] { new Region(), Point.Empty, true }; 1362yield return new object[] { new Region(new Rectangle(500, 30, 60, 80)), new Point(500, 29), false }; 1363yield return new object[] { new Region(new Rectangle(500, 30, 60, 80)), new Point(500, 30), true }; 1365yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(0, 1), false }; 1366yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(1, 0), false }; 1367yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(2, 0), false }; 1368yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(3, 0), false }; 1369yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(1, 1), true }; 1370yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(2, 1), true }; 1371yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(3, 1), false }; 1372yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(0, 2), false }; 1373yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(2, 2), false }; 1374yield return new object[] { new Region(new Rectangle(1, 1, 2, 1)), new Point(3, 2), false }; 1490new Region(new Rectangle(500, 30, 60, 80)), 1497new Region(new Rectangle(500, 30, 60, 80)), 1504new Region(new Rectangle(500, 30, 60, 80)), 1511new Region(new Rectangle(500, 30, 60, 80)), 1523new Region(), 1530new Region(), 1538new Region(new Rectangle(20, 20, 20, 20)), 1554new Region(new Rectangle(20, 180, 40, 50)), 1572new Region(new Rectangle(20, 330, 40, 50)), 1592new Region(new Rectangle(10, 20, 50, 50)), 1609new Region(new Rectangle(10, 10, 100, 100)), 1622new Region(new Rectangle(70, 10, 100, 100)), 1635new Region(new Rectangle(40, 100, 100, 100)), 1647new Region(new Rectangle(40, 10, 100, 100)), 1659new Region(new Rectangle(30, 30, 80, 80)), 1684using Region other = new(rect); 1696using Region region = new(new Rectangle(1, 2, 3, 4)); 1697using Region other = new(); 1707using Region region = new(); 1714using Region region = new(); 1721using Region region = new(); 1778using Region region = new(); 1787using Region region = new(); 1797using Region other = new(); 1807using Region region = new(new RectangleF(1, 2, 3, 4)); 1816using Region region = new(new RectangleF(1, 2, 3, 4)); 1833using Region region = new(); 1848using Region region = new(); 1862using Region region = new(); 1875using Region region = new(); 1892using Region region = new(new RectangleF(1, 2, 3, 4)); 1901using Region region = new(); 1915using Region region = new(new RectangleF(1, 2, 3, 4)); 1924using Region region = new(); 1936using Region region = new(); 1953using Region region = new(new RectangleF(1, 2, 3, 4)); 1975new Region(new RectangleF(500, 30, 60, 80)), 1982new Region(new RectangleF(500, 30, 60, 80)), 1989new Region(new RectangleF(0, 0, 0, 0)), 1996new Region(), 2009new Region(), 2016new Region(new RectangleF(380, 30, 60, 80)), 2036using Region other = new(rect); 2048using Region region = new(new Rectangle(1, 2, 3, 4)); 2049using Region other = new(); 2065using Region region = new(); 2072using Region region = new(); 2079using Region region = new(); 2136using Region region = new(); 2145using Region region = new(); 2155using Region other = new();
System.Windows.Forms (9)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (1)
5435using (Region region = new(scroll))
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
588Region visualRegion = new(visualRectangle); 1083using Region region = new(focusRectangle); 1278g.Clip = IsLabelFilledByOneLink() ? new Region(focusRectangle) : link.VisualRegion;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1817region ??= new Region(regionRect);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
29Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
882Region parentRegionToPaint = new(topLeftParentHorizontalPixels);
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
315using Region windowRegion = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (1)
40_region = new Region(new Rectangle(0, 0, 0, 0));
System.Windows.Forms.Design (27)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
139result.Clip = new Region(_adornerWindow.DesignerFrameDisplayRectangle);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
703_dragImageRegion = new Region(controlRect); 800Region invalidRegion = new(unionRectangle); 954_dragImageRegion = new Region(controlRect);
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (3)
386using (Region newRegion = new(borderRect)) 853using Region newRegion = new(newBorderRect); 862using Region oldRegion = new(oldBorderRect);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
316Region toRefresh = new(Rectangle.Empty);
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
332using Region invalidRegion = new(_lastRectangle);
System\Windows\Forms\Design\ControlDesigner.cs (1)
2121using Region nonClient = new(controlScreenBounds);
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
1790using (Region newRegion = new(frameRect)) 1982using Region newRegion = new(frameRect); 1999using Region oldRegion = new(oldFrameRect);
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (2)
73_region = new(rect); 77_region = new(Rectangle.Empty);
System\Windows\Forms\Design\SelectionUIService.cs (1)
830Region region = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
333_region = new(_outerRect); 338_region = new(Rectangle.Empty);
System\Windows\Forms\Design\TabOrder.cs (2)
197_region = new Region(new Rectangle(0, 0, 0, 0)); 208_region = new Region(ctlOuter);
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (3)
462invalidateRegion = new Region(invalidateBounds); 468itemRegion = new Region(invalidateBounds); 497invalidateRegion = new Region(invalidateBounds);
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
82Region rgn = new(bounds);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1183using Region invalidatingRegion = new(_dropDownSizeToInvalidate); 1920using Region regionToInvalidate = new(_boundsToInvalidateOnRemove);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
839Region rgn = new(invalidateBounds);
System.Windows.Forms.Primitives.Tests (3)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (2)
19using Region r = new(clipRectangle); 102using Region r = new(clipRectangle);
System\Windows\Forms\DeviceContextScopeTests.cs (1)
41using Region region = new(new Rectangle(1, 1, 2, 3));
System.Windows.Forms.Tests (46)
System\Windows\Forms\ControlTests.Handlers.cs (4)
2182yield return new object[] { testData, new Region() }; 2183yield return new object[] { testData, new Region(new Rectangle(1, 2, 3, 4)) }; 2334yield return new object[] { testData, new Region() }; 2335yield return new object[] { testData, new Region(new Rectangle(1, 2, 3, 4)) };
System\Windows\Forms\ControlTests.Methods.cs (30)
450yield return new object[] { new Region() }; 451yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 637yield return new object[] { new Region() }; 638yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 859yield return new object[] { new Region() }; 860yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 3509yield return new object[] { opaque, new Region(new Rectangle(0, 0, 10, 20)) }; 3510yield return new object[] { opaque, new Region(new Rectangle(1, 2, 3, 4)) }; 3511yield return new object[] { opaque, new Region(new Rectangle(5, 10, 5, 10)) }; 3512yield return new object[] { opaque, new Region(new Rectangle(100, 200, 300, 400)) }; 3513yield return new object[] { opaque, new Region(new Rectangle(-100, -200, -300, -400)) }; 3514yield return new object[] { opaque, new Region() }; 3541yield return new object[] { opaque, new Region(new Rectangle(0, 0, 10, 20)), new Rectangle(0, 0, 10, 20) }; 3542yield return new object[] { opaque, new Region(new Rectangle(1, 2, 3, 4)), new Rectangle(1, 2, 3, 4) }; 3543yield return new object[] { opaque, new Region(new Rectangle(5, 10, 5, 10)), new Rectangle(5, 10, 5, 10) }; 3544yield return new object[] { opaque, new Region(new Rectangle(100, 200, 300, 400)), new Rectangle(100, 200, 300, 400) }; 3545yield return new object[] { opaque, new Region(new Rectangle(-100, -200, -300, -400)), new Rectangle(-100, -200, -300, -400) }; 3546yield return new object[] { opaque, new Region(), new Rectangle(-4194304, -4194304, 8388608, 8388608) }; 3648yield return new object[] { opaque, new Region(new Rectangle(0, 0, 10, 20)), invalidateChildren }; 3649yield return new object[] { opaque, new Region(new Rectangle(1, 2, 3, 4)), invalidateChildren }; 3650yield return new object[] { opaque, new Region(new Rectangle(5, 10, 5, 10)), invalidateChildren }; 3651yield return new object[] { opaque, new Region(new Rectangle(100, 200, 300, 400)), invalidateChildren }; 3652yield return new object[] { opaque, new Region(new Rectangle(-100, -200, -300, -400)), invalidateChildren }; 3653yield return new object[] { opaque, new Region(), invalidateChildren }; 3683yield return new object[] { opaque, new Region(new Rectangle(0, 0, 10, 20)), invalidateChildren, new Rectangle(0, 0, 10, 20) }; 3684yield return new object[] { opaque, new Region(new Rectangle(1, 2, 3, 4)), invalidateChildren, new Rectangle(1, 2, 3, 4) }; 3685yield return new object[] { opaque, new Region(new Rectangle(5, 10, 5, 10)), invalidateChildren, new Rectangle(5, 10, 5, 10) }; 3686yield return new object[] { opaque, new Region(new Rectangle(100, 200, 300, 400)), invalidateChildren, new Rectangle(100, 200, 300, 400) }; 3687yield return new object[] { opaque, new Region(new Rectangle(-100, -200, -300, -400)), invalidateChildren, new Rectangle(-100, -200, -300, -400) }; 3688yield return new object[] { opaque, new Region(), invalidateChildren, new Rectangle(-4194304, -4194304, 8388608, 8388608) };
System\Windows\Forms\ControlTests.Properties.cs (6)
9870yield return new object[] { new Region() }; 9871yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 9895using Region oldValue = new(); 9947using Region oldValue = new(); 9993using Region region1 = new(); 10004using Region region2 = new();
System\Windows\Forms\TextRendererTests.cs (2)
759using Region region = new(new Rectangle(1, 2, 6, 8)); 807using Region region = new(new Rectangle(1, 2, 6, 8));
System\Windows\Forms\ToolStripDropDownTests.cs (4)
2231yield return new object[] { new Region() }; 2232yield return new object[] { new Region(new Rectangle(1, 2, 3, 4)) }; 2295using Region region1 = new(); 2306using Region region2 = new();
340 references to Region
System.Drawing (1)
System.Drawing.cs (1)
141[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Region))]
System.Drawing.Common (14)
Special\NotSupported.cs (14)
434public System.Drawing.Region Clip { get { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } set { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } 586public void ExcludeClip(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 611public void FillRegion(System.Drawing.Brush brush, System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 633public void IntersectClip(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 642public System.Drawing.Region[] MeasureCharacterRanges(string? text, System.Drawing.Font font, System.Drawing.RectangleF layoutRect, System.Drawing.StringFormat? stringFormat) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 673public void SetClip(System.Drawing.Region region, System.Drawing.Drawing2D.CombineMode combineMode) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1032public System.Drawing.Region Clone() { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1036public void Complement(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1038public bool Equals(System.Drawing.Region region, System.Drawing.Graphics g) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1042public void Exclude(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1044public static System.Drawing.Region FromHrgn(System.IntPtr hrgn) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1052public void Intersect(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1079public void Union(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 1083public void Xor(System.Drawing.Region region) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (194)
mono\System.Drawing\GraphicsTests.cs (13)
105using Region r = new(); 336Region r = new(); 498using Region clone = g.Clip.Clone(); 1848Region[] regions = g.MeasureCharacterRanges(null, _font, default, null); 1872Region[] regions = g.MeasureCharacterRanges("Mono", _font, default, new StringFormat()); 1902Region[] regions = g.MeasureCharacterRanges(text, _font, layout_rect, string_format); 1971Region[] regions = g.MeasureCharacterRanges(text, _font, layout_rect, string_format); 2006private static Region[] Measure_Helper(Graphics gfx, RectangleF rect, bool useSpan) 2023Region[] zero = Measure_Helper(gfx, new RectangleF(0, 0, 0, 0), useSpan); 2026Region[] small = Measure_Helper(gfx, new RectangleF(0, 0, 100, 100), useSpan); 2038Region[] max = Measure_Helper(gfx, new RectangleF(0, 0, float.MaxValue, float.MaxValue), useSpan); 2057Region[] min = Measure_Helper(gfx, new RectangleF(0, 0, float.MinValue, float.MinValue), useSpan); 2068Region[] neg = Measure_Helper(gfx, new RectangleF(0, 0, -20, -20), useSpan);
mono\System.Imaging\MetafileTest.cs (1)
318Region[] region = g.MeasureCharacterRanges(text, test_font, rect, sf);
System\Drawing\Graphics_GetContextTests.Core.cs (11)
19graphics.GetContextInfo(out offset, out Region? clip); 29using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 35graphics.GetContextInfo(out offset, out Region? clip); 52graphics.GetContextInfo(out offset, out Region? clip); 62using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 69graphics.GetContextInfo(out offset, out Region? clip); 81using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 88graphics.GetContextInfo(out offset, out Region? clip); 100using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 109graphics.GetContextInfo(out offset, out Region? clip); 125graphics.GetContextInfo(out PointF offset, out Region? clip);
System\Drawing\Graphics_GetContextTests.cs (20)
20Assert.IsType<Region>(infoArray[0]); 22using Region region = (Region)infoArray[0]; 33using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 37using Region region = (Region)info[0]; 53using Region region = (Region)info[0]; 65using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 71using Region region = (Region)info[0]; 83using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 89using Region region = (Region)info[0]; 101using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 109using Region region = (Region)info[0]; 122using Region initialClip = new(new Rectangle(1, 2, 9, 10)); 131using Region region = (Region)info[0];
System\Drawing\RegionTests.cs (149)
34private static Region CreateDisposedRegion() 36Region region = new(); 44using Region region = new(); 58using Region region = new(rectangle); 74using Region region = new(rectangle); 89public void Ctor_RegionData(Region region) 93using Region otherRegion = new(region.GetRegionData()); 106using Region region = new(graphicsPath); 113using Region region = new(new Rectangle(1, 2, 3, 4)); 114using Region other = new(region.GetRegionData()); 127using Region region = new(); 139using Region region = new(); 149using Region region = new(graphicsPath); 157using Region region = new(); 170using Region region = new(graphicsPath); 185using Region region = new(graphicsPath); 225using (Region region = new(path)) 237using Region region = new(path); 259public void Clone(Region region) 262using (Region clone = Assert.IsType<Region>(region.Clone())) 337public void Complement_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 343using Region other = new(rect); 355using Region region = new(new Rectangle(20, 20, 20, 20)); 356using Region other = new(new Rectangle(20, 80, 20, 10)); 371using Region region = new(); 388using Region region = new(new Rectangle(1, 2, 3, 4)); 390using Region other = new(); 405using Region region = new(); 406AssertExtensions.Throws<ArgumentNullException>("region", () => region.Complement((Region)null)); 418using Region region = new(); 424public void Complement_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 440public void Complement_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 456public void Complement_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 479using Region region1 = new(rect1); 480using Region region2 = new(rect2); 499using Region region = new(); 508using Region region = new(); 515Region disposedRegion = CreateDisposedRegion(); 518using Region other = new(); 527static Region Empty() 529Region emptyRegion = new(); 534Region createdRegion = new(); 579public void Equals_Valid_ReturnsExpected(Region region, Region other, bool expected) 591using Region region = new(); 598using Region region = new(); 605using Region region = new(); 606using Region other = new(); 616Region disposedRegion = CreateDisposedRegion(); 773public void Exclude_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 779using Region other = new(rect); 791using Region region = new(new RectangleF(20, 20, 20, 20)); 792using Region union = new(new RectangleF(20, 80, 20, 10)); 802using Region region = new(new Rectangle(1, 2, 3, 4)); 803using Region other = new(); 812using Region region = new(); 813AssertExtensions.Throws<ArgumentNullException>("region", () => region.Exclude((Region)null)); 825using Region region = new(); 831public void Exclude_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 847public void Exclude_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 863public void Exclude_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 882using Region region = new(); 891using Region region = new(); 898Region disposedRegion = CreateDisposedRegion(); 901using Region other = new(); 911using Region region = new(new Rectangle(1, 2, 3, 4)); 917Region newRegion = Region.FromHrgn(handle1); 930AssertExtensions.Throws<ArgumentException>(null, () => Region.FromHrgn(IntPtr.Zero)); 936using Region region = new(new Rectangle(1, 2, 3, 4)); 948using Region region = new(); 960using Region region = new(); 973using Region region = new(); 980using Region region = new(); 987using Region region = new(); 1010using Region region = new(new Rectangle(1, 2, 3, 4)); 1022using Region region = new(); 1036using Region region = new(); 1045using Region clipRegion = new(); 1116public void Intersect_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1122using Region rectangleRegion = new(rect); 1134using Region region = new(new Rectangle(1, 2, 3, 4)); 1136using Region infiniteRegion = new(); 1145using Region region = new(); 1146AssertExtensions.Throws<ArgumentNullException>("region", () => region.Intersect((Region)null)); 1158using Region region = new(); 1164public void Intersect_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1181using Region region = new(); 1192public void Intersect_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1209using Region region = new(); 1220public void Intersect_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1239using Region region = new(); 1248using Region region = new(); 1255Region disposedRegion = CreateDisposedRegion(); 1258using Region other = new(); 1268using Region region = new(); 1281using Region region = new(); 1288using Region region = new(); 1303Region infiniteExclude = new(); 1325public void IsVisible_Rectangle_ReturnsExpected(Region region, Rectangle rectangle, bool expected) 1355Region infiniteExclude = new(); 1379public void IsVisible_Point_ReturnsExpected(Region region, Point point, bool expected) 1413Region disposedRegion = CreateDisposedRegion(); 1438public void MakeEmpty_NonEmpty_Success(Region region) 1465public void MakeInfinite_NonInfinity_Success(Region region) 1678public void Union_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1684using Region other = new(rect); 1696using Region region = new(new Rectangle(1, 2, 3, 4)); 1697using Region other = new(); 1707using Region region = new(); 1708AssertExtensions.Throws<ArgumentNullException>("region", () => region.Union((Region)null)); 1714using Region region = new(); 1721using Region region = new(); 1727public void Union_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1743public void Union_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1759public void Union_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 1778using Region region = new(); 1787using Region region = new(); 1794Region disposedRegion = CreateDisposedRegion(); 1797using Region other = new(); 1807using Region region = new(new RectangleF(1, 2, 3, 4)); 1816using Region region = new(new RectangleF(1, 2, 3, 4)); 1833using Region region = new(); 1848using Region region = new(); 1862using Region region = new(); 1875using Region region = new(); 1892using Region region = new(new RectangleF(1, 2, 3, 4)); 1901using Region region = new(); 1915using Region region = new(new RectangleF(1, 2, 3, 4)); 1924using Region region = new(); 1936using Region region = new(); 1953using Region region = new(new RectangleF(1, 2, 3, 4)); 1965Region disposedRegion = CreateDisposedRegion(); 2030public void Xor_Region_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 2036using Region other = new(rect); 2048using Region region = new(new Rectangle(1, 2, 3, 4)); 2049using Region other = new(); 2065using Region region = new(); 2066AssertExtensions.Throws<ArgumentNullException>("region", () => region.Xor((Region)null)); 2072using Region region = new(); 2079using Region region = new(); 2085public void Xor_Rectangle_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 2101public void Xor_RectangleF_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 2117public void Xor_GraphicsPath_Success(Region region, RectangleF[] rectangles, RectangleF[] expectedScans) 2136using Region region = new(); 2145using Region region = new(); 2152Region disposedRegion = CreateDisposedRegion(); 2155using Region other = new();
System.Windows.Forms (55)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
63private Region ActiveXMergeRegion(Region region) => ActiveXInstance.MergeRegion(region); 1211internal Region MergeRegion(Region region)
System\Windows\Forms\Control.cs (12)
2242using Region working = new(temp); 2713public Region? Region 2715get => Properties.GetValueOrDefault<Region>(s_regionProperty); 2718Region? oldRegion = SetRegionInternal(value); 2727private Region? SetRegionInternal(Region? region) 2729Region? oldRegion = Properties.AddOrRemoveValue(s_regionProperty, region); 2744using Region? regionCopy = IsActiveX ? ActiveXMergeRegion(region.Clone()) : null; 5757public void Invalidate(Region? region) 5768public unsafe void Invalidate(Region? region, bool invalidateChildren) 7236Region? region = Region; 8146internal unsafe void PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region? transparentRegion = null)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (2)
376Region oldClip = graphics.Clip; 386Region newClip = oldClip.Clone();
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
76Region? originalClip = null;
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (4)
5435using (Region region = new(scroll)) 19421Region? clipRegion = null; 19507using Region clipRegion = g.Clip; 19524using Region clipRegion = g.Clip;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
864using Region originalClip = g.Clip;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (1)
1587Region? clipRegion = null;
System\Windows\Forms\Controls\Labels\LinkLabel.cs (8)
43private Region? _textRegion; 509private Region? EnsureRun(Graphics g) 534Region[] textRegions = g.MeasureCharacterRanges(text, alwaysUnderlined, ClientRectWithPadding, textFormat); 588Region visualRegion = new(visualRectangle); 971Region? textRegion = EnsureRun(g); 1024Region originalClip = g.Clip; 1083using Region region = new(focusRectangle); 1231Region textRegion)
System\Windows\Forms\Controls\Labels\LinkLabel.Link.cs (1)
182internal Region? VisualRegion { get; set; }
System\Windows\Forms\Controls\Labels\LinkLabel.Link.LinkAccessibleObject.cs (1)
36Region? region = _owningLink.VisualRegion;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
1581Region oldClip = g.Clip;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (5)
1784Region? region = null; 2629using Region? transparentRegion = Renderer.GetTransparentRegion(this); 3453using Region? transparentRegion = Renderer.GetTransparentRegion(this); 3641using (Region? transparentRegion = Renderer.GetTransparentRegion(this)) 3670private void EraseCorners(PaintEventArgs e, Region transparentRegion)
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (1)
665public new Region? Region
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
29Region region = new(bounds);
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (2)
834internal override Region? GetTransparentRegion(ToolStrip toolStrip) 882Region parentRegionToPaint = new(topLeftParentHorizontalPixels);
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
561internal virtual Region? GetTransparentRegion(ToolStrip toolStrip)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
315using Region windowRegion = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (2)
15private Region? _region; 31public unsafe Region Region
System\Windows\Forms\Rendering\ControlPaint.cs (1)
1878Region clip = graphics.Clip;
System\Windows\Forms\Rendering\DrawingEventArgs.cs (1)
157graphics.GetContextInfo(out PointF offset, out Region? clip);
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (4)
446public unsafe Region? GetBackgroundRegion(IDeviceContext dc, Rectangle bounds) 469Region region = Region.FromHrgn(hrgn); 738public HitTestCode HitTestBackground(Graphics g, Rectangle backgroundRectangle, Region region, Point pt, HitTestOptions options)
System.Windows.Forms.Design (43)
System\Windows\Forms\Design\Behavior\Adorner.cs (1)
84public void Invalidate(Region region)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (2)
127internal void InvalidateAdornerWindow(Region region) 303using Region region = hrgn.ToRegion();
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
377public void Invalidate(Region r) => _adornerWindow.InvalidateAdornerWindow(r);
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (3)
58private Region _dragImageRegion; 800Region invalidRegion = new(unionRectangle); 804using (Region invalidDragRegion = _dragImageRegion.Clone())
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (4)
49private Region _lastResizeRegion; 386using (Region newRegion = new(borderRect)) 853using Region newRegion = new(newBorderRect); 862using Region oldRegion = new(oldBorderRect);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (3)
314private Region DetermineRegionToRefresh(object? primarySelection, Rectangle[] previousSelectionBounds, Rectangle[] currentSelectionBounds) 316Region toRefresh = new(Rectangle.Empty); 425Region toUpdate = DetermineRegionToRefresh(primarySelection, _previousSelectionBounds, _currentSelectionBounds);
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (1)
332using Region invalidRegion = new(_lastRectangle);
System\Windows\Forms\Design\ControlDesigner.cs (4)
2054using Region region = hrgn.ToRegion(); 2121using Region nonClient = new(controlScreenBounds); 2263using Region textRegion = e.Graphics.MeasureCharacterRanges(exceptionText, errorFont, textRect, stringFormat)[0]; 2266Region originalClip = e.Graphics.Clip;
System\Windows\Forms\Design\DesignerFrame.cs (3)
255void IOverlayService.InvalidateOverlays(Region screenRegion) 477public void InvalidateOverlays(Region screenRegion) 485using Region intersectionRegion = screenRegion.Clone();
System\Windows\Forms\Design\DesignerUtils.cs (2)
212public static void DrawResizeBorder(Graphics g, Region resizeBorder, Color backColor) 226public static void DrawFrame(Graphics g, Region resizeBorder, FrameStyle style, Color backColor)
System\Windows\Forms\Design\IOverlayService.cs (1)
43void InvalidateOverlays(Region screenRegion);
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
1790using (Region newRegion = new(frameRect)) 1982using Region newRegion = new(frameRect); 1999using Region oldRegion = new(oldFrameRect);
System\Windows\Forms\Design\SelectionUIService.ContainerSelectionUIItem.cs (1)
63public override Region GetRegion()
System\Windows\Forms\Design\SelectionUIService.cs (1)
830Region region = new(new Rectangle(0, 0, 0, 0));
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (3)
64internal Region? _region; // region object that defines the shape 137Region oldClip = graphics.Clip; 327public virtual Region GetRegion()
System\Windows\Forms\Design\TabOrder.cs (2)
33private Region? _region; 216Region clip = graphics.Clip;
System\Windows\Forms\Design\ToolStripAdornerWindowService.cs (2)
134public void Invalidate(Region r) 256internal void InvalidateAdornerWindow(Region region)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
430Region invalidateRegion = null; 431Region itemRegion = null;
System\Windows\Forms\Design\ToolStripItemBehavior.cs (1)
82Region rgn = new(bounds);
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (2)
1183using Region invalidatingRegion = new(_dropDownSizeToInvalidate); 1920using Region regionToInvalidate = new(_boundsToInvalidateOnRemove);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
839Region rgn = new(invalidateBounds);
System.Windows.Forms.Primitives (3)
System\Drawing\RegionExtensions.cs (2)
8public static Region ToRegion(this RegionScope scope) => Region.FromHrgn(scope.Region);
System\Windows\Forms\GraphicsClipScope.cs (1)
13private readonly Region _originalClip;
System.Windows.Forms.Primitives.Tests (4)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (2)
19using Region r = new(clipRectangle); 102using Region r = new(clipRectangle);
System\Windows\Forms\DeviceContextScopeTests.cs (2)
35using Region oldRegion = graphics.Clip; 41using Region region = new(new Rectangle(1, 1, 2, 3));
System.Windows.Forms.Tests (26)
System\Windows\Forms\ControlTests.Handlers.cs (3)
2189public void Control_OnHandleCreated_InvokeWithRegion_CallsHandleCreated(EventArgs eventArgs, Region region) 2341public void Control_OnHandleDestroyed_InvokeWithRegion_CallsHandleDestroyed(EventArgs eventArgs, Region region) 2480public void Control_OnHandleDestroyed_InvokeWithHandleWithRegion_CallsHandleDestroyed(EventArgs eventArgs, Region region)
System\Windows\Forms\ControlTests.Methods.cs (9)
456public void Control_CreateControl_InvokeWithRegion_Success(Region region) 643public void Control_CreateHandle_InvokeWithRegion_Success(Region region) 865public void Control_DestroyHandle_InvokeWithRegion_Success(Region region) 3520public void Control_Invalidate_InvokeRegion_Success(bool opaque, Region region) 3552public void Control_Invalidate_InvokeRegionWithHandle_Success(bool opaque, Region region, Rectangle expectedInvalidRect) 3588public void Control_Invalidate_InvokeRegionWithChildrenWithHandle_Success(bool opaque, Region region, Rectangle expectedInvalidRect) 3660public void Control_Invalidate_InvokeRegionBool_Success(bool opaque, Region region, bool invalidateChildren) 3695public void Control_Invalidate_InvokeRegionBoolWithHandle_Success(bool opaque, Region region, bool invalidateChildren, Rectangle expectedInvalidRect) 3731public void Control_Invalidate_InvokeRegionBoolWithChildrenWithHandle_Success(bool opaque, Region region, bool invalidateChildren, Rectangle expectedInvalidRect)
System\Windows\Forms\ControlTests.Properties.cs (8)
9876public void Control_Region_Set_GetReturnsExpected(Region value) 9893public void Control_Region_SetWithNonNullOldValue_GetReturnsExpected(Region value) 9895using Region oldValue = new(); 9916public void Control_Region_SetWithHandle_GetReturnsExpected(Region value) 9945public void Control_Region_SetWithNonNullOldValueWithHandle_GetReturnsExpected(Region value) 9947using Region oldValue = new(); 9993using Region region1 = new(); 10004using Region region2 = new();
System\Windows\Forms\TextRendererTests.cs (2)
759using Region region = new(new Rectangle(1, 2, 6, 8)); 807using Region region = new(new Rectangle(1, 2, 6, 8));
System\Windows\Forms\ToolStripDropDownTests.cs (4)
2237public void ToolStripDropDown_Region_Set_GetReturnsExpected(Region value) 2254public void ToolStripDropDown_Region_SetWithHandle_GetReturnsExpected(Region value) 2295using Region region1 = new(); 2306using Region region2 = new();