109 references to SnapLineType
System.Design (1)
artifacts\obj\System.Design.Facade\Release\net10.0\System.Design.Forwards.cs (1)
82
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Windows.Forms.Design.Behavior.
SnapLineType
))]
System.Windows.Forms.Design (60)
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
41
private readonly List<
SnapLineType
> _targetSnapLineTypes = [];
936
else if (snapLine.SnapLineType ==
SnapLineType
.Baseline)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (8)
164
lines.Add(new SnapLine(
SnapLineType
.Bottom, loc.Y - 1));
167
lines.Add(new SnapLine(
SnapLineType
.Horizontal, loc.Y + _primaryControl.Margin.Bottom, SnapLine.MarginBottom, SnapLinePriority.Always));
172
lines.Add(new SnapLine(
SnapLineType
.Top, loc.Y));
175
lines.Add(new SnapLine(
SnapLineType
.Horizontal, loc.Y - _primaryControl.Margin.Top, SnapLine.MarginTop, SnapLinePriority.Always));
181
lines.Add(new SnapLine(
SnapLineType
.Right, loc.X - 1));
184
lines.Add(new SnapLine(
SnapLineType
.Vertical, loc.X + _primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always));
189
lines.Add(new SnapLine(
SnapLineType
.Left, loc.X));
192
lines.Add(new SnapLine(
SnapLineType
.Vertical, loc.X - _primaryControl.Margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
System\Windows\Forms\Design\Behavior\SnapLine.cs (12)
37
public SnapLine(
SnapLineType
type, int offset)
45
public SnapLine(
SnapLineType
type, int offset, string? filter)
53
public SnapLine(
SnapLineType
type, int offset, SnapLinePriority priority)
61
public SnapLine(
SnapLineType
type, int offset, string? filter, SnapLinePriority priority)
79
public bool IsHorizontal => SnapLineType is
SnapLineType
.Top
80
or
SnapLineType
.Bottom
81
or
SnapLineType
.Horizontal
82
or
SnapLineType
.Baseline;
87
public bool IsVertical => SnapLineType is
SnapLineType
.Left
88
or
SnapLineType
.Right
89
or
SnapLineType
.Vertical;
104
public
SnapLineType
SnapLineType { get; }
System\Windows\Forms\Design\Behavior\ToolboxItemSnapLineBehavior.cs (8)
231
new(
SnapLineType
.Left, r.Left),
232
new(
SnapLineType
.Right, r.Right),
233
new(
SnapLineType
.Bottom, r.Bottom),
234
new(
SnapLineType
.Top, r.Top),
235
new(
SnapLineType
.Horizontal, r.Top - 4, SnapLine.MarginTop, SnapLinePriority.Always),
236
new(
SnapLineType
.Horizontal, r.Bottom + 3, SnapLine.MarginBottom, SnapLinePriority.Always),
237
new(
SnapLineType
.Vertical, r.Left - 4, SnapLine.MarginLeft, SnapLinePriority.Always),
238
new(
SnapLineType
.Vertical, r.Right + 3, SnapLine.MarginRight, SnapLinePriority.Always)
System\Windows\Forms\Design\ButtonBaseDesigner.cs (1)
97
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
System\Windows\Forms\Design\ComboBoxDesigner.cs (1)
35
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
System\Windows\Forms\Design\ControlCommandSet.cs (6)
477
lines.Add(new SnapLine(
SnapLineType
.Right, pt.X + primaryControl.Width - 1));
478
lines.Add(new SnapLine(
SnapLineType
.Vertical, pt.X + primaryControl.Width + primaryControl.Margin.Right, SnapLine.MarginRight, SnapLinePriority.Always));
485
lines.Add(new SnapLine(
SnapLineType
.Left, pt.X));
486
lines.Add(new SnapLine(
SnapLineType
.Vertical, pt.X - primaryControl.Margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
498
lines.Add(new SnapLine(
SnapLineType
.Bottom, pt.Y + primaryControl.Height - 1));
499
lines.Add(new SnapLine(
SnapLineType
.Horizontal, pt.Y + primaryControl.Height + primaryControl.Margin.Bottom, SnapLine.MarginBottom, SnapLinePriority.Always));
System\Windows\Forms\Design\ControlDesigner.cs (8)
352
snapLines.Add(new SnapLine(
SnapLineType
.Top, 0, SnapLinePriority.Low));
353
snapLines.Add(new SnapLine(
SnapLineType
.Bottom, height - 1, SnapLinePriority.Low));
354
snapLines.Add(new SnapLine(
SnapLineType
.Left, 0, SnapLinePriority.Low));
355
snapLines.Add(new SnapLine(
SnapLineType
.Right, width - 1, SnapLinePriority.Low));
360
snapLines.Add(new SnapLine(
SnapLineType
.Horizontal, -margin.Top, SnapLine.MarginTop, SnapLinePriority.Always));
361
snapLines.Add(new SnapLine(
SnapLineType
.Horizontal, margin.Bottom + height, SnapLine.MarginBottom, SnapLinePriority.Always));
362
snapLines.Add(new SnapLine(
SnapLineType
.Vertical, -margin.Left, SnapLine.MarginLeft, SnapLinePriority.Always));
363
snapLines.Add(new SnapLine(
SnapLineType
.Vertical, margin.Right + width, SnapLine.MarginRight, SnapLinePriority.Always));
System\Windows\Forms\Design\DateTimePickerDesigner.cs (1)
31
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
System\Windows\Forms\Design\LabelDesigner.cs (3)
60
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
79
if (snapLine is not null && snapLine.SnapLineType == (rtl ?
SnapLineType
.Right :
SnapLineType
.Left))
System\Windows\Forms\Design\ParentControlDesigner.cs (8)
319
snapLines.Add(new SnapLine(
SnapLineType
.Vertical, displayRectangle.Left, SnapLine.PaddingLeft, SnapLinePriority.Always));
320
snapLines.Add(new SnapLine(
SnapLineType
.Vertical, displayRectangle.Right, SnapLine.PaddingRight, SnapLinePriority.Always));
321
snapLines.Add(new SnapLine(
SnapLineType
.Horizontal, displayRectangle.Top, SnapLine.PaddingTop, SnapLinePriority.Always));
322
snapLines.Add(new SnapLine(
SnapLineType
.Horizontal, displayRectangle.Bottom, SnapLine.PaddingBottom, SnapLinePriority.Always));
848
new SnapLine(
SnapLineType
.Left, r.Right),
849
new SnapLine(
SnapLineType
.Right, r.Right),
850
new SnapLine(
SnapLineType
.Bottom, r.Bottom),
851
new SnapLine(
SnapLineType
.Top, r.Bottom)
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
56
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
System\Windows\Forms\Design\UpDownBaseDesigner.cs (1)
52
snapLines.Add(new SnapLine(
SnapLineType
.Baseline, baseline, SnapLinePriority.Medium));
System.Windows.Forms.Design.Tests (48)
System\Windows\Forms\Design\Behavior\SnapLineTests.cs (42)
20
SnapLine snapLine = new(
SnapLineType
.Baseline, DefaultOffset);
22
Assert.Equal(
SnapLineType
.Baseline, snapLine.SnapLineType);
31
SnapLine snapLine = new(
SnapLineType
.Baseline, DefaultOffset, DefaultFilter);
33
Assert.Equal(
SnapLineType
.Baseline, snapLine.SnapLineType);
42
SnapLine snapLine = new(
SnapLineType
.Baseline, DefaultOffset, DefaultPriority);
44
Assert.Equal(
SnapLineType
.Baseline, snapLine.SnapLineType);
53
SnapLine snapLine = new(
SnapLineType
.Baseline, DefaultOffset, DefaultFilter, DefaultPriority);
55
Assert.Equal(
SnapLineType
.Baseline, snapLine.SnapLineType);
62
[InlineData(
SnapLineType
.Top, true)]
63
[InlineData(
SnapLineType
.Bottom, true)]
64
[InlineData(
SnapLineType
.Horizontal, true)]
65
[InlineData(
SnapLineType
.Baseline, true)]
66
[InlineData(
SnapLineType
.Left, false)]
67
[InlineData(
SnapLineType
.Right, false)]
68
[InlineData(
SnapLineType
.Vertical, false)]
69
public void SnapLine_IsHorizontal(
SnapLineType
type, bool expected)
77
[InlineData(
SnapLineType
.Top, false)]
78
[InlineData(
SnapLineType
.Bottom, false)]
79
[InlineData(
SnapLineType
.Horizontal, false)]
80
[InlineData(
SnapLineType
.Baseline, false)]
81
[InlineData(
SnapLineType
.Left, true)]
82
[InlineData(
SnapLineType
.Right, true)]
83
[InlineData(
SnapLineType
.Vertical, true)]
84
public void SnapLine_IsVertical(
SnapLineType
type, bool expected)
93
foreach (object type in Enum.GetValues(typeof(
SnapLineType
)))
101
public void SnapLine_ensure_IsHorizontal_IsVertical_do_not_overlap(
SnapLineType
type)
115
SnapLine snapLine = new(
SnapLineType
.Baseline, offset, DefaultFilter, DefaultPriority);
124
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, DefaultFilter, DefaultPriority);
125
SnapLine snapLine2 = new(
SnapLineType
.Baseline, DefaultOffset, DefaultFilter, DefaultPriority);
133
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, null, DefaultPriority);
134
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, null, SnapLinePriority.Low);
142
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, null, DefaultPriority);
143
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, DefaultFilter, SnapLinePriority.Low);
178
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, snapLine1Filter, DefaultPriority);
179
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, snapLine2Filter, SnapLinePriority.Low);
208
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, snapLine1Filter, DefaultPriority);
209
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, snapLine2Filter, SnapLinePriority.Low);
217
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, "custom filter", DefaultPriority);
218
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, "custom filter", SnapLinePriority.Low);
226
SnapLine snapLine1 = new(
SnapLineType
.Top, DefaultOffset, "custom filter", DefaultPriority);
227
SnapLine snapLine2 = new(
SnapLineType
.Top, DefaultOffset, "another filter", SnapLinePriority.Low);
237
SnapLine snapLine = new(
SnapLineType
.Baseline, DefaultOffset, filter, DefaultPriority);
System\Windows\Forms\Design\ParentControlDesignerTests.cs (4)
42
.Contain(sl => sl.SnapLineType ==
SnapLineType
.Top)
43
.And.Contain(sl => sl.SnapLineType ==
SnapLineType
.Bottom)
44
.And.Contain(sl => sl.SnapLineType ==
SnapLineType
.Left)
45
.And.Contain(sl => sl.SnapLineType ==
SnapLineType
.Right);
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (1)
55
SnapLine? baselineSnapLine = snapLines.Cast<SnapLine>().FirstOrDefault(sl => sl.SnapLineType ==
SnapLineType
.Baseline);
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (1)
55
SnapLine? baselineSnapLine = snapLines.FirstOrDefault(sl => sl.SnapLineType ==
SnapLineType
.Baseline);