156 references to LineCap
System.Drawing (1)
System.Drawing.cs (1)
41[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Drawing2D.LineCap))]
System.Drawing.Common (42)
GlobalUsings.cs (1)
28global using LineCap = System.Drawing.Drawing2D.LineCap;
System\Drawing\Drawing2D\CustomLineCap.cs (11)
15public CustomLineCap(GraphicsPath? fillPath, GraphicsPath? strokePath) : this(fillPath, strokePath, LineCap.Flat) { } 17public CustomLineCap(GraphicsPath? fillPath, GraphicsPath? strokePath, LineCap baseCap) : this(fillPath, strokePath, baseCap, 0) { } 19public CustomLineCap(GraphicsPath? fillPath, GraphicsPath? strokePath, LineCap baseCap, float baseInset) 99public void SetStrokeCaps(LineCap startCap, LineCap endCap) 105public void GetStrokeCaps(out LineCap startCap, out LineCap endCap) 107fixed (LineCap* sc = &startCap) 108fixed (LineCap* ec = &endCap) 131public LineCap BaseCap 135LineCap baseCap;
System\Drawing\Pen.cs (30)
159public void SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap) 178public LineCap StartCap 182LineCap startCap; 191case LineCap.Flat: 192case LineCap.Square: 193case LineCap.Round: 194case LineCap.Triangle: 195case LineCap.NoAnchor: 196case LineCap.SquareAnchor: 197case LineCap.RoundAnchor: 198case LineCap.DiamondAnchor: 199case LineCap.ArrowAnchor: 200case LineCap.AnchorMask: 201case LineCap.Custom: 204throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(LineCap)); 220public LineCap EndCap 224LineCap endCap; 233case LineCap.Flat: 234case LineCap.Square: 235case LineCap.Round: 236case LineCap.Triangle: 237case LineCap.NoAnchor: 238case LineCap.SquareAnchor: 239case LineCap.RoundAnchor: 240case LineCap.DiamondAnchor: 241case LineCap.ArrowAnchor: 242case LineCap.AnchorMask: 243case LineCap.Custom: 246throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(LineCap));
System.Drawing.Common.Tests (113)
System\Drawing\Drawing2D\AdjustableArrowCapTests.cs (1)
117Assert.Equal(LineCap.Triangle, arrowCap.BaseCap);
System\Drawing\Drawing2D\CustomLineCapTests.cs (74)
10yield return new object[] { new GraphicsPath(), null, LineCap.Flat, 0f, LineCap.Flat }; 11yield return new object[] { new GraphicsPath(), null, LineCap.Square, 1f, LineCap.Square }; 12yield return new object[] { new GraphicsPath(), null, LineCap.Round, -1f, LineCap.Round }; 13yield return new object[] { new GraphicsPath(), null, LineCap.Triangle, float.MaxValue, LineCap.Triangle }; 15yield return new object[] { new GraphicsPath(), null, LineCap.NoAnchor, 0f, LineCap.Flat }; 16yield return new object[] { new GraphicsPath(), null, LineCap.SquareAnchor, 0f, LineCap.Flat }; 17yield return new object[] { new GraphicsPath(), null, LineCap.DiamondAnchor, 0f, LineCap.Flat }; 18yield return new object[] { new GraphicsPath(), null, LineCap.ArrowAnchor, 0f, LineCap.Flat }; 23yield return new object[] { null, strokePath, LineCap.Square, 0f, LineCap.Square }; 30yield return new object[] { null, strokePath, LineCap.Flat, 0f, LineCap.Flat }; 37yield return new object[] { fillPath, null, LineCap.Flat, 0f, LineCap.Flat }; 42public void Ctor_Path_Path_LineCap_Float(GraphicsPath fillPath, GraphicsPath strokePath, LineCap baseCap, float baseInset, LineCap expectedCap) 57[InlineData(LineCap.Flat - 1)] 58[InlineData(LineCap.Custom + 1)] 59public void Ctor_InvalidLineCap_ReturnsFlat(LineCap baseCap) 64Assert.Equal(LineCap.Flat, customLineCap.BaseCap); 87[InlineData(LineCap.Square, LineCap.Square)] 88[InlineData(LineCap.Round, LineCap.Round)] 89[InlineData(LineCap.Triangle, LineCap.Triangle)] 90public void SetThenGetStrokeCaps_Success(LineCap startCap, LineCap endCap) 95customLineCap.GetStrokeCaps(out LineCap retrievedStartCap, out LineCap retrievedEndCap); 102[InlineData(LineCap.SquareAnchor, LineCap.SquareAnchor)] 103[InlineData(LineCap.Custom, LineCap.Custom)] 104[InlineData(LineCap.Square, LineCap.Custom)] 105[InlineData(LineCap.Custom, LineCap.SquareAnchor)] 106[InlineData(LineCap.Flat - 1, LineCap.Flat)] // Below valid enum range 107[InlineData(LineCap.Custom + 1, LineCap.Flat)] // Above valid enum range 108public void SetStrokeCaps_InvalidLineCap_ThrowsArgumentException(LineCap startCap, LineCap endCap) 115customLineCap.GetStrokeCaps(out LineCap retrievedStartCap, out LineCap retrievedEndCap); 116Assert.Equal(LineCap.Flat, retrievedStartCap); 117Assert.Equal(LineCap.Flat, retrievedEndCap); 137[InlineData(LineCap.Flat)] // Default value 138[InlineData(LineCap.Square)] 139[InlineData(LineCap.Round)] 140[InlineData(LineCap.Triangle)] 141public void BaseCap_SetThenGet_Success(LineCap baseCap) 150[InlineData(LineCap.NoAnchor)] 151[InlineData(LineCap.SquareAnchor)] 152[InlineData(LineCap.RoundAnchor)] 153[InlineData(LineCap.DiamondAnchor)] 154[InlineData(LineCap.Custom)] 155[InlineData(LineCap.Flat - 1)] 156[InlineData(LineCap.Custom + 1)] 157public void BaseCap_Set_InvalidLineCap_ThrowsArgumentException(LineCap baseCap) 162Assert.Equal(LineCap.Flat, customLineCap.BaseCap); 218AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.SetStrokeCaps(LineCap.Flat, LineCap.Flat)); 219AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.GetStrokeCaps(out LineCap startCap, out LineCap endCap));
System\Drawing\PenTests.cs (34)
643yield return new object[] { LineCap.Flat }; 644yield return new object[] { LineCap.Square }; 645yield return new object[] { LineCap.Round }; 646yield return new object[] { LineCap.Triangle }; 647yield return new object[] { LineCap.NoAnchor }; 648yield return new object[] { LineCap.SquareAnchor }; 649yield return new object[] { LineCap.RoundAnchor }; 650yield return new object[] { LineCap.DiamondAnchor }; 651yield return new object[] { LineCap.ArrowAnchor }; 652yield return new object[] { LineCap.AnchorMask }; 653yield return new object[] { LineCap.Custom }; 658public void EndCap_SetValid_GetReturnsExpected(LineCap lineCap) 668yield return new object[] { LineCap.Flat - 1 }; 669yield return new object[] { LineCap.Triangle + 1 }; 670yield return new object[] { LineCap.ArrowAnchor + 1 }; 671yield return new object[] { LineCap.AnchorMask + 1 }; 672yield return new object[] { LineCap.Custom + 1 }; 677public void EndCap_SetInvalid_ThrowsInvalidEnumArgumentException(LineCap lineCap) 692AssertExtensions.Throws<ArgumentException>(null, () => pen.EndCap = LineCap.ArrowAnchor); 1000[InlineData(LineCap.Flat, LineCap.Round, DashCap.Triangle)] 1001[InlineData(LineCap.Flat - 1, LineCap.Flat - 1, DashCap.Flat - 1)] 1002[InlineData((LineCap)int.MaxValue, (LineCap)int.MaxValue, (DashCap)int.MaxValue)] 1003public void SetLineCap_Invoke_Success(LineCap startCap, LineCap endCap, DashCap dashCap) 1026AssertExtensions.Throws<ArgumentException>(null, () => pen.SetLineCap(LineCap.AnchorMask, LineCap.ArrowAnchor, DashCap.Flat)); 1031public void StartCap_SetValid_GetReturnsExpected(LineCap lineCap) 1041public void StartCap_SetInvalid_ThrowsInvalidEnumArgumentException(LineCap lineCap) 1056AssertExtensions.Throws<ArgumentException>(null, () => pen.StartCap = LineCap.ArrowAnchor); 1217Assert.Equal(LineCap.Flat, pen.EndCap); 1221Assert.Equal(LineCap.Flat, pen.StartCap);
System\Drawing\SystemPensTest.cs (4)
59AssertExtensions.Throws<ArgumentException>(null, () => pen.SetLineCap(LineCap.ArrowAnchor, LineCap.Custom, DashCap.Round)); 71AssertExtensions.Throws<ArgumentException>(null, () => pen.EndCap = LineCap.RoundAnchor); 74AssertExtensions.Throws<ArgumentException>(null, () => pen.StartCap = LineCap.RoundAnchor);