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